adityamparikh opened a new pull request, #337:
URL: https://github.com/apache/solr-mcp/pull/337

   > Stacked on #313. This PR's own change: 
https://github.com/apache/solr-mcp/pull/PRNUM/commits/963ad954bd4cafccbf91cd500efd4cbce0eae01d
   
   ## Summary
   
   Every `@McpTool` description now answers three questions: **what** the tool 
does, **when** an agent should call it, and **what it returns**. Where two 
tools are easy to confuse, the "when" sentence names the other one.
   
   | Tool | What | When | Returns |
   |---|---|---|---|
   | `list-collections` | ✗ → ✓ | ✗ → ✓ | ✗ → ✓ |
   | `check-health` | ✗ → ✓ | ✗ → ✓ | ✗ → ✓ |
   | `list-aliases` | ✓ | ✗ → ✓ | ~ → ✓ |
   | `create-alias`, `delete-alias` | ✓ | ✗ → ✓ | ✗ → ✓ |
   | `create-collection` | ✓ | ~ → ✓ | ✗ → ✓ |
   | `get-collection-stats` | ✓ | ~ → ✓ | ~ → ✓ |
   | `index-json-documents`, `index-csv-documents`, `index-xml-documents` | ✓ | 
~ → ✓ | ~ → ✓ |
   | `add-fields`, `add-field-types` | ✓ | ~ → ✓ | ✗ → ✓ |
   | `get-schema`, `search` | ✓ | ✓ / ~ → ✓ | ~ → ✓ |
   | `list-fields`, `index-markdown-documents` | ✓ | ✓ | ✓ (unchanged) |
   
   For example:
   
   ```diff
   - List solr collections
   + List the names of all collections in the Solr cluster. Call this first 
when the
   + user has not named a collection, to check that a collection exists before 
searching
   + or indexing, or to pick a free name for create-collection. Aliases are not 
included;
   + use list-aliases for those. Returns a list of objects with name; empty 
when the
   + cluster has no collections.
   ```
   
   The "returns" sentences describe the typed records from #313. 
`list-collections`, `list-aliases` and `list-fields` publish no output schema, 
so their description is the only place a client learns the result shape. The 
other tools have an output schema, and their sentence gives a one-line summary 
of it.
   
   ## Evidence
   
   - **Before:** `list-collections` and `check-health` had one-line 
descriptions. Nine more tools did not say what they return.
     **After:** each `@McpTool` description in `AliasService`, 
`CollectionService`, `IndexingService`, `SchemaService` and `SearchService` 
covers what, when and returns. Every claim was checked against the method body 
or the result record (e.g. `check-health` returns an unhealthy result rather 
than throwing; indexing commits before returning; `rows=0` is passed through to 
Solr).
   - `./gradlew build`: 0 failures, 0 skipped. No test asserts description text.
   
   ## Merge Danger
   
   **Door:** two-way
   
   Only string literals change; no signatures, parameters or result shapes.
   
   **Blast Radius:** tool-selection
   
   Clients see longer descriptions in `tools/list`, which can change which tool 
a model picks. That is the intent of this PR.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to