-
Notifications
You must be signed in to change notification settings - Fork 778
Feature/lazy loading new #2838
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
base: main
Are you sure you want to change the base?
Feature/lazy loading new #2838
Conversation
This commit adds a lazy loading mechanism for MCP tools to reduce token usage and improve performance. The implementation includes: - A tool summarizer module that extracts concise descriptions - A new load_mcp_tool function to request detailed tool information on demand - Updated system prompt to explain the lazy loading mechanism Benefits: - Reduced token usage in system prompts - More context available for actual conversations - Improved performance by loading tool details only when needed The implementation is compatible with mcphub.nvim and includes documentation for the required integration changes.
16bf665 to
11c6329
Compare
|
Hi All, I have fixed the lint and type issues. Thanks for looking at this PR! |
|
I took a look at the code, and this PR actually makes not only the MCP tools but also the regular tools lazy-loaded, right? |
Yes, apart from (1) those that are defined in the list of critical tools and (2) those that are in Are there other tools that should be in the list of critical tools? |
Thank you for the explanation, I think this is enough. |
|
Would it be more appropriate to call it Regarding why it's called a search tool, I feel this feature is very similar to the |
Thanks for the link that's very interesting to hear what Anthropic are doing. I vote for |
|
I'll get to this tomorrow hopefully.. it has been a busy week! |
|
Changed load_mcp_tool to load_tool... ready for review again! Thansk in advance |
|
This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
|
Bump |
This PR adds support for lazy loading of MCP tools. Apart from a set of critical tools, MCP tools are not added to the prompt unless requested. A short description of MCP tools is added to the system prompt, and a tool is provided (load_mcp_tool) to load the full tool spec into the tools section of the prompt.