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

Method handleToolsList

src/mcp/session.ts:243–259  ·  view source on GitHub ↗
(request: JsonRpcRequest)

Source from the content-addressed store, hash-verified

241 }
242
243 private async handleToolsList(request: JsonRpcRequest): Promise<void> {
244 await this.retryInitIfNeeded();
245 // Always expose the tools — even when the server root has no index. Gating
246 // availability on whether `./` is indexed (the old behavior) breaks the
247 // monorepo case where only sub-projects carry a `.codegraph/` (the agent
248 // saw zero tools and couldn't even reach an indexed sub-project by
249 // `projectPath`), and it hides the tools from a session that started before
250 // the user ran `codegraph init` (most hosts request the list once, so the
251 // freshly-built index never surfaces). #964. The not-indexed case is still
252 // safe: a call against an un-indexed path returns SUCCESS-shaped guidance
253 // ("pass projectPath / run codegraph init"), never `isError`, so it can't
254 // teach the agent to abandon codegraph. `getTools()` returns the default
255 // surface even before a project is open.
256 this.transport.sendResult(request.id, {
257 tools: this.engine.getToolHandler().getTools(),
258 });
259 }
260
261 private async handleToolsCall(request: JsonRpcRequest): Promise<void> {
262 const params = request.params as {

Callers 1

handleMessageMethod · 0.95

Calls 4

retryInitIfNeededMethod · 0.95
sendResultMethod · 0.80
getToolsMethod · 0.80
getToolHandlerMethod · 0.80

Tested by

no test coverage detected