Skip to main content
Glama

Add a knowledge source to an agent

add_agent_knowledge

Add a knowledge source to an agent

Adds one knowledge source to a voice agent. The body is one of three shapes chosen by type: url reads one page and reads it again every syncInterval (weekly by default), text takes up to 200000 characters of text to store verbatim, crawl reads a whole website from its start page, up to maxDepth links deep and maxPages pages, and crawls it again every syncInterval. A crawl runs in the background with status pending; follow it with GET /agents/{agentId}/knowledge/crawl. title is optional and defaults to the URL, the host name for a crawl, or to "Text Knowledge" for a text entry. Files go through POST /agents/{agentId}/knowledge/files. The document is created in the voice engine and then attached to the agent, which from then on draws on it in calls. The entry is stored under the account that owns the agent, also when a reseller key adds it. When the document cannot be created or attached, the request still succeeds and the entry is stored with status failed; delete it and add it again.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "agentId": "<agentId>",
      "body": "<body>"
    },
    "name": "add_agent_knowledge"
  }
}

Input Schema

NameRequiredDescriptionDefault
bodyYesA page, a text or a website. Set `type` to `url` and send `url`, to `text` and send `text`, or to `crawl` and send the start page as `url`.
agentIdYesIdentifier of the voice agent. Accepted either as the public form `agent_12` or as the bare number `12`; the prefix is stripped before the lookup.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Beyond the annotations (non-read-only, non-destructive, non-idempotent), it discloses the important behavior: per-type re-sync schedule with a weekly default, a `pending` background status for crawls with the endpoint to poll, and the notable failure mode where the request still succeeds but the entry lands in status `failed` and must be deleted and re-added. The reseller/account-ownership note and the fact that the document is created in the voice engine then attached to the agent are extra context an agent would otherwise have to discover empirically.

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?

The description is front-loaded with the type-based branching and stays dense with specifics, but a few sentences (the voice-engine attachment explanation, the reseller-key aside) are explanatory rather than actionable and could be tightened.

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

Completeness4/5

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

For a nested-body mutation tool with no output schema, the description covers the topics an agent needs: the three body shapes, defaults, async crawl lifecycle, and the silent-failure case. It never states what the successful response looks like (id/status of the created entry), which for a non-idempotent create is the main remaining gap.

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%, so the baseline is 3, but the description genuinely adds semantics: `title` defaults per type (URL, crawl host name, 'Text Knowledge'), `syncInterval` defaults to weekly with `off` meaning read once, and text entries cap at 200000 characters — and it documents `text`, `maxDepth`, and `maxPages`, which the schema does not expose. It does not fully state the defaults for maxDepth/maxPages.

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 gives a concrete verb and resource ('Adds one knowledge source to a voice agent') and immediately decomposes it into the three body shapes selected by `type` (url, text, crawl), so an agent knows exactly what the tool creates and in what flavors.

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

Usage Guidelines4/5

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

It clearly explains when each shape applies (single page vs. verbatim text vs. whole-site crawl with maxDepth/maxPages) and redirects files to a different endpoint ('Files go through POST /agents/{agentId}/knowledge/files'), plus tells the caller how to track a background crawl. It stops short of naming the MCP siblings for listing/cancelling/refreshing knowledge, leaving that routing to inference.

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.