Skip to main content
Glama

TextEdit: write document

textedit_write_document
Destructive

Replace the entire text of the frontmost TextEdit document with supplied content so agents can overwrite the document body deterministically.

Instructions

Replace the entire text of the frontmost TextEdit document. (risk: mutating)

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": {
      "text": "<text>"
    },
    "name": "textedit_write_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYesThe new document content.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, so '(risk: mutating)' largely restates structured data. It does add the useful detail that the whole document is overwritten rather than appended, but says nothing about failures when no document is open or whether an undo is possible.

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?

Two short clauses, front-loaded with the operative verb and resource, with zero redundancy. Terseness costs a little context but nothing is wasted.

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

Completeness3/5

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

A one-parameter mutation tool with annotations covering the safety profile and no output schema, so return values need not be explained. Still, the description omits the operating conditions (app running, document frontmost, behavior when none is open) that an agent needs to invoke this reliably.

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?

Only one parameter with 100% schema coverage, so the schema already documents 'text' as the new document content. The description adds that this text becomes the document's entire content, which is a small but real gain over the schema alone.

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 ('Replace the entire text of the frontmost TextEdit document'), which clearly contrasts with the sibling textedit_read_document. It does not name the sibling or explicitly scope the contrast, but the read/write split is inferable.

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?

Usage is only implied by the word 'Replace' – it is clear this is for full rewrites rather than partial edits, but there is no statement of when to use it, what alternatives exist, or what prerequisites apply (e.g. a document must be open and frontmost).

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