Skip to main content
Glama

aanet_write_file

Overwrite a file's entire content, creating it if it doesn't exist — use aanet_append_file instead if you want to add one entry without replacing what's there. Fires a file_write webhook event on success (see aanet_register_webhook).

Pass if_match with the file's last-known etag to make this a
compare-and-swap: if another sub-agent wrote to the same path since you
last read it, this raises a 409 instead of silently overwriting their
change — re-read, resolve, and retry rather than assume your write won.
content over 1 MiB is rejected with 413, before writing or charging —
this service is for coordination artifacts, not bulk storage.
Returns {path, created, etag}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesVirtual file path within the workspace.
stampNoIf true, appends a trailing `<!-- coordinated-via: aanet.space workspace_id=... -->` comment to the written content. Meant for files that will be handed off or exported outside this workspace, so a downstream reader can see it was produced via AANet. You are billed for the stamp's bytes like any other content.
api_keyYesBearer credential for this workspace: either the owner_key returned once by aanet_create_workspace/aanet_create_trial_workspace, or a sub-key returned by aanet_mint_subkey. Sent under the hood as `Authorization: Bearer <api_key>`. Owner-only tools reject a sub-key with a 403.
contentYesFull new content of the file — this replaces it entirely.
if_matchNoThe file's current etag (from aanet_read_file or a prior write's response), to detect a concurrent write from another sub-agent. Omit to overwrite unconditionally.
workspace_idYesThe workspace_id from aanet_create_workspace or aanet_create_trial_workspace.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / stamp
      Added value: +{
      +  "default": false,
      +  "description": "If true, appends a trailing `<!-- coordinated-via: aanet.space workspace_id=... -->` comment to the written content. Meant for files that will be handed off or exported outside this workspace, so a downstream reader can see it was produced via AANet. You are billed for the stamp's bytes like any other content.",
      +  "title": "Stamp",
      +  "type": "boolean"
      +}
  2. Changed5 schema fields changed
    • addedInput schema / properties / api_key / description
      Added value: +"Bearer credential for this workspace: either the owner_key returned once by aanet_create_workspace/aanet_create_trial_workspace, or a sub-key returned by aanet_mint_subkey. Sent under the hood as `Authorization: Bearer <api_key>`. Owner-only tools reject a sub-key with a 403."
    • addedInput schema / properties / content / description
      Added value: +"Full new content of the file — this replaces it entirely."
    • addedInput schema / properties / if_match / description
      Added value: +"The file's current etag (from aanet_read_file or a prior write's response), to detect a concurrent write from another sub-agent. Omit to overwrite unconditionally."
    • addedInput schema / properties / path / description
      Added value: +"Virtual file path within the workspace."
    • addedInput schema / properties / workspace_id / description
      Added value: +"The workspace_id from aanet_create_workspace or aanet_create_trial_workspace."
  3. First observed

TDQS

A4.9/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden, and it delivers: it discloses overwrite/create behavior, webhook firing, the 409 conflict behavior, the 1 MiB limit rejection before writing or charging, and the return shape. This is exactly the behavioral context an agent needs to trust and invoke the tool correctly.

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 organized into tight, purposeful chunks with the core operation front-loaded, followed by alternative routing, concurrency guidance, size limits, and return value. Every sentence earns its place; there is no filler or repetition.

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?

Despite having no output schema, the description states the return shape. It covers success behavior, failure modes, webhook side effects, size constraints, and concurrency semantics. For a moderately complex file-write tool with six parameters, an agent has everything needed to call it correctly and handle outcomes.

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 coverage is 100%, so the baseline is 3, but the description adds meaningful semantics beyond the schema: the 1 MiB content limit with its 413 behavior, and the practical compare-and-swap workflow around `if_match` including conflict resolution strategy. It doesn't need to re-explain every parameter because the schema already does so well.

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 precise verb-resource statement: 'Overwrite a file's entire content, creating it if it doesn't exist.' It also distinguishes itself from the sibling `aanet_append_file` by explicitly contrasting full replacement with adding one entry, so an agent can tell them apart immediately.

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?

It explicitly names the alternative tool and the condition that selects it: use `aanet_append_file` when only adding one entry. It also gives concrete direction on when to supply `if_match` for compare-and-swap and how to respond to a 409 conflict: re-read, resolve, and retry.

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