Skip to main content
Glama

Add Document to Collection

add_document_to_collection
Idempotent

Add an evidence bundle to a collection and trigger async vector indexing. Use after create_collection to populate a collection with documents. Once indexed, documents become searchable via search_collection and ask_collection. Indexing is async — poll get_job_status with the returned job_id until status is "complete". PREREQUISITE: Bundle must have status "complete" (check with get_bundle). Collection must be owned by your API key. Returns: { collection_id, bundle_id, job_id (poll for indexing completion) } Example prompts:

  • "Add my contract bundle ev_550e8400 to the Q4 Contracts collection."

  • "Put this evidence bundle into my Due Diligence Docs collection for search."

  • "Add document [bundle_id] to collection [col_id] with a title."

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleNoOptional display title for the document in this collection. Example: "Q4 2025 Financial Report"
bundle_idYesEvidence bundle ID (ev_...) to add. Bundle must have status "complete". Example: "ev_550e8400-e29b-41d4-a716-446655440000"
collection_idYesCollection ID (col_...) returned by create_collection. Example: "col_550e8400-e29b-41d4-a716-446655440000"

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
job_idYes
receiptYes
bundle_idYes
collection_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added
  2. Removed
  3. Changed2 schema fields changed
    • addedOutput schema / properties / receipt
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": false,
      +      "properties": {
      +        "action": {
      +          "type": "string"
      +        },
      +        "agent_id": {
      +          "type": "string"
      +        },
      +        "algorithm": {
      +          "const": "secp256k1-eip191",
      +          "type": "string"
      +        },
      +        "bundle_id": {
      +          "type": "string"
      +        },
      +        "key_id": {
      +          "type": "string"
      +        },
      +        "manifest_sha256": {
      +          "type": "string"
      +        },
      +        "receipt_id": {
      +          "type": "string"
      +        },
      +        "signature": {
      +          "type": "string"
      +        },
      +        "signed_at": {
      +          "type": "string"
      +        },
      +        "signer_address": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "receipt_id",
      +        "bundle_id",
      +        "agent_id",
      +        "action",
      +        "manifest_sha256",
      +        "signed_at",
      +        "signature",
      +        "signer_address",
      +        "key_id",
      +        "algorithm"
      +      ],
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ]
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "collection_id",
      -  "bundle_id",
      -  "job_id"
      -]New value: +[
      +  "collection_id",
      +  "bundle_id",
      +  "job_id",
      +  "receipt"
      +]
  4. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "bundle_id": {
      +      "type": "string"
      +    },
      +    "collection_id": {
      +      "type": "string"
      +    },
      +    "job_id": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "collection_id",
      +    "bundle_id",
      +    "job_id"
      +  ],
      +  "type": "object"
      +}
  5. Changed3 schema fields changed
    • changedInput schema / properties / bundle_id / description
      Previous value: -"Evidence bundle ID (ev_...) to add. Bundle must have status \"complete\"."New value: +"Evidence bundle ID (ev_...) to add. Bundle must have status \"complete\". Example: \"ev_550e8400-e29b-41d4-a716-446655440000\""
    • 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 / title / description
      Previous value: -"Optional display title for the document in this collection"New value: +"Optional display title for the document in this collection. Example: \"Q4 2025 Financial Report\""
  6. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations cover safety (idempotentHint=true, destructiveHint=false, readOnlyHint=false), and the description adds substantial non-annotation context: indexing is asynchronous, the returned job_id must be polled via get_job_status until 'complete', and documents only become searchable after indexing. It also discloses the preconditions on bundle status and collection ownership.

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-loaded with the core action and side effect, followed by prerequisites, return shape, and example prompts in a scannable structure. The three example prompts are somewhat redundant given the clear prose but aid invocation grounding; minor bulk only.

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?

For an async mutation with an output schema, the description covers the prerequisite checks, the async polling contract, the returned job_id, and the downstream searchability. Nothing an agent needs to call and follow up correctly is missing.

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%, so all three parameters are already documented, including the bundle 'complete' status requirement and the collection_id provenance. The description's parameter-level content largely restates the schema, adding only the ownership constraint, 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 and resource ('Add an evidence bundle to a collection') plus the side effect ('trigger async vector indexing'), which distinguishes it from siblings like create_collection and search_collection. An agent can identify the operation without opening the 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?

Explicitly says 'Use after create_collection', states prerequisites (bundle status must be 'complete', collection must be owned by your API key), and routes the agent to get_bundle, get_job_status, search_collection, and ask_collection for the follow-on steps. When-to-use and alternatives are both covered.

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