improve: enhance tool descriptions for better LLM agent tool selection#651
Closed
spidershield-contrib wants to merge 2 commits intografana:mainfrom
Closed
improve: enhance tool descriptions for better LLM agent tool selection#651spidershield-contrib wants to merge 2 commits intografana:mainfrom
spidershield-contrib wants to merge 2 commits intografana:mainfrom
Conversation
|
spidershield-contrib seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
05aadeb to
012e2d1
Compare
Rewrote 60 tool descriptions in Go source files using action-verb-first format with scenario triggers, disambiguation boundaries, parameter docs, and error guidance. Avg quality: 2.7/10 → 9.8/10. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Truncated leftover text appended after closing quotes in tool description strings for UpdateDashboard and several Loki tools (ListLokiLabelNames, ListLokiLabelValues, QueryLokiLogs, QueryLokiStats, QueryLokiPatterns). These fragments broke the Go string literal syntax and caused build failures across all CI checks. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
012e2d1 to
9873de6
Compare
Collaborator
|
This is a nice idea but it inflates our token usage by a further 25% and would cost all of our users a significant amount of money so I can't in good conscience merge it, sorry. Perhaps after some tool consolidation this will make more sense. (using https://github.com/sd2k/mcp-tokens) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Rewrote 60 MCP tool descriptions in Go source files using an action-verb-first format designed for LLM agent planning.
Why
MCP tool descriptions serve as planning hints — LLMs use them to select which tool to call and in what order. Current descriptions like
"Search for Grafana teams by a query string"lack the scenario triggers and disambiguation boundaries needed for reliable agent tool selection.Format applied
Results
🤖 Descriptions improved with spidershield — open-source MCP quality scanner.
Note
Low Risk
Changes are limited to human/LLM-facing tool description strings; no execution logic or API wiring is modified. Risk is primarily around potential mismatch between described parameters/behavior and the actual tool schemas/handlers.
Overview
Updates MCP tool metadata by rewriting descriptions across Grafana, datasource, and incident/oncall/query tools to be more action-oriented and LLM-planning friendly, adding clear use/do-not-use boundaries, parameter callouts, examples, and failure conditions.
No functional behavior changes are introduced; only the text passed into
mcpgrafana.MustTool(...)is modified to improve tool selection/disambiguation during agent planning.Written by Cursor Bugbot for commit 9873de6. This will update automatically on new commits. Configure here.