Skip to main content
Glama

Write files

write_files
DestructiveIdempotent

Atomically write or overwrite files in a test workspace, creating parent directories as needed. Ensures all-or-nothing updates, keeping paths relative to workspace.

Instructions

Writes or overwrites files in an existing workspace, creating parent directories as needed. Paths must be relative and stay inside the workspace. Either every file is written or none is.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filesYesMap of workspace-relative path to file contents, e.g. {"src/index.js": "..."}
workspaceIdYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
filesWrittenYes
Behavior4/5

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

Annotations already declare destructiveHint and idempotentHint; the description adds valuable context: parent-directory creation, path safety (relative and inside workspace), and atomic all-or-nothing behavior. It does not contradict annotations and improves transparency beyond the structured hints.

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 compact (three sentences) and front-loaded with the main action. Each sentence serves a distinct purpose: basic behavior, path constraints, and atomicity. There is no redundancy or fluff.

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 has an output schema and annotations, the description covers the essential context: purpose, workspace requirement, path safety, and atomicity. It is complete for a 2-parameter write tool and does not need to explain return values.

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 covers the 'files' parameter with a good example, but 'workspaceId' has no schema description. The description compensates by implying workspaceId must reference an existing workspace and by adding constraints on the file paths (relative, inside workspace). This adds meaning beyond the raw 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 description clearly states the verb and resource: writes/overwrites files in an existing workspace. It distinguishes itself from siblings (read_workspace, create_workspace, run_tests, destroy_workspace) by focusing on file-level mutations rather than workspace lifecycle or read operations.

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 description gives clear context (existing workspace, relative path constraints, atomicity) and implies when to use it (writing files), but it does not explicitly name alternatives or contrast with sibling tools. This is clear context without exclusions.

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/anthonys1760/mcp-testbed'

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