Skip to content

Return readable MCP tool results - #2652

Closed
erichare wants to merge 24 commits into
fix/mcp-request-context-cleanupfrom
fix/mcp-readable-results
Closed

erichare wants to merge 24 commits into
fix/mcp-request-context-cleanupfrom
fix/mcp-readable-results

Conversation

@erichare

@erichare erichare commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does:

Returns the complete Data API response as readable JSON text through the existing response mapper. Structured content and status metadata keep their current shapes. Serialization failures return a short tool error without payloads or exception details.

This builds on #2645.

Which issue(s) this PR fixes:

Fixes #2627. Client qualification remains in #2633.

Verification

All 19 focused tests passed with no failures, errors, or skips on this PR branch.

JAVA_HOME=/Library/Java/JavaVirtualMachines/graalvm-21.jdk/Contents/Home ./mvnw -B -ntp -Dtest=CommandResultToToolResponseTest,McpResourceTest -DskipITs -Dxml-format.skip=true test

git diff --check origin/fix/mcp-request-context-cleanup...HEAD also passed. Packaged integration tests and manual client checks were not rerun in this sweep.

Checklist

  • Changes manually tested
  • Automated Tests added/updated
  • Documentation added/updated
  • CLA Signed: DataStax CLA

@erichare
erichare requested a review from a team as a code owner October 22, 2026 16:56
@erichare erichare mentioned this pull request Oct 22, 2026
2 of 4 tasks
@erichare
erichare changed the base branch from fix/mcp-protocol-foundation to fix/mcp-request-context-cleanup October 22, 2026 18:19
@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 55.07%
This PR 55.37%
Delta 🟢 +0.29%
✅ Coverage improved!

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Unit Test Coverage Report

Overall Project 55.37% -0.01% 🍏
Files changed 79.41% 🍏

File Coverage
CommandResult.java 98.69% 🍏
McpResource.java 50.95% -2.22% ❌

@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 73.04%
This PR 73.04%
Delta 🟢 +0.00%
✅ Coverage improved!

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Integration Test Coverage Report (dse69-it)

Overall Project 73.04% -0.01% 🍏
Files changed 67.65% 🍏

File Coverage
CommandResult.java 96.08% -2.61% 🍏
McpResource.java 85.89% -2.19% ❌

@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.35%
This PR 74.35%
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.35% -0.01% 🍏
Files changed 67.65% 🍏

File Coverage
CommandResult.java 96.08% -2.61% 🍏
McpResource.java 85.89% -2.19% ❌

…results

# Conflicts:
#	src/main/java/io/stargate/sgv2/jsonapi/api/v1/mcp/McpResource.java
… into fix/mcp-readable-results

# Conflicts:
#	src/main/java/io/stargate/sgv2/jsonapi/api/v1/mcp/McpResource.java
#	src/test/java/io/stargate/sgv2/jsonapi/api/v1/mcp/McpIntegrationTestBase.java
#	src/test/java/io/stargate/sgv2/jsonapi/api/v1/mcp/McpResourceTest.java
@erichare

Copy link
Copy Markdown
Contributor Author

Closing this after talking it through with @amorton. We don't want to send the same response twice, once in structuredContent and again as text. Clients that only show text content should read structuredContent instead, and we'll raise that with IBM Bob upstream. The rest of the MCP stack was rebuilt without this PR, so #2653 now builds directly on #2645.

@erichare erichare closed this Oct 28, 2026
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 readable tool results and errors

1 participant