test: add tests for ToolRegistry service #4

Open
opened 2026-02-21 00:59:12 +00:00 by Clotho · 0 comments
Member

Summary

The ToolRegistry service (src/Mcp/Services/ToolRegistry.php) has no unit tests.

What needs testing

  • getServers() — list all registered servers
  • getToolsForServer($id) — tools scoped to a server
  • getToolsByCategory($category) — category-based tool retrieval
  • searchTools($query) — text search across tools
  • getTool($name) — individual tool lookup
  • getExampleInputs() / setExampleInputs() — example round-trip
  • getAllCategories() — category enumeration
  • getServerFull($id) — complete server metadata
  • clearCache() — cache invalidation

Notes

  • Also noted in TODO.md under Medium Priority
  • Depends on YAML server definition files (resources/mcp/servers/)
  • Estimated effort: 2-3 hours

Files

  • src/Mcp/Services/ToolRegistry.php
  • src/Mcp/Tests/Unit/ToolRegistryTest.php (to be created)
## Summary The `ToolRegistry` service (src/Mcp/Services/ToolRegistry.php) has no unit tests. ## What needs testing - `getServers()` — list all registered servers - `getToolsForServer($id)` — tools scoped to a server - `getToolsByCategory($category)` — category-based tool retrieval - `searchTools($query)` — text search across tools - `getTool($name)` — individual tool lookup - `getExampleInputs()` / `setExampleInputs()` — example round-trip - `getAllCategories()` — category enumeration - `getServerFull($id)` — complete server metadata - `clearCache()` — cache invalidation ## Notes - Also noted in TODO.md under Medium Priority - Depends on YAML server definition files (resources/mcp/servers/) - Estimated effort: 2-3 hours ## Files - `src/Mcp/Services/ToolRegistry.php` - `src/Mcp/Tests/Unit/ToolRegistryTest.php` (to be created)
Clotho added the
discovery
testing
labels 2026-02-21 00:59:12 +00:00
Snider added the
clotho
label 2026-02-21 01:23:27 +00:00
Charon added the
agent-ready
label 2026-02-21 01:30:20 +00:00
Sign in to join this conversation.
No description provided.