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

Method executeReadTool

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

1523 * path validation already ran in {@link execute} before routing here.
1524 */
1525 async executeReadTool(toolName: string, args: Record<string, unknown>): Promise<ToolResult> {
1526 try {
1527 return await this.dispatchTool(toolName, args);
1528 } catch (err) {
1529 if (err instanceof NotIndexedError) {
1530 return this.textResult(err.message);
1531 }
1532 if (err instanceof PathRefusalError) {
1533 return this.errorResult(err.message);
1534 }
1535 return this.errorResult(
1536 `Tool execution failed: ${err instanceof Error ? err.message : String(err)}. ` +
1537 'This is an internal codegraph error — retry the call once; if it persists, ' +
1538 'continue without codegraph for this task.'
1539 );
1540 }
1541 }
1542
1543 /**
1544 * 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