Skip to main content
Glama

Retrain an agent

agent_train

Rebuild the agent's knowledge embeddings from its attached knowledge-base entries. Required after every kb_upsert or kb_attach, or the agent answers from stale material — this is the step most easily forgotten. It only re-indexes existing knowledge: it does not change the agent's instructions (agent_upsert) and does not teach it anything not attached via kb_attach. Requires the "Agents" permission on the plan.

Input Schema

NameRequiredDescriptionDefault
agentIdYesAI agent id, from `agent_list`.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false and destructiveHint=false, so the description's real contribution is the scope statement: it only re-indexes existing knowledge and does not alter instructions or teach unattached material. It also discloses the "Agents" permission requirement, which annotations cannot express. It stops short of saying whether the rebuild is synchronous, how long it takes, or what the call returns — a meaningful gap for a non-idempotent mutation.

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 sentences, each load-bearing: what it does, when it must run, and what it does not do. The trigger constraint is front-loaded right after the definition, and there is 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?

For a one-parameter mutation with no output schema, the definition covers scope, prerequisites, permission gating, and sibling boundaries. The only shortfall is operational: no mention of latency, async behavior, or whether the call can fail on missing KB entries, which an agent retrying or chaining calls would want.

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% and the single agentId parameter is already documented in-schema as coming from agent_list. The description adds no further semantics about the identifier, 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: "Rebuild the agent's knowledge embeddings from its attached knowledge-base entries." It also explicitly bounds the operation against two named siblings (agent_upsert for instructions, kb_attach for adding material), so an agent can distinguish it without opening any 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?

Gives an explicit trigger ("Required after every kb_upsert or kb_attach") plus the consequence of skipping it (stale answers). It also names the alternatives for the adjacent needs, making the when/when-not split unambiguous.

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