From 0d6f460b15ddb34b6286cabe344a1c7270c410dc Mon Sep 17 00:00:00 2001 From: Colby McHenry Date: Fri, 3 Apr 2026 19:34:56 -0500 Subject: [PATCH] fix: Reduce codegraph_explore output limit to stay under MCP client token limits Decreases maximum output from 50,000 to 35,000 characters to prevent exceeding ~10k token limits in MCP clients that could cause truncation or errors when processing exploration results. --- src/mcp/tools.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mcp/tools.ts b/src/mcp/tools.ts index 05aaa8d..f346f0d 100644 --- a/src/mcp/tools.ts +++ b/src/mcp/tools.ts @@ -601,8 +601,8 @@ export class ToolHandler { return this.textResult(this.truncateOutput(formatted)); } - /** Maximum output for explore tool (much larger than standard tools) */ - private static readonly EXPLORE_MAX_OUTPUT = 50000; + /** Maximum output for explore tool — sized to stay under MCP client token limits (~10k tokens) */ + private static readonly EXPLORE_MAX_OUTPUT = 35000; /** * Handle codegraph_explore — deep exploration in a single call