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

Method executeReadTool

src/mcp/tools.ts:2862–2881  ·  view source on GitHub ↗

* Run a single read tool to completion and return its raw ToolResult, * classifying expected failures the same way execute's catch does so * the SHAPE is identical whether dispatch runs in-process or on a worker: * NotIndexed → success-shaped guidance, PathRefusal → clean er

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

Source from the content-addressed store, hash-verified

2860 * path validation already ran in {@link execute} before routing here.
2861 */
2862 async executeReadTool(toolName: string, args: Record<string, unknown>): Promise<ToolResult> {
2863 try {
2864 return await this.dispatchTool(toolName, args);
2865 } catch (err) {
2866 if (err instanceof NotIndexedError) {
2867 return this.textResult(err.message);
2868 }
2869 if (err instanceof WslSharedIndexError) {
2870 return this.textResult(wslSharedIndexGuidance(err));
2871 }
2872 if (err instanceof PathRefusalError) {
2873 return this.errorResult(err.message);
2874 }
2875 return this.errorResult(
2876 `Tool execution failed: ${err instanceof Error ? err.message : String(err)}. ` +
2877 'This is an internal codegraph error — retry the call once; if it persists, ' +
2878 'continue without codegraph for this task.'
2879 );
2880 }
2881 }
2882
2883 /**
2884 * Pure dispatch over the read tools — the switch, with no gate, no notices, no

Callers 4

executeMethod · 0.95
serveFunction · 0.80

Calls 4

dispatchToolMethod · 0.95
textResultMethod · 0.95
errorResultMethod · 0.95
wslSharedIndexGuidanceFunction · 0.85

Tested by

no test coverage detected