Skip to main content
Glama

create_doc

Create a new attributed Markdown or HTML document at a given path, refuse overwriting existing files, and return the version needed for later edits.

Instructions

Create a new document, committed at once and attributed to you; refuses if the path exists. Pick the format by content: .md for prose, notes, recaps, specs (the default); .html for a self-contained styled page (deck, dashboard) with its own CSS/JS, shown as-is in a sandbox. Never put a whole HTML document in a ```html block of a .md: it would show as source. Returns the version edit_doc takes, and how the quotations it holds stand against the mind's files. Use create_inbox_item instead when the human should decide whether to keep it, edit_doc to change an existing doc.

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": {
      "path": "<path>",
      "content": "<content>",
      "ai": "<ai>"
    },
    "name": "create_doc"
  }
}

Input Schema

NameRequiredDescriptionDefault
aiYesYour AI family in lowercase (claude, chatgpt, gemini), not the model name. Attributes the change.
pathYesEnds in .md or .html, e.g. notes/recap.md, projects/deck.html (not under inbox/ or remotes/).
contentYesA .md: the full body, with an H1 title. A .html: a complete self-contained page.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.7.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only declare openWorldHint=false and destructiveHint=false; the description adds substantially more: the write is committed at once with no draft stage, it fails rather than overwrites when the path exists, authorship is attributed, and .html is rendered as-is in a sandbox. It also discloses what it returns (the version token edit_doc accepts), which no structured field covers.

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 failure condition in the first clause, then moves to format selection, then alternatives. Slightly long and clause-dense in the middle sentence, but no sentence is filler and each one carries a distinct fact.

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?

For a 3-parameter mutation with no output schema, the description covers the write semantics, the error condition, the render model, the return token, and the sibling alternatives. Nothing an agent needs to call it correctly or avoid the common misuse 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 genuine decision semantics: .md is the default format, .html is meant for self-contained pages with their own CSS/JS, and the ```html-in-.md pitfall tells the agent why the path suffix matters. The `ai` and `content` parameters are left entirely to 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 specific verb and resource ("Create a new document") plus two behavioral specifics that separate it from siblings: committed immediately, attributed to the caller, and it refuses an existing path. An agent can distinguish it from create_inbox_item and edit_doc 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 Guidelines5/5

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

Explicit routing both ways: create_inbox_item when the human should decide whether to keep the artifact, edit_doc to change an existing doc. It also gives positive selection criteria for the format (.md for prose/notes/specs, .html for a self-contained styled page) and a concrete anti-pattern to avoid.

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