Skip to content

fix: handle MCP tool setup failures - #2653

Open
erichare wants to merge 3 commits into
fix/mcp-request-context-cleanupfrom
fix/mcp-setup-errors
Open

erichare wants to merge 3 commits into
fix/mcp-request-context-cleanupfrom
fix/mcp-setup-errors

Conversation

@erichare

@erichare erichare commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does:

Returns a tool error when request, schema, or provider setup fails. Known Data API errors keep their codes and messages. Unexpected failures get a generic message. A database-rejected token returns UNAUTHENTICATED_REQUEST after HTTP authentication.

Which issue(s) this PR fixes:

Fixes #2628. Builds on #2645 and is the base for #2648. Full stack.

Verification

40 focused Java tests passed on JDK 25 at 9e475374b. The packaged integration test covers recovery after a database rejects a credential. GitHub checks.

./mvnw -o -B -ntp clean test \
  -DskipITs -Dfmt.skip=true -Dxml-format.skip=true -Dsurefire.failIfNoSpecifiedTests=false \
  -Dquarkus.http.test-port=19281 -Dtest=McpSetupErrorsTest,McpResourceTest,CommandResultToToolResponseTest

Checklist

  • Changes manually tested
  • Automated Tests added/updated
  • Documentation added/updated (not needed for this change)
  • CLA Signed: DataStax CLA

@erichare
erichare requested a review from a team as a code owner October 22, 2026 17:14
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

📈 Unit Test Coverage Delta vs Main Branch

Metric Value
Main Branch 57.12%
This PR 57.56%
Delta 🟢 +0.44%
✅ Coverage improved!

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Unit Test Coverage Report

Overall Project 57.56% -0.04% 🍏
Files changed 86.17% 🍏

File Coverage
McpResource.java 90.03% -9.97% 🍏

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

📈 Integration Test Coverage Delta vs Main Branch (dse69-it)

Metric Value
Main Branch 72.75%
This PR 72.75%
Delta 🟢 +0.01%
✅ Coverage improved!

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Integration Test Coverage Report (dse69-it)

Overall Project 72.75% -0.05% 🍏
Files changed 81.56% 🍏

File Coverage
McpResource.java 85.03% -13.2% 🍏

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

📈 Integration Test Coverage Delta vs Main Branch (hcd-it)

Metric Value
Main Branch 74.21%
This PR 74.22%
Delta 🟢 +0.00%
✅ Coverage improved!

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Integration Test Coverage Report (hcd-it)

Overall Project 74.22% -0.05% 🍏
Files changed 81.56% 🍏

File Coverage
McpResource.java 85.03% -13.2% 🍏

@erichare
erichare added this pull request to stack #2660 October 23, 2026 22:14
@erichare
erichare force-pushed the fix/mcp-setup-errors branch from 71765e2 to 81ed051 Compare October 27, 2026 23:08
@erichare
erichare removed this pull request from stack #2660 October 27, 2026 23:11
@erichare
erichare changed the base branch from fix/mcp-readable-results to fix/mcp-request-context-cleanup October 27, 2026 23:11
@erichare
erichare added this pull request to stack #2667 October 27, 2026 23:12
@erichare erichare mentioned this pull request Oct 28, 2026
3 of 4 tasks
@erichare
erichare removed this pull request from stack #2667 November 5, 2026 19:26
@erichare
erichare force-pushed the fix/mcp-setup-errors branch from 81ed051 to e06f924 Compare November 5, 2026 19:28
@erichare erichare changed the title Handle MCP tool setup failures fix: handle MCP tool setup failures Nov 5, 2026
@erichare
erichare added this pull request to stack #2672 November 5, 2026 19:29

This branch has not been deployed

No deployments
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.

MCP: Return useful errors when tool setup fails

1 participant