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

Method executeReadTool

src/mcp/tools.ts:1453–1469  ·  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

1451 * path validation already ran in {@link execute} before routing here.
1452 */
1453 async executeReadTool(toolName: string, args: Record<string, unknown>): Promise<ToolResult> {
1454 try {
1455 return await this.dispatchTool(toolName, args);
1456 } catch (err) {
1457 if (err instanceof NotIndexedError) {
1458 return this.textResult(err.message);
1459 }
1460 if (err instanceof PathRefusalError) {
1461 return this.errorResult(err.message);
1462 }
1463 return this.errorResult(
1464 `Tool execution failed: ${err instanceof Error ? err.message : String(err)}. ` +
1465 'This is an internal codegraph error — retry the call once; if it persists, ' +
1466 'continue without codegraph for this task.'
1467 );
1468 }
1469 }
1470
1471 /**
1472 * Pure dispatch over the read tools — the switch, with no gate, no notices, no

Callers 2

executeMethod · 0.95
serveFunction · 0.80

Calls 3

dispatchToolMethod · 0.95
textResultMethod · 0.95
errorResultMethod · 0.95

Tested by

no test coverage detected