Skip to main content
Glama

Local Commander

Write file

fs_write
DestructiveIdempotent

Use this when the user asks to create a file or replace a file's whole text in an approved project. Changes files on the computer. Needs the sessionId from execution_session_open and a new operationId; each call is metered as one execution. A short result is returned inline within about two seconds; otherwise keep the returned IDs for operation_status and operation_output and do not resend the call.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesFile path relative to the selected project root (or the workspace root without a project target).
contentYesThe complete new file text, up to 1 MiB UTF-8
overwriteNoSet true to replace an existing file (default false)
sessionIdYesexecutionSessionId returned by execution_session_open
deadlineAtNoOptional UTC admission deadline at most 60 seconds ahead (queue start timeout, NOT process execution lifetime)
operationIdYesA new random UUID v4 for this call; reuse it only to retry this same call
expectedSha256NoSHA-256 of the current file; the write is refused if the file changed (optional)
idempotencyKeyNoOptional retry key, 8-128 chars of [A-Za-z0-9._:-]; defaults to operationId
efficiencyProfileNoOptional, unverified label of the client's model, recorded as display metadata in the device owner's local activity statistics. Omit when unknown. Never send credentials or conversation content.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, idempotentHint=true and openWorldHint=false, so the safety profile is covered. The description goes beyond them with genuinely useful operational context: the execution_session_open dependency, per-call metering, the ~2s inline-result window, and the instruction to poll operation_status/operation_output rather than resend.

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?

Four sentences, front-loaded with the use case, then prerequisites, then the async/return contract. 'Changes files on the computer' is mildly redundant with the destructive annotation but is short and reads as plain-language clarification rather than filler.

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?

For a 9-parameter mutation tool with a nested object and no output schema, the description covers the essentials an agent needs: the required session, the fresh operationId per call, metering, and the fallback polling path when the result is not returned inline. It omits error/refusal semantics (e.g. the expectedSha256 conflict and overwrite guard), which are only visible in the schema.

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 coverage is 100% across 9 params, so the schema already documents overwrite, expectedSha256, deadlineAt, idempotencyKey and efficiencyProfile with real semantics. The description only reinforces sessionId/operationId and their retry relationship, so the baseline 3 applies.

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?

The description states a specific verb and resource ('create a file or replace a file's whole text') and uses 'whole text' to implicitly delimit itself from the partial-edit sibling fs_replace. It stops short of naming that sibling, so the distinction must still be inferred.

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?

'Use this when the user asks to create a file or replace a file's whole text in an approved project' gives a clear triggering condition and scopes it to approved projects/workspace roots. It does not explicitly state when to prefer fs_replace or what to do when no session is open.

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.

Resources