Skip to main content
Glama

Edit knowledge document

edit_knowledge_document
Destructive

Change a note's or a text file's text in its knowledge base: its name and folder stay, and it is indexed again. text is its whole new text; was_sha256, the fingerprint of the text it was made from (it writes only over that).

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": {
      "doc_id": "<doc_id>",
      "text": "<text>"
    },
    "name": "edit_knowledge_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYes
doc_idYesThe document's id.
was_sha256No

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already flag this as destructive and non-idempotent, and the description adds real context beyond them: the document is re-indexed after the edit, name and folder are preserved, and the write is guarded by a prior-version fingerprint. It does not state what happens when the fingerprint does not match or when the optional was_sha256 is omitted, which keeps it from a 5.

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?

One dense sentence with the core action front-loaded, followed by the invariants and the pointer to the parameter semantics. The nested parenthetical is slightly awkward to parse but every clause carries information; nothing is 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 destructive three-parameter mutation with no output schema, the description covers the mutation boundary, the re-index side effect, and the concurrency guard, which is most of what an agent needs. Missing only failure behavior on fingerprint mismatch and the effect of omitting the optional parameter.

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 only 33% (only doc_id is documented), so the description must carry the load, and it does: 'text' is defined as the document's entire replacement text, and 'was_sha256' is explained as the fingerprint of the version being overwritten, implying optimistic concurrency. It still leaves unclear how to obtain that fingerprint and what omitting it means.

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?

The description opens with a concrete verb and resource ('Change a note's or a text file's text in its knowledge base') and bounds the operation ('its name and folder stay'), so an agent knows exactly what is and is not modified. It does not explicitly contrast itself with siblings like update_knowledge_base or edit_agent_memory_item, so it stops short of a 5.

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

Usage Guidelines3/5

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

Usage is implied rather than stated: the note that name and folder are unchanged signals this tool is for text-only edits, not renaming or moving. There is no explicit when-to-use framing, no named alternative (e.g. for renames or for editing agent memory), and no prerequisite about needing a current fingerprint.

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.