Skip to main content
Glama

Add documents to a knowledge base

workbench_kb_add_documents

Adds documents to a knowledge base and starts ingestion (chunk + embed; graph KBs also extract entities; tabular KBs load CSV as tables). Text goes inline (Markdown, plain text, CSV — encoding utf8); binary files (PDF, .docx) go base64-encoded with their mimeType. Up to 50 sources per call, ~10 MB each. Ingestion runs in the BACKGROUND — the result carries a runId; check it with workbench_kb_ingestion_status when the user asks, don't poll. workbench_kb_search works once it finishes. Content from blocks is ideal source material. Check workbench_kb_documents_list first so you don't add a document twice. Embedding spends workspace inference credit, so this sits behind the approval gate: may return needs_confirmation.

Input Schema

NameRequiredDescriptionDefault
kbIdYesKnowledge base id (from workbench_kb_list or workbench_kb_create).
sourcesYesDocuments to ingest (1-50).
workspaceNoWorkspace slug override.
approvalIdNoApproval id from a prior needs_confirmation envelope.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Annotations declare readOnlyHint=false and destructiveHint=false, but the description adds crucial context beyond them: ingestion runs in the background and returns a runId, embedding spends workspace inference credit, the call may return `needs_confirmation`, and there are size/count limits. This is rich behavioral disclosure that goes well beyond the structured safety hints.

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?

The description is front-loaded with the core purpose, then flows into operational details (background ingestion, limits, alternatives, approval gate) in a compact, information-dense manner. Every sentence contributes actionable guidance without redundancy or filler.

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 a mutation tool with no output schema, the description covers everything an agent needs: ingestion behavior, return value (runId), follow-up tools, limits, approval flow, and duplicate-avoidance. Annotations cover safety, and the description fills all remaining gaps, making the definition self-sufficient.

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 the schema already documents kbId, sources, encoding, mimeType, and workspace/approvalId. The description restates the encoding and mimeType rules (utf8 for text, base64 for PDF/docx) and limits (50 sources, ~10 MB each), which are already in the schema constraints. It adds little new semantic meaning beyond what the schema provides, so baseline 3 is appropriate.

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 ('Adds documents') and resource ('knowledge base'), and immediately clarifies that ingestion starts. It names sibling tools (workbench_kb_ingestion_status, workbench_kb_search, workbench_kb_documents_list) so an agent can distinguish this tool from alternatives without opening schemas.

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 tells the agent to check workbench_kb_documents_list first to avoid duplicates, to use workbench_kb_ingestion_status only when the user asks (not poll), and that search works only after ingestion finishes. It also identifies ideal source material (<attached-file> blocks) and notes the approval gate, giving clear when/when-not guidance.

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