Repository navigation
fix: describe every MCP tool argument and the JSON it takes - #2658
Conversation
📈 Unit Test Coverage Delta vs Main Branch
|
Unit Test Coverage Report
|
➡️ Integration Test Coverage Delta vs Main Branch (dse69-it)
|
Integration Test Coverage Report (dse69-it)
|
➡️ Integration Test Coverage Delta vs Main Branch (hcd-it)
|
Integration Test Coverage Report (hcd-it)
|
f3b0220 to
0cc5d9c
Compare
amorton
left a comment
There was a problem hiding this comment.
some changes for the comments etc, and we are going to have to deal with this McpClauseSchemaContractTest class at some point.
| @ToolArg( | ||
| description = | ||
| "Optional type of the index to create. The only supported value is '" | ||
| "Type of the index to create. The only supported value is '" |
There was a problem hiding this comment.
Pls put Optional back, this field is basically ignored and only here for consistency
There was a problem hiding this comment.
Done, Optional is back.
| @ToolArg( | ||
| description = | ||
| "Optional type of the index to create. The only supported value is '" | ||
| "Type of the index to create. The only supported value is '" |
There was a problem hiding this comment.
Done, Optional is back.
| @ToolArg(description = "include collection properties.", required = false) | ||
| @ToolArg(description = "Name of the keyspace") String keyspace, | ||
| @ToolArg( | ||
| description = "Set explain to true to include the properties of each collection", |
There was a problem hiding this comment.
Just say options and rely on the desc on the Option class fields
There was a problem hiding this comment.
Done, it now says "Options for the command."
| "Columns and primary key of the new table, for example {\"columns\": {\"id\": \"text\", \"title\": \"text\"}, \"primaryKey\": \"id\"}") | ||
| TableDefinitionDesc definition, | ||
| @ToolArg( | ||
| description = "Set ifNotExists to true to succeed when the table already exists", |
There was a problem hiding this comment.
Just say options and rely on the desc on the Option class fields
There was a problem hiding this comment.
Done, it now says "Options for the command."
| assertEquals( | ||
| description, | ||
| schemaMetadata(document, propertySchema(document, "filter"), "description").asText()); | ||
| void clauseArgumentsUseClassDescriptions() throws Exception { |
There was a problem hiding this comment.
What is a clauseArgument ?
There was a problem hiding this comment.
It meant a filter or sort argument, and that test is gone now.
…contract test McpSchemaCustomizerTest now covers each rule the customizer adds in four tests: JSON property names, ignored and hidden fields, descriptions, and component references. It reaches every line and branch of the customizer. McpClauseSchemaContractTest keeps the checks that published clause schemas agree with the server's parsers. Tool payload cases that repeat McpSchemaIntegrationTest are removed, the update cases run once against the update clause schema instead of once per tool, and the rerank credentials case is a row in the override table.
…descriptions # Conflicts: # src/test/java/io/stargate/sgv2/jsonapi/api/v1/mcp/McpClauseSchemaContractTest.java
Options arguments now say "Options for the command." and rely on the field descriptions in their Options classes. Definition arguments rely on TableDefinitionDesc the same way, which now carries the column and primary key details. indexType says "Optional" again, free-form documents carry no example, and alterTable uses the reviewed wording. The embedding provider filter now says null or an empty string returns all models, matching the reranking filter. The contract test checks that every tool argument has a description and that any example at the end of one parses as the argument type.
… fix/mcp-tool-argument-descriptions
…-descriptions # Conflicts: # src/test/java/io/stargate/sgv2/jsonapi/api/v1/mcp/McpClauseSchemaContractTest.java
What this PR does:
Gives every MCP tool argument a description, to the standard #2619 set for findAndRerank. Aaron asked for this in review. Options arguments say "Options for the command." and rely on the field descriptions on their Options classes, and definition arguments rely on their classes the same way. Filter and sort keep their class descriptions. Free-form documents carry no example, and the alterTable operation and projections keep a short example that a contract test parses as the argument type.
Update arguments use the UpdateClause description from #2651 instead of repeating it.
Which issue(s) this PR fixes:
Addresses the MCP argument portion of #2604.
Verification
118 focused tests passed with 0 failures, 0 errors, and 0 skips at
2a1d8435c, after merging main, which now includes #2651. The local format check did not run because this machine only has JDK 25 and google-java-format 1.21 needs JDK 21, so CI runs it. CI also runs the unit and DSE/HCD integration suites on this push. Manual client checks were not run.Checklist
MCP stack
Merges bottom up; row 1 is the bottom of the stack.