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

   ## Summary
   
   The `setup-collection` prompt and its `name` argument description told the 
model that collection names must be lowercase, with no uppercase letters. 
Solr's rule, in SolrJ's `SolrIdentifierValidator`, is 
`^(?!\-)[\._A-Za-z0-9\-]+$`. It accepts letters of either case, digits, 
periods, underscores and hyphens, and rejects only a leading hyphen. So the 
prompt had the model refuse valid names such as `Products.v2`, and it never 
mentioned the leading-hyphen rule.
   
   ```diff
    1. Validate the name.
   -   - Lowercase letters, digits, underscores, hyphens only — no spaces or 
uppercase.
   +   - Solr accepts letters (either case), digits, periods, underscores and 
hyphens, and
   +     the name must not start with a hyphen. Spaces and other characters are 
rejected.
   ```
   
   The `@McpArg` description for `name` and the method's javadoc say the same 
thing now.
   
   ## Evidence
   
   - **Before:** the rendered prompt says "no spaces or uppercase", but 
`SolrIdentifierValidator.validateCollectionName("Widgets.v2")` accepts that 
name.
     **After:** 
`CollectionServiceTest.setupCollectionPrompt_statesTheNameRuleSolrEnforces` 
checks the prompt against the validator itself:
     - `Widgets.v2` is accepted and `-widgets` throws.
     - The prompt mentions periods and the leading-hyphen rule, and no longer 
says "uppercase".
   
     `./gradlew build` passes.
   
   ## Merge Danger
   
   **Door:** two-way
   
   Prompt text, argument description, javadoc and one test. `create-collection` 
already passes the name to Solr unchanged, so no tool behavior changes.
   
   **Blast Radius:** prompt
   
   🤖 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