MCPcopy Create free account
hub / github.com/deepnote/deepnote / getDebugExecutionPrompt

Function getDebugExecutionPrompt

packages/mcp/src/prompts.ts:109–177  ·  view source on GitHub ↗
(args: Record<string, string> | undefined)

Source from the content-addressed store, hash-verified

107}
108
109function getDebugExecutionPrompt(args: Record<string, string> | undefined): GetPromptResult {
110 const notebookPath = args?.notebook_path || 'notebook.deepnote'
111 const executionId = args?.execution_id
112 const errorMessage = args?.error_message
113
114 return {
115 description: 'Debug notebook execution using snapshots',
116 messages: [
117 {
118 role: 'user',
119 content: {
120 type: 'text',
121 text: `Debug the notebook execution for: ${notebookPath}
122${executionId ? `Execution ID: ${executionId}` : ''}
123${errorMessage ? `Error message: ${errorMessage}` : ''}
124
125## Understanding Outputs
126
127**All execution outputs are saved to snapshot files.** After running a notebook:
1281. The response includes \`snapshotPath\` - this is where all results live
1292. Use \`${TOOL_NAMES.snapshotLoad}\` to inspect outputs
130
131## Debugging Workflow
132
133### Step 1: Run the notebook
134\`\`\`
135${TOOL_NAMES.run} path="${notebookPath}"
136\`\`\`
137
138The response will include:
139- \`snapshotPath\`: Path to saved outputs (e.g., "snapshots/notebook_uuid_latest.snapshot.deepnote")
140- \`executedBlocks\`, \`failedBlocks\`: Execution summary
141- \`results\`: Per-block success/failure info
142
143### Step 2: Inspect the snapshot
144\`\`\`
145${TOOL_NAMES.snapshotLoad} path="<snapshotPath from step 1>"
146\`\`\`
147
148The snapshot contains:
149- **Block outputs**: stdout, return values, charts
150- **Errors**: Full tracebacks for failed blocks
151- **Timing**: When execution started/finished
152- **Execution counts**: Order blocks ran
153
154### Step 3: Debug issues
155If blocks failed:
1561. Check error messages in the snapshot
1572. Use \`${TOOL_NAMES.cat} path="${notebookPath}" blockId="<failed-block-id>"\` to see the code
1583. Fix the issue with \`${TOOL_NAMES.editBlock}\`
1594. Re-run and compare snapshots
160
161### Step 4: Compare runs
162Each run creates a new snapshot. Use \`${TOOL_NAMES.snapshotList}\` to see history and compare outputs between runs.
163
164## Key Tools
165
166| Tool | Purpose |

Callers 1

getPromptFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected