Skip to main content
Glama

Insert new content

geml_add

Insert new blocks or prose at document end or before/after an anchor, with validation to prevent clashes or breaks. Returns ok, diagnostics, and revision.

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
anchorNoThe block the insertion is relative to — an id, or any address geml_list prints; it must name one block. Required for before/after
contentYesThe GEML fragment to insert
positionYesWhere to insert

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.1.6
    • changedInput schema / properties / anchor / description
      Previous value: -"Block id the insertion is relative to; required for before/after"New value: +"The block the insertion is relative to — an id, or any address geml_list prints; it must name one block. Required for before/after"
  2. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only cover the safety profile (readOnlyHint false, destructiveHint false, idempotentHint false, openWorldHint false); the description goes well beyond them by disclosing pre-write validation, the exact refusal conditions (missing anchor, id clash, document-breaking content), the .md conversion rule and the refusal of content Markdown cannot hold, and the return shape including `notes`, `diagnostics`, `revision`, and `ok: false` with a `hint` leaving the file unchanged. No statement conflicts with the annotations.

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?

Purpose and the geml_set contrast are front-loaded, and the paragraph flows from what it does to how it behaves to what it returns. It is dense and parenthetical-heavy (nested clauses about .md conversion), which costs it a point, but essentially every sentence carries information an agent needs.

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?

There is no output schema, so the description carries the return contract — `{ok, file, diagnostics, revision}` plus optional `notes` and the `ok: false` + `hint` failure shape with the file left unchanged. Combined with the validation and conversion rules, an agent has everything needed to call this mutation tool and interpret both success and refusal.

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 description coverage is 100%, so the structured baseline is 3; the description nevertheless adds real meaning, explaining that ids inside `content` are preserved, that `position: append` means the end of the document while before/after bind to `anchor`, and that anchor may be 'an id, or any address geml_list prints'. It stops short of documenting enum edge cases or content size limits, keeping it at 4 rather than 5.

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 ('Insert new content — one or more blocks, or prose') and immediately scopes it with the two insertion modes (append vs before/after anchor). It explicitly names the sibling it must not be confused with ('to change a block that does, use geml_set'), so 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?

Gives an explicit when-to-use rule ('content that does not exist yet') paired with the exclusion and the alternative ('to change a block that does, use geml_set'). It also states the precondition that before/after requires an anchor naming exactly one block, so there is nothing left to infer.

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