Skip to main content
Glama

Search Collection

search_collection
Read-onlyIdempotent

Semantic (vector) search across documents in a collection. Returns ranked text chunks with relevance scores. Free — no credits consumed. Use when you need raw matching chunks from a collection. For a synthesized cited answer from the same context, use ask_collection instead. PREREQUISITE: Collection must be populated via add_document_to_collection and async indexing must complete (poll get_job_status) before results appear. Returns: { results: [{ bundle_id, chunk_id, text, score: number (0–1), title? }] } Example prompts:

  • "Search my Q4 Contracts collection for mentions of liability cap."

  • "Find the clause about data retention in my due diligence docs."

  • "Search for revenue numbers across my quarterly reports."

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMax chunks to return (default 10, max 50). Example: 5
queryYesNatural language search query. Example: "What were the revenue numbers for Q4?"
collection_idYesCollection ID (col_...) returned by create_collection. Example: "col_550e8400-e29b-41d4-a716-446655440000"

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added
  2. Removed
  3. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "results": {
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "bundle_id": {
      +            "type": "string"
      +          },
      +          "chunk_id": {
      +            "type": "string"
      +          },
      +          "score": {
      +            "type": "number"
      +          },
      +          "text": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "bundle_id",
      +          "chunk_id",
      +          "text",
      +          "score"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "results"
      +  ],
      +  "type": "object"
      +}
  4. Changed3 schema fields changed
    • changedInput schema / properties / collection_id / description
      Previous value: -"Collection ID (col_...) returned by create_collection"New value: +"Collection ID (col_...) returned by create_collection. Example: \"col_550e8400-e29b-41d4-a716-446655440000\""
    • changedInput schema / properties / limit / description
      Previous value: -"Max chunks to return (default 10)"New value: +"Max chunks to return (default 10, max 50). Example: 5"
    • changedInput schema / properties / query / description
      Previous value: -"Natural language search query"New value: +"Natural language search query. Example: \"What were the revenue numbers for Q4?\""
  5. First observed

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint and idempotentHint, so the safety profile is covered. The description adds genuinely new behavioral context: cost ('Free — no credits consumed'), the async-indexing prerequisite that gates whether results appear, and the return shape. It stops short of error/rate-limit behavior, so not a 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads purpose, then usage routing, prerequisites, return shape, and examples in a logical order. Slightly long, and the explicit 'Returns' block partially duplicates the existing output schema, but every section carries useful information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers purpose, routing, prerequisites, cost, and return shape; combined with annotations and the output schema, an agent has everything needed to invoke it correctly, including the two-step indexing dependency that would otherwise cause empty results.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% and the schema already documents all three params including the limit default/max and query examples. The description adds no parameter syntax or format detail beyond that, so the baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource ('semantic (vector) search across documents in a collection') and immediately distinguishes its output ('ranked text chunks with relevance scores') from the sibling ask_collection. An agent can pick this tool over ask_collection without opening either schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit when-to-use ('when you need raw matching chunks from a collection') and names the alternative with its condition ('for a synthesized cited answer... use ask_collection instead'). It adds a concrete prerequisite workflow (populate via add_document_to_collection, poll get_job_status) and example prompts.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources