MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / dispatchTool

Method dispatchTool

src/mcp/tools.ts:1549–1560  ·  view source on GitHub ↗

* Pure dispatch over the read tools — the switch, with no gate, no notices, no * allowlist/validation (the caller owns those). `codegraph_status` is handled * on the main thread in execute and never reaches here. May throw * NotIndexed/PathRefusal, which executeReadTool clas

(toolName: string, args: Record<string, unknown>)

Source from the content-addressed store, hash-verified

1547 * NotIndexed/PathRefusal, which {@link executeReadTool} classifies.
1548 */
1549 private async dispatchTool(toolName: string, args: Record<string, unknown>): Promise<ToolResult> {
1550 switch (toolName) {
1551 case 'codegraph_search': return await this.handleSearch(args);
1552 case 'codegraph_callers': return await this.handleCallers(args);
1553 case 'codegraph_callees': return await this.handleCallees(args);
1554 case 'codegraph_impact': return await this.handleImpact(args);
1555 case 'codegraph_explore': return await this.handleExplore(args);
1556 case 'codegraph_node': return await this.handleNode(args);
1557 case 'codegraph_files': return await this.handleFiles(args);
1558 default: return this.errorResult(`Unknown tool: ${toolName}`);
1559 }
1560 }
1561
1562 /**
1563 * Handle codegraph_search

Callers 1

executeReadToolMethod · 0.95

Calls 8

handleSearchMethod · 0.95
handleCallersMethod · 0.95
handleCalleesMethod · 0.95
handleImpactMethod · 0.95
handleExploreMethod · 0.95
handleNodeMethod · 0.95
handleFilesMethod · 0.95
errorResultMethod · 0.95

Tested by

no test coverage detected