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.7/5.0
Behavior4/5

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

Annotations already indicate read-only and idempotent. Description adds process details (retrieves chunks, synthesizes with citations) and mentions prerequisites, which enriches understanding beyond annotations. No contradictions.

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?

Description is well-structured with main purpose first, then usage guidance, prerequisite, output format, and examples. No redundancy; every sentence provides essential 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?

Given complexity of RAG tool, description covers purpose, usage context, prerequisites, output format, and examples. Schema covers parameters fully. Overall very complete for an AI agent.

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?

Input schema has 100% coverage with descriptions and examples. Description adds value by noting default for max_chunks (8) and usage advice (increase for broad questions, decrease for precision), enhancing parameter semantics beyond schema.

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 a question using RAG over a document collection, synthesizing cited answers. It explicitly distinguishes from sibling tools 'collection.search' (raw chunks) and 'url.qa' (single-document Q&A), providing high specificity.

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?

Description explicitly states when to use (need direct answer grounded in collection documents) and when not to use (use collection.search for raw chunks, url.qa for single documents). Also notes prerequisite that collection must be populated and indexed.

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.4/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose, with no overlap. The category prefixes (account, bundle, collection, document, job, receipt, url) and specific action names (get, notarize, verify, create, list, etc.) ensure that an agent can unambiguously select the correct tool for any task.

Naming Consistency5/5

All tools follow a consistent category.action or category.action_noun pattern using snake_case (e.g., bundle.get, collection.add_document, url.translate). No mixed conventions or irregular names, making the pattern predictable and easy to learn.

Tool Count4/5

With 22 tools, the set is somewhat large but each tool addresses a distinct need within a broad domain (evidence management, document AI, collections, URL processing, job tracking, receipts). The count is slightly above the typical well-scoped range but still reasonable given the scope.

Completeness2/5

The tool surface has notable gaps: there is no tool to create or delete an evidence bundle, nor to update collections or bundles. The core workflow of creating a bundle from a document is missing, and the lifecycle is incomplete, which would likely cause agent failures in typical use cases.

Resources