-
Notifications
You must be signed in to change notification settings - Fork 99
perf: MCP optimize tokens use #3307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Added logic to extract short command descriptions from the README.md command table for SkillDefinition. Falls back to the first sentence of the USAGE text if not found. Includes a cleaning function to remove markdown links, HTML tags, and certain emojis from the extracted description.
Expanded the 'select' command guidance to include regex and special character usage. Improved the enhanceDescription function to append contextual hints, common patterns, error prevention, and help instructions for each tool, making it easier for users to select and use the correct qsv command. Updated the generic qsv_command tool description to mention the help option.
Shorten and clarify qsv skill descriptions. Updated the descriptions in multiple qsv skill JSON files to be more concise and focused, removing excessive detail and examples. This improves readability and consistency across the skill definitions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request optimizes token usage for MCP (Model Context Protocol) tools by replacing verbose descriptions with concise ones extracted from the README.md command table. The change aims to reduce the token count sent to LLMs while preserving essential information, with additional contextual guidance added through the TypeScript layer.
Changes:
- Added new Rust functions to extract and clean short descriptions from README.md command table
- Updated description generation logic to prefer concise README descriptions over verbose USAGE text
- Enhanced TypeScript tool descriptions with structured guidance hints for better tool selection
- Updated 50+ JSON skill files with concise descriptions optimized for token efficiency
Reviewed changes
Copilot reviewed 67 out of 67 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
| src/mcp_skills_gen.rs | Added extract_short_description_from_readme and clean_readme_description functions to extract concise descriptions from README table; updated parse method to use README descriptions as primary source with fallback to USAGE text |
| .claude/skills/src/mcp-tools.ts | Enhanced select command guidance to include regex selector syntax; added documentation comments explaining the concise description strategy and reference to qsv_help tool |
| .claude/skills/qsv/*.json | Updated 50+ skill definition files with concise descriptions extracted from README, replacing verbose USAGE-based descriptions |
[skip ci]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 67 out of 67 changed files in this pull request and generated no new comments.
No description provided.