Skip to main content
Glama

resource_edit

Destructive

Write a complete resource source file with its content and current SHA-256, or null for a new file, to create or update files without overwriting conflicting changes.

Instructions

Write a whole source file. Pass its current SHA-256 from resource_read, or null to create a new 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": {
      "resource": "<resource>",
      "file": "<file>",
      "content": "<content>",
      "expectedSha256": "<expectedSha256>"
    },
    "name": "resource_edit"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileYes
contentYes
resourceYes
expectedSha256Yes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, so the description's job is to add context, which it does by disclosing that the entire file is replaced and that expectedSha256 acts as an optimistic-concurrency guard. The notable gap is that it never states what happens when the SHA does not match (presumably a rejection) or that a mismatch aborts the write.

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, zero filler, and the critical overwrite semantics are front-loaded before the SHA precondition. Every clause carries information an agent needs.

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?

For a destructive whole-file write with 0% schema coverage and no output schema, the definition is only partially complete — it omits the relationship between resource and file, the outcome on SHA mismatch, and any indication of returned content. The most dangerous behavior (full overwrite) is at least disclosed.

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 0% for all four parameters, so the description must compensate. It successfully explains expectedSha256 (source it from resource_read, null means create) and implies content is the full file body, but leaves resource vs. file entirely unexplained — it is unclear whether file is a path relative to the named resource or a separate identifier.

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?

"Write a whole source file" gives a specific verb (write) and resource (source file), and the word "whole" signals full-content replacement rather than a patch, which separates it from a partial-edit or read tool. It does not explicitly differentiate itself from resource_create, so it falls short of a 5.

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?

The description routes the agent concretely: obtain the SHA-256 from resource_read to overwrite, or pass null to create a new file. That covers the create-vs-overwrite decision, but it never says when to use this instead of resource_create or what to do if a partial update is wanted.

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