You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Failed API calls should not be failures, not errors #420
Fix: Return failed tool calls (in-band isError) instead of protocol errors from tool handlers
Tool-level failures (e.g., GitHub API/user lookup/auth scope issues) should be returned as CallToolResult with isError: true, not as non-nil Go errors. This matches MCP guidance and lets the client/LLM see and handle failures.
Replace fmt.Errorf("failed to get user: %w", err) with mcp.NewToolResultErrorFromErr(...) and nil error.
Add tiny helper toolErr(...) for consistency across handlers.
References: mcp-go docs on CallToolResult error handling; maintainer guidance on when (rarely) to return non-nil errors; tracking issue #420. Go Packages
GitHub
+1(mark3labs/mcp-go#294)
Want me to draft a full diff touching other handlers with the same pattern (grep for fmt.Errorf( in tool handlers) and a unit test update block?
Activity
KashifManzer commentedon Jul 18, 2025
Can I work on it, if it's still open?
mohamedaminehamdi commentedon Aug 4, 2025
Can i work on it ??
Abhinav072004 commentedon Aug 20, 2025
Fix: Return failed tool calls (in-band isError) instead of protocol errors from tool handlers
Tool-level failures (e.g., GitHub API/user lookup/auth scope issues) should be returned as CallToolResult with isError: true, not as non-nil Go errors. This matches MCP guidance and lets the client/LLM see and handle failures.
Replace fmt.Errorf("failed to get user: %w", err) with mcp.NewToolResultErrorFromErr(...) and nil error.
Add tiny helper toolErr(...) for consistency across handlers.
References: mcp-go docs on CallToolResult error handling; maintainer guidance on when (rarely) to return non-nil errors; tracking issue #420.
Go Packages
GitHub
+1(mark3labs/mcp-go#294)
Want me to draft a full diff touching other handlers with the same pattern (grep for fmt.Errorf( in tool handlers) and a unit test update block?