Skip to main content
Glama

Insert new content

geml_add

Insert new blocks or prose into a GEML or Markdown document—append at the end or place before/after an anchor block. Validates first, refusing missing anchors or clashing ids.

Instructions

Insert new content — one or more blocks, or prose — at the end of the document (position: append) or before/after the block named by anchor. Use this for content that does not exist yet; to change a block that does, use geml_set. Ids inside the content are kept. In a .md file Markdown lands as written, and GEML content is converted to Markdown as to: "md" converts it, the result's notes saying so; content Markdown cannot hold, such as a view without its source, is refused. Like every write here it is validated first: a missing anchor, an id that clashes with an existing one, or content that would break the document is refused. Returns {ok, file, diagnostics, revision}, with notes when the write did something to say out loud (a block it dropped, an address it changed); a refusal is ok: false with a hint, and the file is unchanged.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileYesDocument path relative to the server's --root directory, e.g. notes/spec.geml
anchorNoBlock id the insertion is relative to; required for before/after
contentYesThe GEML fragment to insert
positionYesWhere to insert

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Goes well beyond the annotations (which only say non-readonly, non-idempotent, non-destructive). Discloses validation-before-write, the specific refusal conditions (missing anchor, id clash, document-breaking content), format conversion semantics for .md files, id preservation, the refusal shape (ok:false + hint, file unchanged), and side-effect reporting via notes.

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 position semantics, then routes to the sibling, then details behavior. Dense but every clause carries information; the return-shape sentence is somewhat long but justified by the lack of an output schema.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the description correctly supplies the return shape ({ok, file, diagnostics, revision} plus notes) and refusal behavior. Combined with validation, conversion, and routing detail, nothing an agent needs to invoke it correctly is missing.

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 the baseline is 3, but the description adds meaning: position values (append/before/after) and the anchor-to-position dependency ('required for before/after'), plus the constraint that ids inside content are kept. It does not add format details for file/content beyond the schema.

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 precise verb+resource ('Insert new content ... at the end of the document or before/after the block named by anchor') and explicitly distinguishes itself from the sibling geml_set ('content that does not exist yet; to change a block that does, use geml_set'). An agent can route correctly without opening either schema.

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

Usage Guidelines5/5

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

Explicit when-to-use ('content that does not exist yet'), when-not ('to change a block that does, use geml_set'), and the position/anchor condition that selects before/after vs append. Nothing 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.