Skip to content

Conversation

@gianlucamazza
Copy link

Summary

Implement granular tool filtering with service:category syntax to significantly reduce the number of tools loaded, optimizing LLM context window usage.

  • Add parseServiceFilters() for parsing service:category syntax
  • Add hasCategory() helper for category matching
  • Default to "basic" category when no category specified
  • Support "all" keyword to load all tools for a service
  • Add category support to all 9 services

Usage Examples

# Default: loads only basic tools (~50 instead of ~200)
--services droplets

# Specific categories
--services droplets:basic,networking:lb,databases:postgresql

# All tools for a service
--services droplets:all

# Mix and match
--services droplets:basic,droplets:actions,networking:all

Available Categories

Service Categories
droplets basic, actions, images, sizes, all
networking basic/lb, firewall, dns, vpc, ip, all
databases basic/cluster, postgresql, mysql, mongodb, redis, kafka, opensearch, users, firewall, all
accounts basic/info, billing, keys, actions, all
spaces basic/keys, cdn, all
insights basic/uptime, alerts, all
apps, doks, marketplace all (small tool sets)

Context Window Impact

Configuration Approximate Tools
All services (no filtering) ~200 tools
All services (basic only) ~50 tools
droplets:basic,networking:lb ~20 tools

Test Plan

  • Format check passes (make format)
  • Build succeeds (make build)
  • All tests pass (go test ./...)
  • Manual testing with MCP client

🤖 Generated with Claude Code

Implement granular tool filtering with service:category syntax to
significantly reduce the number of tools loaded, optimizing LLM
context window usage.

Changes:
- Add parseServiceFilters() for parsing service:category syntax
- Add hasCategory() helper for category matching
- Default to "basic" category when no category specified
- Support "all" keyword to load all tools for a service
- Add category support to all 9 services

Usage examples:
- `--services droplets` loads only basic droplet tools
- `--services droplets:basic,networking:lb` loads specific categories
- `--services droplets:all` loads all droplet tools

Context window impact:
- All services (no filtering): ~200 tools
- All services (basic only): ~50 tools
- droplets:basic,networking:lb: ~20 tools

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant