Skip to content

feat: improve tool descriptions with pagination guidance and MCP annotations#198

Open
bryankthompson wants to merge 3 commits intobrave:mainfrom
bryankthompson:pr/tool-enhancements
Open

feat: improve tool descriptions with pagination guidance and MCP annotations#198
bryankthompson wants to merge 3 commits intobrave:mainfrom
bryankthompson:pr/tool-enhancements

Conversation

@bryankthompson
Copy link

Summary

This PR improves the tool descriptions and parameter documentation across all 6 Brave Search tools to help LLMs make better use of the API.

Changes

  1. MCP Tool Annotations: Added proper hints to all tools:

    • readOnlyHint: true - All tools only read data
    • idempotentHint: true - Same request yields same results
    • openWorldHint: true - Tools access external Brave Search API
  2. Context Control Tips: Added guidance to tool descriptions with:

    • Recommended count values for different use cases
    • Token/context efficiency recommendations
    • Pagination strategies and limitations
  3. Pagination Parameter Examples: Enhanced count and offset descriptions with concrete examples:

    • Web: "Start with 5 for context efficiency, use 10-15 for comprehensive results"
    • News: "Start with 5-10 for breaking news, use 20 for comprehensive coverage"
    • Videos: "offset=10 with count=10 gets videos 11-20"
  4. Bug Fix: Removed incorrect offset reference from Images tool count parameter (Images doesn't support pagination via offset)

Files Changed

  • src/tools/*/index.ts - Tool annotations and context control tips
  • src/tools/*/params.ts - Enhanced parameter descriptions with examples
  • src/tools/images/schemas/input.ts - Removed incorrect offset mention

Testing

  • Build passes (npm run build)
  • Format check passes (npm run format:check)
  • No breaking changes - all modifications are documentation/annotation improvements

🤖 Generated with Claude Code

web-flow and others added 3 commits December 21, 2025 07:27
The Images tool does not support pagination via offset parameter, but the
count parameter description incorrectly mentioned combining with offset.
Updated to accurately reflect available functionality and suggest optimal
count values for context efficiency.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Enhanced all 6 Brave Search tool descriptions with comprehensive context
control advice to help MCP clients optimize token usage:

- Web Search: Start with count=5, pagination limits, result filtering tips
- News: Optimal counts for headlines vs coverage, freshness filtering
- Videos: Compact metadata allows higher counts, pagination guidance
- Images: No pagination available, optimal count ranges for discovery
- Local: Rich metadata requires smaller counts, Pro plan requirements
- Summarizer: Most context-efficient option, no pagination needed

These improvements help MCP clients like Claude make informed decisions
about result counts and pagination strategies to minimize context usage
while maintaining information quality.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Enhanced count and offset parameter descriptions across all tools:

- Count parameters: Added recommendations for initial queries vs comprehensive results
- Offset parameters: Added clear examples showing how pagination works
- Consistent guidance: All tools now provide actionable advice for optimal usage

Examples:
- Web: "Start with 5 for context efficiency, use 10-15 for comprehensive results"
- News: "Start with 5-10 for breaking news, use 20 for comprehensive coverage"
- Videos: "offset=10 with count=10 gets videos 11-20"

These improvements make pagination behavior more transparent and help
users make better decisions about result retrieval strategies.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
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.

3 participants