feat(mcp-server): improve tool schema clarity for better LLM reliability#65
Open
DragonVibes wants to merge 1 commit intojacksteamdev:mainfrom
Open
feat(mcp-server): improve tool schema clarity for better LLM reliability#65DragonVibes wants to merge 1 commit intojacksteamdev:mainfrom
DragonVibes wants to merge 1 commit intojacksteamdev:mainfrom
Conversation
- Add IMPORTANT markers and examples to all 14 MCP tool schemas - Add REQUIRED/Optional markers to all parameter descriptions - Update ApiTemplateExecutionParams with argument descriptions - Add error hints for missing parameters Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
✅ Deploy Preview for superb-starlight-b5acb5 canceled.
|
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.
Pull Request Description
Improve MCP Tool Schema Clarity
This PR improves tool schema clarity across all 14 MCP tools by adding:
IMPORTANT markers highlighting required parameters
JSON examples showing correct usage
REQUIRED/Optional markers on all parameter descriptions
Type of Change
Testing
How has this been tested?
Architecture Compliance
/docs/project-architecture.md).clinerulesChecklist
Security Considerations
Additional Context
Problem
Claude Desktop intermittently calls tools like create_vault_file with empty arguments {} instead of providing required parameters. While this is fundamentally a model behavior issue, we can improve reliability by enhancing tool schemas to help the model understand requirements better.
Example - create_vault_file:
Before:
arguments: {
filename: "string",
content: "string",
}
.describe("Create a new file in your vault or update an existing one.")
After:
arguments: {
filename: type("string").describe(
"The vault-relative path to the file (e.g., 'notes/my-note.md'). REQUIRED."
),
content: type("string").describe(
"The complete content to write to the file. REQUIRED."
),
}
.describe(
"Create a new file in your vault or update an existing file. " +
"IMPORTANT: Both 'filename' and 'content' arguments are required. " +
"Example: { filename: 'daily/2025-01-17.md', content: '# Daily Note\n\nContent here' }"
)
For Maintainers
Review checklist:
Remember: This is volunteer work. Be patient during the review process.