Skip to content

Server-side result reduction (projection, pagination, summary-only) for search tools #140

Description

@sajeetharan

Motivation

Cosmos DB search results can be large (thousands of rows, embeddings, hybrid-search hits). Under direct tool calling, the full result set flows through the model; under Code Mode (Anthropic post), the client would prefer to receive only what it will actually project. Reducing at the server saves tokens for every client, not just Code-Mode clients.

Scope — extend the following tools

  • text_search
  • vector_search
  • hybrid_search
  • get_recent_documents

New optional parameters

  • projection: string[] — dotted field paths to include (maps to SQL SELECT)
  • maxResults: int — hard cap (existing default preserved for back-compat)
  • continuationToken: string — for pagination
  • summaryOnly: bool — return { count, ids[], continuationToken } only

Acceptance criteria

  • New params surfaced in each tool's JSON schema
  • Cosmos SQL generated safely (parameterized, reuse McpToolRequestValidator)
  • Unit tests for each new mode
  • docs/USE-CASES.md updated with examples

Related

Part of the "Code Mode" support umbrella.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions