Skip to main content
Glama

Edit app source

edit_app
Idempotent

Avoid full-source rewrites by surgically replacing exact strings or byte ranges in an app, with atomic multi-edit updates and version validation.

Instructions

Surgical edits to an app WITHOUT round-tripping the whole source. Two edit forms, mixable: RANGE {offset, length, expect_hash, new_string} replaces a span you read with get_app (cheapest — echo the window's offset/returned/hash, no anchor text travels); STRING {old_string, new_string} replaces an exact-once match (or set replace_all). Range offsets always address the expected_version document and must not overlap; string edits apply after ranges, in order. All edits apply together, or nothing applies. The #oma-manifest block is re-read on save.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
appYesapp name (this tool says `app`; save_app and get_app say `name`)
actorNo
editsYeseach item is RANGE (offset+length+expect_hash) or STRING (old_string)
command_idYesidempotency key — generate a fresh uuid per action
expected_versionYesREQUIRED — the version the edits were authored against (from get_app)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
eotNo
nameNo
noteNo
sizeNo
reasonNo
appliedNo
createdNo
versionNo
prev_sizeNo
manifest_actionNo
expected_versionNo

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed2 schema fields changedv0.6.0
    • removedOutput schema / properties / prev_size / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / prev_size / type
      Added value: +[
      +  "number",
      +  "null"
      +]
  2. First observedv0.5.7

TDQS

A4.9/5.0
Behavior5/5

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

Beyond annotations, the description reveals important behaviors: edits apply atomically, range offsets address the expected_version document, string edits apply after ranges, and the #oma-manifest block is re-read on save. This adds meaningful context not visible in the annotations.

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?

The description is dense but every sentence earns its place: purpose, form definitions, ordering, overlap constraint, atomicity, and manifest behavior. It is front-loaded with the core distinction and uses compact, meaningful phrasing.

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?

Given the tool's complexity and the rich schema/output schema, the description covers the essential operational details: edit forms, constraints, ordering, atomicity, and expected_version source. Nothing critical for an agent to call it correctly 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?

The schema already covers most parameters (80%), so the baseline is 3, but the description adds value by explaining the RANGE and STRING forms, the exact-once matching rule for old_string, replace_all, and the relationship between offset/length/expect_hash and get_app output.

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 states a specific verb and resource: 'surgical edits to an app' without round-tripping the whole source. It clearly distinguishes itself from full-source alternatives like save_app and names the two edit forms, RANGE and STRING, with concrete semantics.

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?

It explicitly says when to use this tool (surgical edits, not full round-trip), how to choose between RANGE and STRING forms, and gives ordering constraints (string edits apply after ranges). It also references get_app for the expected_version and range hashes, providing clear operational guidance.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/2nd1st/open-mcp-apps'

If you have feedback or need assistance with the MCP directory API, please join our Discord server