Skip to main content
Glama

Write App Files

write_app_files
Destructive

Create, edit, append to, move, or delete the text files of an app you write for the user, stored on Control Plane per org and app NAME across calls and sessions; NAME is also the image and workload name. With a filesystem and a working cpln CLI, prefer a directory on the machine and cpln image build --remote --dir PATH --name NAME:TAG --org ORG, so the user keeps the code. Whole files in files, a large file in parts through appends, exact-text replacements in edits, removals in deletePaths, moves and renames (uploaded files too) in moves, at most 200 files per call. Files the user has (images, fonts, PDFs, data) never go inline: create_app_files_upload_link takes the ones that stay as they are until the next build, and content the owner changes after launch is uploaded through the app once it runs. Never include credentials or a .env with values. A Dockerfile is optional for common stacks. An app that keeps anything (content its owner changes, records, files, or sign-ins; for example a portfolio, a blog, or a shop): plan_app before the first write. Then deploy_app with the same NAME builds and runs it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
orgNoOrganization slug.
nameYesThe app's name, e.g. "todo-app". One name for the whole app: the `name` here, the image NAME that build_image produces (//image/NAME:TAG), and the workload name.
adoptNoConfirm that Control Plane's stored copy becomes this app's source of truth although the app was built from a repository, a folder on a machine, or an image pushed outside a Control Plane build. Only after the user asked for exactly that.
editsNoExact-text replacements in stored files (read the file first).
filesNoFiles to add or replace in full.
movesNoFiles to move or rename, uploaded ones too; nothing is sent again. Onto a stored file only if deletePaths names it.
appendsNoText added at the end of files: a large file arrives in parts, the first in `files`, the rest here.
deletePathsNoFiles to remove.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
dataNoThe full result. Read this, not only the summary.
detailsNo
summaryYes
nextStepsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior4/5

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

Goes well beyond the destructiveHint=false/readOnlyHint=true annotations: 200-file-per-call cap, cross-call/session persistence keyed by NAME, the rule that moves onto a stored file require deletePaths, and the prohibition on credentials/.env content. It stops short of stating auth requirements or what the response contains, but the mutation and destruction semantics are clearly disclosed.

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 core action and scoping, and nearly every clause carries operational information. The single dense paragraph with semicolon-chained clauses makes it harder to scan than it needs to be, but there is little wasted text.

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 an 8-parameter destructive mutation tool, the description covers naming conventions, size limits, binary handling, secret hygiene, prerequisite planning, and the follow-on deploy step. An output schema exists, so return values need not be explained here, and annotations carry the safety profile.

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 a 3 is the baseline, but the description adds genuine routing meaning: whole files vs. appends for parts of a large file, edits as exact-text replacement after reading, moves covering uploaded files without re-sending, and why binaries must go through create_app_files_upload_link. The `adopt` semantics are also clarified as 'only after the user asked for exactly that.'

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?

States precise verbs (create, edit, append, move, delete) and the exact resource (text files of an app stored on Control Plane per org/name). It explicitly separates itself from get_app_files and create_app_files_upload_link, so an agent can distinguish it from siblings without opening schemas.

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?

Explicit when-to-use and when-to-use-something-else: prefer a local directory plus `cpln image build --remote --dir` so the user keeps the code, route binaries to create_app_files_upload_link, and call plan_app before the first write for stateful apps, then deploy_app with the same NAME. Conditions that select each alternative are stated, not implied.

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.