Add feature support and map the CommandResult to ToolResponse#2403
Merged
Hazel-Datastax merged 9 commits intomainfrom Feb 20, 2026
Merged
Add feature support and map the CommandResult to ToolResponse#2403Hazel-Datastax merged 9 commits intomainfrom
Hazel-Datastax merged 9 commits intomainfrom
Conversation
tatu-at-datastax
approved these changes
Feb 20, 2026
amorton
approved these changes
Feb 20, 2026
Contributor
amorton
left a comment
There was a problem hiding this comment.
looks like a good start here, things are getting cleaner :)
src/main/java/io/stargate/sgv2/jsonapi/api/v1/mcp/McpResource.java
Outdated
Show resolved
Hide resolved
| .map( | ||
| result -> { | ||
| // Success: structuredContent = the whole result data payload | ||
| if (result.errors() == null || result.errors().isEmpty()) { |
Contributor
There was a problem hiding this comment.
what about partial failure for an insertMany in parallel, cannot remember if we put the errors in here or not. It was documented.
Also, we can have status and data. e.g. findOneAndUpdate return is
{
"data": {
"document": {
"_id": "Inception",
"name": "Inception",
"genre": "Science Fiction",
"artist": [
"Leonardo DiCaprio"
],
"status": "active"
}
},
"status": {
"matchedCount": 1,
"modifiedCount": 1
}
}
Contributor
Author
There was a problem hiding this comment.
partial failure for an insertMany:
{
"status": {
"documentResponses": [
{
"_id": 1,
"status": "OK"
},
{
"_id": 1,
"status": "ERROR",
"errorsIdx": 0
},
{
"_id": 3,
"status": "OK"
},
{
"_id": 4,
"status": "OK"
}
]
},
"errors": [
{
"id": "3a6fcead-7278-4334-926d-adab60624f35",
"family": "REQUEST",
"scope": "DOCUMENT",
"errorCode": "DOCUMENT_ALREADY_EXISTS",
"title": "Document the given _id already exists",
"message": "Cannot insert the document: a document already exists with given '_id' (1). \n\nEither resend the command with distinct '_id', or use an update command instead.",
"documentIds": [
1
]
}
]
}
It should be fine in this case? Map "errors" to "structuredContent" and "status" to "_meta"
For findOneAndUpdate case, I'm going to merge the PR now and handle it later - cause I cannot test it now :)
4 tasks
…-error-response # Conflicts: # src/main/java/io/stargate/sgv2/jsonapi/api/v1/mcp/GeneralCommandTools.java # src/main/java/io/stargate/sgv2/jsonapi/api/v1/mcp/McpResource.java
Contributor
📉 Unit Test Coverage Delta vs Main Branch
|
Contributor
Unit Test Coverage Report
|
Contributor
📉 Integration Test Coverage Delta vs Main Branch (dse69-it)
|
Contributor
Integration Test Coverage Report (dse69-it)
|
Contributor
📉 Integration Test Coverage Delta vs Main Branch (hcd-it)
|
Contributor
Integration Test Coverage Report (hcd-it)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does:
structuredContent. For example, the successful result fromfindKeyspaceserrorsarray will be mapped to thestructuredContentand thestatusmap (if any) will be mapped to the_mata. For example, the failed result fromfindKeyspaces:Which issue(s) this PR fixes:
Fixes NA
Checklist