Skip to main content
Glama
jansc4
by jansc4

Write file

files_write_file
DestructiveIdempotent

Writes text content to a file, overwriting or appending. Creates parent folders automatically and requires explicit confirmation.

Instructions

Writes text to a file. mode='overwrite' replaces the whole file (creating it if missing); mode='append' adds to the end. Requires confirm='EXECUTE'. Creates the parent folder if missing. path and content are separate arguments (not one dict like db_execute's params) so a for_each step can omit item_arg and spread a list of {"path": ..., "content": ...} dicts directly as calls to this.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNooverwrite
pathYes
confirmYes
contentYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior1/5

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

The description correctly and helpfully reveals destructive behavior (overwrite replaces the whole file), the confirmation requirement, and parent-folder creation. However, it explicitly describes mode='append' as adding to the end, which is not idempotent, while the annotations declare idempotentHint=true. This is an annotation contradiction that can mislead an agent into retrying a call and duplicating content.

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 and well-ordered: purpose first, then behavioral details, then a useful orchestration note. Each sentence adds information, and there is no filler or repetition of schema fields.

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?

Coverage of all parameters and effects is strong, and the output schema handles return-value details. The only notable contextual deficiency is the conflicting idempotentHint, which raises ambiguity about safe retry behavior; otherwise the description leaves little unexplained.

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 description coverage is 0%, so the description must carry the burden—and it largely does. It explains the meaning of mode, the exact required value for confirm, and the path/content separation. It does not detail path formatting or encoding constraints, but those are unlikely to be essential for 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 a specific verb and resource: 'Writes text to a file.' It then clarifies the two modes (overwrite/append) and even differentiates its argument style from db_execute's dict-style params, making the tool's purpose and identity unambiguous.

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?

It gives concrete usage guidance: when to use overwrite vs append, that confirm='EXECUTE' is required, and that parent folders are created automatically. It also explains the for_each pattern, though it does not explicitly name alternative file-writing tools or state when not to use this tool.

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