Skip to content

feat(mcp-server): improve tool schema clarity for better LLM reliability#65

Open
DragonVibes wants to merge 1 commit intojacksteamdev:mainfrom
DragonVibes:feat/improve-tool-schema-clarity
Open

feat(mcp-server): improve tool schema clarity for better LLM reliability#65
DragonVibes wants to merge 1 commit intojacksteamdev:mainfrom
DragonVibes:feat/improve-tool-schema-clarity

Conversation

@DragonVibes
Copy link

  • 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

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

  • [ x] 🐛 Bug fix (non-breaking change that fixes an issue)

Testing

How has this been tested?

  • Local Obsidian vault testing
  • MCP server functionality verified
  • Claude Desktop integration tested
  • Cross-platform testing (if applicable)

Architecture Compliance

  • Follows feature-based architecture patterns (see /docs/project-architecture.md)
  • Uses ArkType for runtime validation where applicable
  • Implements proper error handling
  • Includes setup function for new features
  • Follows coding standards in .clinerules

Checklist

  • My code follows the project's coding standards
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to documentation (if applicable)
  • My changes generate no new warnings
  • [] I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Security Considerations

  • No hardcoded secrets or API keys
  • Input validation implemented where needed
  • No new security vulnerabilities introduced
  • Follows minimum permission principles

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:

  • Code quality and architecture compliance
  • Security review completed
  • Tests adequate and passing
  • Documentation updated as needed
  • Ready for release

Remember: This is volunteer work. Be patient during the review process.

- 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>
@netlify
Copy link

netlify bot commented Jan 17, 2026

Deploy Preview for superb-starlight-b5acb5 canceled.

Name Link
🔨 Latest commit 2e0fdf6
🔍 Latest deploy log https://app.netlify.com/projects/superb-starlight-b5acb5/deploys/696c05b52dc86700086acfe4

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