Skip to content

Commit 67c0e38

Browse files
committed
Fix read tool token limit - reduce to 20k for MCP overhead
- Reduced max_tokens from 25000 → 20000 - Prevents 'response exceeds maximum allowed tokens' errors - Leaves buffer for MCP protocol overhead Fixes: read tool returning 27444 tokens (exceeds 25000 limit)
1 parent fd374fb commit 67c0e38

File tree

1 file changed

+2
-1
lines changed
  • pkg/hanzo-mcp/hanzo_mcp/tools/filesystem

1 file changed

+2
-1
lines changed

pkg/hanzo-mcp/hanzo_mcp/tools/filesystem/read.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,10 @@ async def call(
212212
await tool_ctx.info(f"Successfully read file: {file_path}")
213213

214214
# Apply token limit to prevent excessive output
215+
# Reduce to 20000 to leave buffer for MCP overhead
215216
return truncate_response(
216217
result,
217-
max_tokens=25000,
218+
max_tokens=20000,
218219
truncation_message="\n\n[File content truncated due to token limit. Use offset/limit parameters to read specific sections.]",
219220
)
220221

0 commit comments

Comments
 (0)