Skip to main content
Glama

Edit hosted app source

edit_app_source
Destructive

Change some files of a hosted app without resending the rest, and put the result live as a new version. files adds or replaces files by path, with their full contents as text; delete_files removes paths, and a path the app does not have is ignored without an error, so take paths from get_app_source. Every other file is kept as it is in expected_version. expected_version must be the app's live head_version_number, from list_apps or list_app_versions: if the app changed since, the call fails with stale_app and the live number, so read the files again and redo the change. The result must still meet deploy_app's limits: an index.html, text files only, at most 50 files and 1 MB. Like a deploy, the change makes the app read the folder as you; if someone else deployed it last, signed-in visitors have to reload before their next change. The new files can take about a minute to be served. The previous version stays in the history (Playbook keeps the last 50), so revert_app can undo this. An app not deployed since Playbook began keeping versions has no stored files: the call fails with source_unavailable, and deploying its files once with deploy_app starts its history. Requires write scope and permission to edit the folder the app shows.

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": {
      "slug": "<slug>",
      "expected_version": "<expected_version>"
    },
    "name": "edit_app_source"
  }
}

Input Schema

NameRequiredDescriptionDefault
slugYesSlug of the app, from list_apps
filesNoFiles to add or replace: full contents as text, keyed by path, e.g. { "app.js": "…" }
commentNoA note stored with the new version, shown by list_app_versions
delete_filesNoPaths of files to remove
organizationNoWorkspace slug, as returned by list_organizations. Omit it when the account has a single workspace — it is then resolved from your token. Pass it only when the account has several, or when you mean a workspace other than the obvious one.
expected_versionYesThe app's live `head_version_number`, as you last read it

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already flag destructiveHint=true and openWorldHint=true, but the description adds substantial behavior beyond them: the optimistic-concurrency contract (expected_version must equal live head_version_number, else stale_app with the live number returned), the nonexistent-path-is-silently-ignored rule, the deploy_app limits (index.html required, text only, 50 files / 1 MB), ~1 minute propagation, 50-version history retention, and the `write` scope plus folder permission requirement. None of this is inferable from the annotations or schema.

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?

The core action and the primary risk (staleness) are front-loaded, and nearly every clause carries operational information. It is a single dense block rather than broken into the distinct concerns (edit semantics, concurrency, limits, propagation, permissions), which makes it slightly harder to scan for a complex mutation, but there is little genuine filler.

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 six-parameter destructive mutation with no output schema, the description covers what an agent needs before calling: required inputs and their sources, failure modes and how to recover from each, size and content constraints, side effects on visitors, and permission prerequisites. Nothing material about the call's correctness or consequences is left unstated.

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?

Schema coverage is 100%, so the schema already documents all six parameters and the baseline would be 3. The description goes beyond it by explaining conditional semantics the schema cannot express: `files` keys are paths and values are full contents (not patches), `delete_files` silently ignores absent paths, and `expected_version` is a concurrency token that fails rather than overwrites. It does not elaborate on `comment` or `organization`, but those are already fully described in the schema.

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 opening sentence gives a specific verb, resource, and scope: partial file edits plus publishing a new live version, explicitly 'without resending the rest.' It implicitly contrasts with deploy_app (full deploy) and get_app_source (read paths) by naming both in context, so an agent can tell this apart from a full redeploy without opening another schema.

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 routes the agent to the correct siblings at each decision point: take paths from get_app_source, take expected_version from list_apps or list_app_versions, use deploy_app to bootstrap history when source_unavailable fires, and revert_app to undo. It also states the failure conditions (stale_app, source_unavailable) that select the fallback path, which is exactly the when/when-not guidance an agent needs.

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