Skip to content

refactor: consolidate 47 tools into 8 unified action-based tools#3

Open
jmccardle wants to merge 1 commit intoraohwork:masterfrom
jmccardle:master
Open

refactor: consolidate 47 tools into 8 unified action-based tools#3
jmccardle wants to merge 1 commit intoraohwork:masterfrom
jmccardle:master

Conversation

@jmccardle
Copy link
Copy Markdown

I noticed that this MCP server took up ~16% of context every single conversation, even though I mostly only used it to read/write issues. I used almost every action occasionally, but EVERY session was losing thousands of tokens to tools I wouldn't use.

I wrote this refactor to provide a "user manual" tool so that the LLM can read detailed instructions for whichever specific task it's trying to do, and each task supports multiple target objects. I reduced the amount of explanation in the tools' description because LLMs being used to develop software already understand what issues, repositories, and wiki pages are. Lastly, the error messages are designed to give specific, actionable, token-cheap responses that guide the LLM towards making a correct tool call on the second attempt.

Reduces MCP tool token consumption by 82% (32.7k → 5.7k tokens).

New unified tools:

  • gitea_manual: On-demand documentation lookup (lazy-loaded)
  • create_gitea: Create resources (issue, label, milestone, etc.)
  • get_gitea: Get single resource details
  • list_gitea: List resources with filtering
  • edit_gitea: Edit existing resources
  • delete_gitea: Delete resources
  • link_gitea: Create relationships (labels, dependencies)
  • unlink_gitea: Remove relationships

Key design decisions:

  • Action-based organization leverages LLM implicit knowledge
  • Lazy documentation via gitea_manual avoids upfront token cost
  • Rich error messages include relevant schema for self-correction

🤖 Generated with Claude Code

Reduces MCP tool token consumption by 82% (32.7k → 5.7k tokens).

New unified tools:
- gitea_manual: On-demand documentation lookup (lazy-loaded)
- create_gitea: Create resources (issue, label, milestone, etc.)
- get_gitea: Get single resource details
- list_gitea: List resources with filtering
- edit_gitea: Edit existing resources
- delete_gitea: Delete resources
- link_gitea: Create relationships (labels, dependencies)
- unlink_gitea: Remove relationships

Key design decisions:
- Action-based organization leverages LLM implicit knowledge
- Lazy documentation via gitea_manual avoids upfront token cost
- Rich error messages include relevant schema for self-correction

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

Co-Authored-By: Claude <noreply@anthropic.com>
@jmccardle
Copy link
Copy Markdown
Author

Screenshot from 2025-12-01 14-51-18

I think the "manual" pattern is pretty interesting - it gives agents like Claude the opportunity to request focused documentation rather than having documentation in context unconditionally.

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