trigger_vscode_reload
Reload a Jupyter notebook in VS Code to apply changes made through the MCP Jupyter Server, ensuring the editor displays updated content.
Instructions
Trigger VS Code to reload the notebook file
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| notebook_path | Yes | Absolute path to the Jupyter notebook file |
Input Schema (JSON Schema)
{
"properties": {
"notebook_path": {
"description": "Absolute path to the Jupyter notebook file",
"type": "string"
}
},
"required": [
"notebook_path"
],
"type": "object"
}
Implementation Reference
- src/vscode-integration.js:11-29 (handler)The core handler function that updates the file's access and modification times (touches the file) to trigger VS Code's file watcher for reloading the notebook.async triggerReload(notebookPath) { try { // Touch the file to trigger VS Code's file watcher const stats = await fs.stat(notebookPath); const now = new Date(); await fs.utimes(notebookPath, now, now); return { content: [ { type: "text", text: `Triggered VS Code reload for: ${notebookPath}` } ] }; } catch (error) { throw new Error(`Failed to trigger reload: ${error.message}`); } }
- src/index.js:308-321 (schema)Tool schema definition in the list_tools response, specifying the input schema that requires 'notebook_path'.{ name: "trigger_vscode_reload", description: "Trigger VS Code to reload the notebook file", inputSchema: { type: "object", properties: { notebook_path: { type: "string", description: "Absolute path to the Jupyter notebook file" } }, required: ["notebook_path"] } }
- src/index.js:396-397 (registration)Registration in the CallToolRequestHandler switch statement, dispatching to VSCodeIntegration.triggerReload.case "trigger_vscode_reload": return await this.vscodeIntegration.triggerReload(args.notebook_path);