Skip to main content
Glama

kb_add

Add or update a document in a knowledge base by providing a unique source identifier, with options to replace existing entries and apply tags.

Instructions

向知识库添加或更新一篇文档。

Args: source: 文档唯一标识,例如 URL、文件路径或自定义 ID。 content: 文档正文。 title: 标题。 tags: 逗号分隔的标签,便于后续过滤。 replace: source 已存在时是否覆盖。

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": {
      "source": "<source>",
      "content": "<content>"
    },
    "name": "kb_add"
  }
}

Input Schema

NameRequiredDescriptionDefault
tagsNo
titleNo
sourceYes
contentYes
replaceNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden; it does disclose the key upsert behavior via 'source 已存在时是否覆盖' (default overwrite), which is genuinely useful. It says nothing about write permissions, whether overwrite is destructive/irreversible, or confirmation, and an output schema exists so return values needn't be explained.

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 purpose is front-loaded in the first sentence and the Args block follows in a predictable, scannable order with no filler. The Args listing is slightly verbose but each entry earns its place by carrying parameter meaning.

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

Completeness3/5

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

For a 5-param mutation tool with no annotations, the description covers parameter meaning well and the output schema covers returns. It remains incomplete on sibling routing and on behavioral risks of the default overwrite, which an agent calling an upsert tool would want to know.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate fully, and it does: it gives source as URL/path/custom ID with examples, tags as comma-separated for later filtering, and replace as overwrite-on-existing behavior. Every one of the 5 parameters is given meaning beyond its bare type/title.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (add/update) and resource (文档 in 知识库), so the core action is unmistakable. However, it offers no differentiation from conceptually overlapping siblings like kb_remember, kb_learn_url, or kb_learn_file, leaving the agent to guess which entry point to use.

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

Usage Guidelines2/5

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

There is no explicit guidance on when to use this tool versus kb_remember, kb_learn_url, or kb_learn_file, nor any mention of preconditions. The 'replace' semantics hint at upsert behavior, but the agent receives no routing rules for choosing this tool over its siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.