Skip to main content
Glama

comment_doc

Posts a comment on a document, optionally anchored to an exact quoted passage so it appears on the correct text. Supports whole-document comments and threaded replies.

Instructions

Comment on a document. The quote parameter anchors a comment to a specific passage; it holds the text exactly as the document reads it — the server finds it and anchors the comment there, so no position is computed by the caller (there is no offset parameter, and a position you calculated would silently point at the wrong sentence). Without quote the comment is on the whole document. Your comment appears in the same thread humans see in the document UI. doc may be an old path or a bare slug; the reply then carries moved_to (the current path). An ambiguous bare slug is a 409 listing the full paths.

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": "<doc>",
      "body": "<body>"
    },
    "name": "comment_doc"
  }
}

Input Schema

NameRequiredDescriptionDefault
docYesDocument UUID, or a slug path like 'architecture/adr/adr-004' (a path also needs project_id). A path survives the document being moved: the old path still resolves, and so does a bare slug ('adr-004') when exactly one live document in the project has it. When the reference was not the live path, the reply carries moved_to — the document's current path; use that from now on. A bare slug shared by several documents is a 409 ('Ambiguous document slug') listing the full paths: pick one and repeat the call with the full path or the UUID. The UUID never changes.
bodyYesThe comment text. Markdown; @slug mentions notify that person or agent.
quoteNoThe passage being commented on, copied from the document exactly. One sentence is plenty. Omit to comment on the document as a whole.
reply_toNoUUID of the comment being answered. A reply inherits that thread's anchor, so it takes no quote of its own.
project_idNoProject UUID. Required only when doc is a slug path.
quote_contextNoA longer passage containing the quote exactly once — send this when the quote occurs several times in the document and you were told it was ambiguous.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4.3/5.0
Behavior4/5

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

Annotations cover the safety profile (writable, non-destructive, non-idempotent), and the description adds genuinely new behavior: anchoring is server-side, caller-computed offsets silently mis-anchor, errors surface as 409 for ambiguous slugs, and replies carry moved_to. Some of this repeats the doc parameter schema, but the offset warning and thread visibility are real added context.

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?

Front-loads the core action and the anchoring rule, then covers edge cases (moved docs, ambiguous slugs) last. Dense and mostly non-redundant, though the moved_to/409 material overlaps with the doc parameter description.

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?

No output schema exists, and the description covers the return-relevant cases an agent needs: moved_to on relocated docs and 409 on ambiguous slug. It does not describe the comment object returned on success, which is a modest remaining gap for a write tool.

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 100%, so baseline is 3; the description still adds meaning by explaining why quote must be copied verbatim, why no offset parameter exists, and that reply_to inherits the thread anchor. It doesn't add syntax examples beyond the schema's slug example.

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 ('Comment on a document') and immediately explains the two operating modes: anchored to a passage via quote, or whole-document. The line about the comment appearing in 'the same thread humans see in the document UI' makes the effect concrete and separable from sibling tools like list_doc_comments.

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 clear conditional guidance: send quote to anchor, omit it to comment on the whole document, use quote_context when a quote is ambiguous or the server said so. It does not name or compare against sibling alternatives (e.g. add_comment), so the agent gets context but no explicit when-not routing.

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