Skip to main content
Glama

edit_block

Destructive

Edit a file in place: replaces old_string with new_string, which must occur exactly expected_replacements times (default 1); include nearby lines to make it unique. Spreadsheets: range (e.g. Sheet1!A1:C3) and a 2D content array. DOCX: exact XML (for text across formatting use edit_docx). On a mismatch nothing changes and the closest match is shown. On Windows an edit may not keep the file's own permission entries or alternate data streams (such as the mark of a downloaded file).

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": {
      "file_path": "<file_path>"
    },
    "name": "edit_block"
  }
}

Input Schema

NameRequiredDescriptionDefault
rangeNo
contentNo
deviceIdNoComputer name or id
file_pathYes
new_stringNo
old_stringNo
workSessionIdNoFrom create_work_session
expected_replacementsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • removedInput schema / properties / content / maxItems
      Removed value: -100000
    • changedInput schema / properties / deviceId / description
      Previous value: -"Computer name or id; optional with one computer or a default"New value: +"Computer name or id"
    • removedInput schema / properties / old_string / minLength
      Removed value: -1
    • removedInput schema / properties / range / maxLength
      Removed value: -128
  2. Changed2 schema fields changed
    • changedInput schema / properties / deviceId / description
      Previous value: -"Computer name or id from list_devices. Optional with one computer online or a default set."New value: +"Computer name or id; optional with one computer or a default"
    • changedInput schema / properties / workSessionId / description
      Previous value: -"Work session from create_work_session. Pass the same ID on every call in this conversation; omit for legacy unscoped work."New value: +"From create_work_session"
  3. Changed1 schema field changed
    • addedInput schema / properties / workSessionId
      Added value: +{
      +  "description": "Work session from create_work_session. Pass the same ID on every call in this conversation; omit for legacy unscoped work.",
      +  "format": "uuid",
      +  "type": "string"
      +}
  4. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, so the safety profile is known; the description still adds real behavior beyond that. It discloses atomicity and error reporting ('On a mismatch nothing changes and the closest match is shown') and a platform-specific side effect ('on Windows an edit may not keep the file's own permission entries or alternate data streams'), which are exactly the kinds of risk details an agent cannot infer from 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?

Front-loaded with the primary string-replacement contract before branching into spreadsheet and DOCX modes and then failure behavior. It is information-dense with little filler, though the multi-mode packing into semicolon-separated clauses makes it slightly run-on compared with a fully clean structure.

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 destructive, multi-format editing tool with no output schema and sparse parameter documentation, the description covers mechanism, format-specific requirements, failure semantics, and a cross-platform caveat. The only material omission is the semantics of the session/device parameters, which is minor relative to overall complexity.

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?

With only 25% schema description coverage, the description does substantial compensating work: it explains old_string/new_string pairing, the exact-count semantics of expected_replacements (default 1), the uniqueness requirement, the spreadsheet range string format with an example, and the 2D shape of content. It leaves deviceId and workSessionId (the work-session linkage) unexplained, which is the main remaining gap.

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?

The description opens with a specific verb and resource ('Edit a file in place') and immediately defines the core mechanism: replacing old_string with new_string that must occur exactly expected_replacements times. It further clarifies the distinct operating modes for plain files, spreadsheets (range plus 2D content array), and DOCX (exact XML), which lets an agent distinguish this from edit_docx and edit_spreadsheet 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 Guidelines4/5

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

It gives concrete selection guidance: 'include nearby lines to make it unique' for string edits, 'range (e.g. Sheet1!A1:C3) and a 2D content array' for spreadsheets, and explicitly routes text-across-formatting cases to edit_docx. What it lacks is a named exclusion for the spreadsheet sibling, so the format-selection guidance is clear but not fully explicit about when not to use this tool.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources