Skip to main content
Glama

Add comment

typst_add_comment

Attach a review comment to exact text or a line range in a Typst file so it stays anchored to that content as the file changes.

Instructions

Add a review comment to a text file, anchored either on exact text (anchor_text, plus occurrence if it is not unique) or on a line range. The comment stays attached to that text even when the file changes.

Input Schema

NameRequiredDescriptionDefault
pathYesProject-relative path like 'chapters/intro.typ', or a file ID
contentYesComment text
end_lineNo
occurrenceNoWhich occurrence of anchor_text (1-based) if it appears several times
project_idYesProject ID from typst_list_projects, e.g. 'pAbC123dEf456gHi789jKl'
start_lineNo
anchor_textNoExact text the comment refers to

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare the safety profile (readOnlyHint=false, destructiveHint=false, idempotentHint=false), so the description does not need to state that this writes. It adds genuine behavioral context that annotations cannot: the comment remains attached to the anchored text even after the file changes. It omits what a repeated call will do given idempotentHint=false (likely a duplicate comment) and what happens if anchor_text is not found.

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?

Two sentences, zero padding, and the anchoring modes are front-loaded before the persistence note. Every clause carries information an agent would not get from the schema or annotations.

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 7-parameter mutation tool with no output schema, the description covers the one genuinely ambiguous decision (targeting strategy) and one non-obvious behavior (anchor persistence). It leaves out error behavior when anchor_text or the line range is invalid, and it does not mention what is returned, which is a modest gap given the absence of an output schema.

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 71% and the schema already documents path, content, project_id, and occurrence. The description adds real meaning by presenting the anchor_text/occurrence combination as an alternative to a line range, which the schema does not express. However, it does not clarify whether start_line and end_line must be supplied together or whether end_line is optional, leaving the least-documented parameters ambiguous.

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?

Specific verb plus resource ('Add a review comment to a text file') and it names the two anchoring modes. Reading the description alone, an agent can distinguish this from typst_reply_comment, typst_list_comments, and typst_resolve_comment without opening any schema.

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?

The description states the two creation modes (exact-text anchor with occurrence disambiguation, or line range), so an agent knows how to select an anchor. It does not explicitly route against siblings such as typst_reply_comment ('reply to an existing thread') or say when line-range anchoring is preferable to text anchoring.

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