Skip to main content
Glama

kb_documents_edit_begin

Idempotent

Open a surgical edit session on a document and snapshot its current revision. Stage edits with kb_documents_edit_apply, then kb_documents_edit_commit (lands one revision) or kb_documents_edit_discard. Calling this again for a document you already have an open session on resumes that session (resumed=true).

Input Schema

NameRequiredDescriptionDefault
document_idYesDocument id to edit (required)
tenant_slugNoTenant slug to target. Required when your token grants several workspaces; omit when it grants one. If you omit it with several, the refusal names your default workspace; call kb_tenants_list to see every workspace the token grants.
include_bodyNoEcho the full working buffer back (default false; the body you open is the document you already have - request it only for a server-confirmed snapshot).

Output Schema

NameRequiredDescriptionDefault
resumedYes
expires_atYes
session_idYes
document_idYes
working_body_mdNo

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 readOnlyHint=false, idempotentHint=true and destructiveHint=false, and the description adds real context beyond them: a revision snapshot is taken, and re-invoking resumes the existing session with resumed=true (which explains the idempotent hint). It omits session lifetime/concurrency behavior, e.g. whether an open session blocks other writers.

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, front-loaded with the action, then the workflow chain, then the resume edge case. No repetition of the title, 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?

With annotations covering safety and an output schema covering returns, the description supplies the workflow and resume semantics an agent needs to call this correctly. Gaps are minor: session lifetime and how this relates to kb_documents_update.

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%, so document_id, tenant_slug and include_body are all documented in the schema; the description adds no parameter-level detail beyond the notion of a snapshot. Baseline 3 applies where the schema carries the semantics.

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 ("Open a surgical edit session on a document") plus the side effect ("snapshot its current revision"). It immediately names the follow-on siblings (edit_apply, edit_commit, edit_discard), so an agent can place it in the workflow without opening other schemas.

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?

Gives a clear usage sequence: begin, stage with kb_documents_edit_apply, then commit or discard, and explains the re-call/resume case. It does not explain when to choose this session workflow over the direct kb_documents_update sibling, which is the main remaining ambiguity.

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.