feat: add domain-specific search tools for spells, monsters, and items #2

Merged
agent merged 2 commits from feat/domain-specific-search-tools into main 2026-02-14 22:32:46 -08:00
Collaborator

Summary

Adds three domain-specific search tools to make D&D content searches more intuitive:

  • search_spells(name?, level?, school?, classes?, source?, ruleset?, limit?)
  • search_monsters(name?, cr_min?, cr_max?, type?, source?, ruleset?, limit?)
  • search_items(name?, rarity?, type?, attunement?, source?, ruleset?, limit?)

Changes

  • Added search_spells with domain-specific parameters (spell level, school, classes)
  • Added search_monsters with CR range filtering and creature type
  • Added search_items with rarity, type, and attunement filtering
  • Each tool internally uses existing search logic with appropriate filters
  • Returns same format as search_entities (links + text)
  • Updated README.md with usage examples and parameter documentation
  • Kept search_entities for cross-domain/exploratory searches

Examples

Find 3rd-level evocation spells:

{"tool": "search_spells", "parameters": {"level": 3, "school": "E"}}

Find CR 5-10 dragons:

{"tool": "search_monsters", "parameters": {"cr_min": 5, "cr_max": 10, "type": "dragon"}}

Find legendary items requiring attunement:

{"tool": "search_items", "parameters": {"rarity": "legendary", "attunement": true}}

Testing

  • TypeScript compilation successful
  • All new tools follow existing patterns
  • Conventional commit message format
## Summary Adds three domain-specific search tools to make D&D content searches more intuitive: - `search_spells(name?, level?, school?, classes?, source?, ruleset?, limit?)` - `search_monsters(name?, cr_min?, cr_max?, type?, source?, ruleset?, limit?)` - `search_items(name?, rarity?, type?, attunement?, source?, ruleset?, limit?)` ## Changes - Added `search_spells` with domain-specific parameters (spell level, school, classes) - Added `search_monsters` with CR range filtering and creature type - Added `search_items` with rarity, type, and attunement filtering - Each tool internally uses existing search logic with appropriate filters - Returns same format as `search_entities` (links + text) - Updated README.md with usage examples and parameter documentation - Kept `search_entities` for cross-domain/exploratory searches ## Examples **Find 3rd-level evocation spells:** ```json {"tool": "search_spells", "parameters": {"level": 3, "school": "E"}} ``` **Find CR 5-10 dragons:** ```json {"tool": "search_monsters", "parameters": {"cr_min": 5, "cr_max": 10, "type": "dragon"}} ``` **Find legendary items requiring attunement:** ```json {"tool": "search_items", "parameters": {"rarity": "legendary", "attunement": true}} ``` ## Testing - ✅ TypeScript compilation successful - ✅ All new tools follow existing patterns - ✅ Conventional commit message format
- Add search_spells tool with level, school, classes filters
- Add search_monsters tool with CR range and type filters
- Add search_items tool with rarity, type, attunement filters
- Update README with examples and documentation
- Keep search_entities for cross-domain searches
- Extracted search logic into src/search.ts for testability
- Created tests/search-tools.test.ts with 66 comprehensive tests
- Test coverage includes:
  * search_spells: level, school, classes, source, ruleset filters
  * search_monsters: CR ranges (including fractional), type, source, ruleset
  * search_items: rarity, attunement, type, source, ruleset
  * Fuzzy name matching for all three tools
  * Multiple filter combinations
  * Empty result handling
  * Limit parameter behavior
- Refactored server.ts to use extracted search functions
- All 75 tests passing (9 existing + 66 new)
brad approved these changes 2026-02-14 22:32:14 -08:00
agent merged commit cb30b319b5 into main 2026-02-14 22:32:46 -08:00
agent deleted branch feat/domain-specific-search-tools 2026-02-14 22:32:46 -08:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
dungeonchurch/5e-tools-mcp!2
No description provided.