Skip to content

fix: describe every MCP tool argument and the JSON it takes - #2658

Open
erichare wants to merge 2 commits into
mainfrom
fix/mcp-tool-argument-descriptions
Open

erichare wants to merge 2 commits into
mainfrom
fix/mcp-tool-argument-descriptions

Conversation

@erichare

@erichare erichare commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does:

Gives every MCP tool argument a description that says what it is and what JSON it takes, to the standard #2619 set for findAndRerank. Aaron asked for this in review. Filter and sort keep their class descriptions, and arguments whose schema hides the wire shape end with an example. A contract test deserializes each example as its argument type.

This overlaps #2651, which gives UpdateClause its own description. Whichever lands second should drop the update descriptions here.

Which issue(s) this PR fixes:

Addresses the MCP argument portion of #2604.

Verification

The format check passed (1,194 files, 0 non-complying), and all 90 focused tests passed with no failures, errors, or skips.

JAVA_HOME=/Library/Java/JavaVirtualMachines/graalvm-21.jdk/Contents/Home ./mvnw -B com.spotify.fmt:fmt-maven-plugin:check test -Dtest=McpProtocolTest,McpClauseSchemaContractTest,McpOpenApiSchemaAdapterTest,McpSchemaCustomizerTest

Packaged integration tests and manual client checks were not run.

Checklist

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

Apply the findAndRerank argument standard to all MCP tools, following
review feedback.

- filter and sort arguments take their descriptions from FilterDefinition
  and SortDefinition, which Swagger also uses. A @ToolArg description
  replaced them, so clients saw only "filter" or "sort".
- Collection arguments name what the command supports: the collection,
  the table, or a collection or table, based on CommandName targets.
- Projection, update, replacement, document, definition, and options
  arguments get real descriptions in place of their bare names or
  generic text.
- Descriptions drop "Optional" and "Required" prefixes, since the schema
  already lists required arguments, and use consistent capitalization.

Generalize the contract tests to every tool: filter and sort use their
class descriptions, and no argument is described only by its name or
starts with "Optional" or "Required".
Add a JSON example to the descriptions of arguments whose generated
schema does not show the wire shape, matching the projection example
on findAndRerank. This covers alterTable operation, index definitions,
table and type definitions, alterType rename and add, replacement, and
inserted documents.

The model status descriptions on findEmbeddingProviders and
findRerankingProviders now name filterModelStatus and say that an empty
string lists every model, which is how the operations behave.

A new contract test parses each description example and deserializes it
as its argument's Java type, so an example the server would reject
fails the build.
@erichare
erichare requested a review from a team as a code owner October 23, 2026 21:43
@github-actions

Copy link
Copy Markdown
Contributor

📈 Unit Test Coverage Delta vs Main Branch

Metric Value
Main Branch 55.07%
This PR 55.14%
Delta 🟢 +0.07%
✅ Coverage improved!

@github-actions

Copy link
Copy Markdown
Contributor

Unit Test Coverage Report

Overall Project 55.14% 🍏
File Coverage
KeyspaceCommandTools.java 0% 🍏
CollectionCommandTools.java 0% 🍏
GeneralCommandTools.java 0% 🍏

@github-actions

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 unchanged

@github-actions

Copy link
Copy Markdown
Contributor

Integration Test Coverage Report (dse69-it)

Overall Project 73.04% 🍏
File Coverage
KeyspaceCommandTools.java 100% 🍏
CollectionCommandTools.java 100% 🍏
GeneralCommandTools.java 100% 🍏

@github-actions

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 unchanged

@github-actions

Copy link
Copy Markdown
Contributor

Integration Test Coverage Report (hcd-it)

Overall Project 74.35% 🍏
File Coverage
KeyspaceCommandTools.java 100% 🍏
CollectionCommandTools.java 100% 🍏
GeneralCommandTools.java 100% 🍏

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.

1 participant