docs_refresh
Re-scan filesystem for docs after installing or updating a @particle-academy/* package mid-session.
Instructions
Re-scan the filesystem for docs. Call this after installing or updating a @particle-academy/* package mid-session.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools.ts:153-167 (registration)The docs_refresh tool is registered via server.registerTool with name 'docs_refresh', description, inputSchema (empty object), and handler function (lines 160-166). It calls the closure refresh() which re-scans the filesystem and updates the cache.
server.registerTool( { name: "docs_refresh", description: "Re-scan the filesystem for docs. Call this after installing or updating a @particle-academy/* package mid-session.", inputSchema: { type: "object", properties: {} }, }, () => { const next = refresh(); return textResult( `Re-scanned. Found ${next.length} package(s) with docs.`, { packageCount: next.length }, ); }, ); - src/tools.ts:18-21 (handler)The refresh closure inside registerDocsTools is the core handler logic for docs_refresh. It calls scan(options) and updates the cached PackageDocs array.
const refresh = () => { cache = scan(options); return cache; }; - src/tools.ts:155-158 (schema)The input schema for docs_refresh requires no parameters — it's an empty object schema.
name: "docs_refresh", description: "Re-scan the filesystem for docs. Call this after installing or updating a @particle-academy/* package mid-session.", inputSchema: { type: "object", properties: {} }, - src/cli.ts:96-96 (registration)The registerDocsTools function is invoked from the CLI entry point, tying the registration to the actual server instance.
registerDocsTools(server, opts); - src/mcp.ts:78-78 (helper)The McpServer.registerTool method stores the tool definition and handler in an internal Map for later dispatch via tools/call.
registerTool(definition: ToolDefinition, handler: ToolHandler): void {