Skip to main content
Glama

Ask Collection

collection.ask
Read-onlyIdempotent

Answer a question using RAG over a document collection. Retrieves relevant chunks then synthesizes a cited answer with source attribution. Use when you need a direct answer grounded in your collection documents. For raw matching chunks (without synthesis), use collection.search instead. For single-document Q&A, use url.qa instead. PREREQUISITE: Collection must be populated via collection.add_document and indexed before results appear. Returns: { answer: string, sources: [{ bundle_id, chunk_id }], retrieval: [{ bundle_id, chunk_id, text, score }] } Example prompts:

  • "What are the key terms of the service agreement in my collection?"

  • "Based on my due diligence docs, what are the main risks?"

  • "Answer this question using all documents in the Q4 Contracts collection."

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
questionYesNatural language question to answer from collection documents. Example: "What are the key terms of the service agreement?"
max_chunksNoMax chunks to retrieve for context (default 8). Increase for broad questions, decrease for precision. Example: 12
collection_idYesCollection ID (col_...) returned by collection.create. Example: "col_550e8400-e29b-41d4-a716-446655440000"

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
answerYes
sourcesYes
retrievalYes

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare readOnlyHint and idempotentHint; description adds details about RAG process, chunk retrieval, synthesis, and source attribution. No contradictions; adds valuable behavioral context beyond annotations.

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

Conciseness5/5

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

Highly concise yet comprehensive: one paragraph covering purpose, usage, prerequisites, return format, and examples. No unnecessary words.

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 all necessary aspects: behavior, prerequisites, return structure, and relationships to siblings. Complete for an agent to confidently use.

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

Parameters4/5

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

Schema coverage is 100% with examples; description adds practical guidance like 'Increase for broad questions, decrease for precision' for max_chunks, enhancing semantic understanding beyond schema alone.

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?

The description clearly states the tool answers questions using RAG over a document collection, and distinguishes itself from sibling tools (`collection.search` for raw chunks, `url.qa` for single-document Q&A).

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?

Explicitly describes when to use (need direct answer grounded in collection) and alternatives; also provides prerequisites (collection must be populated and indexed) and example prompts to guide usage.

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.

TDQS

A4.5/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose, grouped by domain (account, bundle, collection, document, job, receipt, url). Descriptions and naming make it easy to differentiate between similar tools like url.extract vs document.extract_text or collection.search vs collection.ask.

Naming Consistency5/5

All tools follow the same prefix.group_action pattern in snake_case (e.g., account.quota, bundle.get, collection.create). No mixing of conventions, making the API predictable and easy to navigate.

Tool Count5/5

With 22 tools, the server covers a comprehensive set of operations for document and evidence management. Each tool serves a specific purpose, and the count feels well-scoped without being bloated or sparse.

Completeness3/5

The tool surface lacks explicit create and delete operations for bundles and collections. Bundles appear to be created externally, and there is no tool to remove a bundle or collection. This is a notable gap given the server's stated purpose.

Resources