Skip to content

fix(github): improve callTool response handling#386

Merged
tlgimenes merged 2 commits intomainfrom
tlgimenes/github-proxy-response
Apr 15, 2026
Merged

fix(github): improve callTool response handling#386
tlgimenes merged 2 commits intomainfrom
tlgimenes/github-proxy-response

Conversation

@tlgimenes
Copy link
Copy Markdown
Contributor

@tlgimenes tlgimenes commented Apr 15, 2026

Summary

  • Handle result.isError by throwing with the text message or a fallback
  • Return result.structuredContent directly when available
  • Parse text content as JSON with explicit error on parse failure
  • Add safeJsonParse helper for safe JSON parsing

Test plan

  • Verify error responses from upstream MCP are properly thrown
  • Verify structured content responses are returned directly
  • Verify JSON text responses are parsed and returned
  • Verify non-JSON text responses throw a clear error

🤖 Generated with Claude Code


Summary by cubic

Improves callTool response handling in the GitHub MCP proxy. Throws on upstream errors, prefers structuredContent, and parses text responses as JSON with clear failures.

  • Bug Fixes
    • Throw with the tool’s text message (or fallback) when result.isError is true.
    • Return result.structuredContent directly when available.
    • Parse text content as JSON; if parsing fails, throw Failed to parse: <msg>.
    • Add safeJsonParse helper and remove response logs.

Written for commit 67a5913. Summary will update on new commits.

tlgimenes and others added 2 commits April 15, 2026 12:43
…ured content support

Handle isError responses by throwing, prefer structuredContent when available, and fail explicitly when text content cannot be parsed as JSON.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@tlgimenes tlgimenes merged commit 7057e97 into main Apr 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant