Skip to content

Anthropic provider: search_issues fails with JSON parse error #819

@clintonb

Description

@clintonb

Environment

  • MCP Server Version: 0.29.0
  • Transport: stdio via supergateway (streamable HTTP)
  • LLM Provider: Anthropic (EMBEDDED_AGENT_PROVIDER=anthropic)

Steps to Reproduce

  1. Configure @sentry/mcp-server with EMBEDDED_AGENT_PROVIDER=anthropic and a valid ANTHROPIC_API_KEY
  2. Call search_issues with any natural language query (e.g., latest unresolved issues)
  3. The embedded agent returns prose wrapping JSON instead of raw JSON, causing a parse failure

Expected Result

search_issues returns matching issues.

Actual Result

Error: No object generated: could not parse the response.

The root cause is visible in the AI_JSONParseError:

JSON parsing failed: Text: Based on the available fields, I can see that Sentry supports
filtering by various attributes. However, I don't see a specific "project" field...

For the query "latest unresolved issues for the API project", I'll construct a query...

```json
{
  "query": "is:unresolved",
  "sort": "date",
  "explanation": "..."
}

The Anthropic model returns explanatory prose around the JSON block instead of raw JSON, which fails `safeParseJSON`.

### Notes

- This is reproducible on every invocation with the Anthropic provider
- Related to #727, which was the same parse error but caused by GPT-5 returning malformed output
- The `list_issues` fallback (without LLM provider) works correctly
- All non-AI tools (`find_projects`, `get_issue_details`, etc.) work fine with Anthropic configured

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions