Skip to main content
Glama

addComment

Adds a comment to a Google Docs document at a specified text range, enabling AI agents to programmatically annotate documents and retrieve the comment ID via listComments.

Instructions

Adds a comment to the document at the specified text range. Use listComments to retrieve the comment ID after creation. Note: programmatically created comments appear in the comments panel but may not show as anchored highlights in the document UI.

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": {
      "documentId": "<documentId>",
      "startIndex": "<startIndex>",
      "endIndex": "<endIndex>",
      "content": "<content>"
    },
    "name": "addComment"
  }
}

Input Schema

NameRequiredDescriptionDefault
contentYesThe text content of the comment.
endIndexYesThe ending index of the text range (exclusive).
documentIdYesThe document ID — the long string between /d/ and /edit in a Google Docs URL.
startIndexYesThe starting index of the text range (inclusive, starts from 1).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv4.0.0-rc.1

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations present, the description carries the full burden, and it discloses a non-obvious behavioral quirk: created comments appear in the comments panel but may not render as anchored highlights in the document UI. That is exactly the kind of surprise worth surfacing. It omits permission/scope requirements and says nothing about index units (UTF-16 code units) or failure behavior for out-of-range indices.

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 doing distinct work: purpose and anchor, follow-up step, and a UI caveat. The purpose is front-loaded and there is no redundant restatement of the name or schema.

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 mutating tool with no annotations and no output schema, the description is nearly complete: it covers what is created, where it anchors, how to obtain the resulting ID, and a rendering caveat. The remaining gaps are permission requirements and index-offset semantics, which are relevant for a range-based document mutation.

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%, so all four parameters are already documented in the schema, which sets the baseline at 3. The description reinforces the text-range concept and clarifies indirectly that the comment ID is not returned (hence the listComments follow-up), but adds no meaning beyond that.

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 and resource ("Adds a comment") plus the anchoring scope ("at the specified text range"), which distinguishes it from a general mutation. It does not explicitly contrast with replyToComment or updateComment, so the sibling differentiation is implied rather than stated.

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?

The definition supplies follow-up guidance ("Use listComments to retrieve the comment ID after creation"), which is genuinely useful for the post-creation workflow. However, there is no guidance on when to choose this over replyToComment, updateComment, or resolveComment, so the selection logic is left to inference.

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

Deploy Server

Other Tools