Skip to main content
Glama
sangingeum
by sangingeum

file_create

Destructive

Create a text file atomically with overwrite guards and undo support, making workspace file creation reversible and protected by policy checks.

Instructions

Create a new text file and return operation_id and undo_available.

    Fails with ALREADY_EXISTS while expected_absent is true (the safe
    default); set it false to overwrite an existing file, which makes the
    call destructive. Writes are atomic. Credential-shaped targets are
    refused with SENSITIVE_PATH_REFUSED unless i_accept_secret_write_risk is
    true, which records a warning and is itself undoable. dry_run validates
    every guard and writes nothing, returning operation_id null. Otherwise
    the operation is recorded and undoable.
    

Input Schema

NameRequiredDescriptionDefault
pathYes
contentYes
dry_runNo
encodingNoutf-8
expected_absentNo
i_accept_secret_write_riskNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.8

TDQS

A4.1/5.0
Behavior5/5

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

Goes well past the annotations by disclosing atomic writes, exact error codes (ALREADY_EXISTS, SENSITIVE_PATH_REFUSED), the undo model (operation is recorded and undoable, dry_run returns operation_id null), and the warning-recording side effect of the secret-write flag. The description's "makes the call destructive" is consistent with destructiveHint=true, and nothing is contradicted.

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-loads the action and return values, then layers guards in priority order. Dense and mostly waste-free, though the long compound sentences around the secret-write flag could be split for faster scanning.

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?

With no output schema, the description does the right thing by naming return fields (operation_id, undo_available) and the failure modes. The one real gap is encoding, an entirely undocumented parameter on a tool whose whole job is writing text.

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?

Schema description coverage is 0%, so the description carries the full burden, and it only explains three of six parameters (expected_absent, i_accept_secret_write_risk, dry_run). path and content are left to their bare titles, and encoding is never mentioned at all, so compensation is partial.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ("Create a new text file") and immediately names what it returns. The expected_absent guard implicitly separates it from the sibling file_write, but the description never names that alternative, so an agent must infer the boundary rather than read it.

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?

Gives explicit conditional guidance: default fails on existing file, set expected_absent=false to overwrite, use dry_run to validate without writing, use i_accept_secret_write_risk only for credential-shaped targets. This is strong when-to-use coverage, but it stops short of routing the agent toward file_write or file_apply_patch for related editing tasks.

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