Skip to main content
Glama

preview_text_edit

Validate a proposed full-text file replacement by checking the target path, replacement content, and expected SHA-256 before any edit is saved. Preview only; no write occurs.

Instructions

Use before a requested replacement edit to validate path, proposed full content and the original file SHA-256. Preview only: no write or Owner grant. Do not expose sensitive content in chat.

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>",
      "expected_sha256": "<expected_sha256>"
    },
    "name": "preview_text_edit"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesPath to the target within the already-configured Owner read/edit roots; path alone grants no access.
contentYesFull proposed text; may contain secrets. Avoid submitting secrets; submitted writes require local Owner review. Preview alone never saves.
expected_sha256YesExpected 64-character lowercase SHA-256 of current file content; stale values must fail.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.2

TDQS

A4/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden, and it does real work: it declares the operation is preview-only, performs no write, and grants no Owner permission, which is exactly the safety profile an agent needs for a file-mutating-adjacent tool. It also warns about not echoing sensitive content, but stays silent on failure behavior (e.g., a stale hash) beyond what the parameter schema already says.

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 short sentences, front-loaded with the when-to-use condition, followed by the safety constraint and the content-handling warning. Nothing is redundant and the ordering matches how an agent decides and then calls.

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?

An output schema exists, so return values need not be explained, and all three required parameters are documented. Given the tool's complexity is modest, the description covers purpose, timing, and safety adequately; the only gap is that it does not describe the Owner-review workflow that presumably follows a non-preview edit.

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 description coverage is 100%, so all three parameters are already fully documented in the schema, including the 64-character lowercase SHA-256 format and the Owner-root scoping. The description only restates the three inputs at a high level and adds no format or edge-case meaning beyond them, so the baseline of 3 applies.

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?

The description states a specific verb (validate) and resource (a proposed replacement edit: path, full content, original SHA-256) and pins the timing ('before a requested replacement edit'). It is clear what the tool does, though it never names the closely related siblings (preview_source_patch, request_source_patch_dev) that an agent must distinguish it from.

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?

It gives a concrete usage context: call this before performing a replacement edit, as a validation step. It does not state exclusion conditions or explicitly route the agent to alternatives such as preview_source_patch for a different resource type, so it stops short of full when/when-not guidance.

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