Skip to main content
Glama

write_file

DestructiveIdempotent

Write or overwrite a project file in specified valid directories: public/, api/, api/_lib, migrations/, seed.sql, hatchable.toml, or package.json. Paths are relative to the project root. Content is saved but not live until the project is deployed.

Instructions

Write or overwrite a project file. Paths are relative to the project root.

Valid locations: public/** static files (HTML, CSS, JS, images, etc.) api/.js backend functions (each file is one endpoint) api/_lib/ shared helpers imported by api/ files, not routed migrations/*.sql database migrations, run in filename order seed.sql optional seed data, runs once on fresh installs hatchable.toml optional config overrides package.json dependencies (no build script yet)

Files are stored but not live until you call deploy.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYesProject ID (e.g. proj_a8Kq7fR2xZ)
pathYesFile path relative to project root. Must be under public/, api/, migrations/, or one of: seed.sql, hatchable.toml, package.json
contentYesFile content
Behavior4/5

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

The description complements the destructiveHint annotation by explaining that files are overwritten (not appended) and stored awaiting deployment. While the annotation already indicates destructive behavior, the description adds context about the deployment dependency and valid path constraints. However, it could be more transparent about whether previous versions are kept or overwritten entirely.

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 description is concise, with a clear first sentence that states the purpose, followed by a structured list of valid locations. The final note about deployment is efficient. Minor inefficiency: the bullet list could be more concise, but it's still well-organized and front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given that the tool has no output schema and only moderate complexity, the description adequately explains what the tool does, where files can be written, and the deployment dependency. It misses details about file size limits, encoding, or what happens on success/failure, but these are covered by the schema's implicit completeness. Overall, it provides enough context for an AI agent to use the tool correctly.

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?

The input schema covers all parameters with descriptions, so the schema description coverage is 100%. The description adds meaning by explaining path conventions (relative to project root) and valid path structures, but it does not detail the content parameter beyond 'File content'. With full schema coverage, a baseline of 3 is appropriate, and the description does not significantly augment parameter semantics.

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 starts with a clear verb ('Write or overwrite') and resource ('project file'), immediately establishing the tool's action and target. It distinguishes itself from siblings like 'patch_file' by indicating it overwrites, and from 'upload_file' and 'import_file_from_url' which handle external files. The detailed path breakdown effectively scopes the tool to specific project directories.

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?

The description explicitly lists valid locations and file types, providing clear guidance on where files can be written. It also states that files are stored but not live until 'deploy' is called, which is a crucial usage hint. This differentiates it from deployment-related tools and sets expectations about the lifecycle, which is excellent guidance.

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/Woobox/hatchable-mcp'

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