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

   ## Summary
   
   The `search-collection` prompt told the model to use a `q` argument, but the 
`search` tool's parameter is `query`. The tool ignores arguments it does not 
declare, so a model that followed the prompt sent `q`, the argument was 
dropped, and it searched `*:*`. The prompt now names `query` everywhere. It 
also fixes step 4, whose nested bullets rendered 12 spaces too deep.
   
   ```diff
    2. Translate the question into Solr query parts.
   -     * Free-text concepts → `q` against tokenized fields, e.g.
   +     * Free-text concepts → `query` against tokenized fields, e.g.
    ...
   -   - Start with `*:*` as `q` if the question is purely filter-driven; let
   +   - Start with `*:*` as `query` if the question is purely filter-driven; 
let
    ...
    4. Interpret and refine.
       - Check `numFound` first.
   -                 * Zero results: ... fall back to `q=*:*` with the 
strongest filter ...
   -                 * Many results: ...
   +     * Zero results: ... fall back to `query=*:*` with the strongest filter 
...
   +     * Many results: ...
   ```
   
   ## Evidence
   
   - **Before:** `search` with 
`{"collection":"shows_typed","q":"title:Crown","rows":0}` returns `numFound: 
61`, the whole collection, with no error. The rendered prompt shows the step 4 
bullets indented to column 17.
     **After:** the prompt only names `query`. Two new tests in 
`SearchServiceTest`:
     - `searchCollectionPrompt_namesTheSearchToolsQueryParameter` reads the 
`search` method's parameter names by reflection, asserts that `query` is one of 
them and `q` is not, and asserts that the prompt contains no `` `q` `` or `` 
`q= ``.
     - `searchCollectionPrompt_nestsBulletsNoDeeperThanSevenSpaces` fails on 
the old text and passes now.
   
     `./gradlew build` passes.
   
   ## Merge Danger
   
   **Door:** two-way
   
   Prompt text and tests only. No tool, schema or wire change.
   
   **Blast Radius:** prompt
   
   #291 also edits this prompt (the `edismax-style` line and step 3). This PR 
leaves those lines alone, but its step 2 change sits next to #291's hunk, so 
whichever merges second needs a one-line rebase. #291's new example 
`q=apocalyptic survival` has the same `q`/`query` mismatch.
   
   🤖 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