Skip to main content
Glama

Edit app source

edit_app
Idempotent

Apply targeted edits to an app without rewriting the whole source. Use range-based or string-based edits that apply atomically, ensuring consistency.

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
Behavior5/5

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

The description reveals atomicity ('All edits apply together, or nothing applies'), ordering ('string edits apply after ranges, in order'), constraints ('Range offsets... must not overlap'), and a post-save behavior ('#oma-manifest block is re-read'). These go far beyond the annotations and give agents a robust behavioral model.

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 a single dense paragraph, front-loaded with the core value proposition, and every sentence contributes actionable detail (edit forms, ordering, atomicity, manifest behavior). No fluff or repetition of schema.

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 tool with two edit modes, versioning requirements, and atomic application, the description covers the key operational rules: how to structure RANGE and STRING edits, their order, atomicity, version alignment, and the manifest re-read. The output schema handles return values, so no gap remains.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 80% schema coverage, the baseline is 3, but the description elevates it by explaining the two edit forms (RANGE vs STRING), which fields belong to which form, and how 'expect_hash' relates to get_app's output. It also clarifies the 'app' vs 'name' naming inconsistency, aiding correct invocation.

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 'Surgical edits to an app WITHOUT round-tripping the whole source,' clearly identifying the action (edits), target (app), and distinguishing it from full-source alternatives like save_app. It further details two edit forms, making the purpose unmistakable.

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 phrase 'WITHOUT round-tripping the whole source' implies use over save_app for targeted changes, and RANGE being called 'cheapest' provides selection guidance. It doesn't explicitly name sibling tools as alternatives or state when-not to use, so it falls short of a 5 but is clear enough for a 4.

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

Install Server

Other Tools

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