Skip to main content
Glama

Give an agent a knowledge base

set_agent_knowledge
Idempotent

Let an agent search one knowledge base (from list_knowledge_bases), replacing any it had. Pass knowledge_base_id null to remove it. The answer has previous, for undo.

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": {
      "agent_id": "<agent_id>"
    },
    "name": "set_agent_knowledge"
  }
}

Input Schema

NameRequiredDescriptionDefault
agent_idYesThe agent to change.
knowledge_base_idNoThe knowledge base, or null to remove it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare idempotent, non-destructive, non-readonly. The description adds the crucial fact that the operation REPLACES any existing knowledge base, and that the response carries 'previous' enabling undo — behavior not conveyed by the annotations and mitigating the tension with destructiveHint=false.

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?

Three short sentences, front-loaded with the primary action, then the removal variant, then the return value. No filler.

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?

Covers the replace semantics, the null-removal path, and the undo affordance despite having no output schema. Minor gaps around invalid IDs or permissions, but nothing an agent needs to call it correctly is missing for a low-complexity, 2-param tool.

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 coverage is 100% and the schema already documents null-to-remove for knowledge_base_id; the description largely restates it. The only added value is the pointer to list_knowledge_bases for obtaining the ID.

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 the specific verb+resource ('Let an agent search one knowledge base') and immediately names the scope constraint (single KB, replacing any previous). Distinguishable from add_knowledge_source, which attaches sources rather than selecting a searchable base.

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?

Points at list_knowledge_bases as the source of the ID and states the removal path (pass null). No explicit exclusion against sibling tools like set_agent_tools, but the usage context is clear enough to select this tool correctly.

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