Skip to main content
Glama
Cohexa-ai

Agent Coherence — Stale Write Guard (FS)

Official

swg_write

Writes a workspace text file, denying if the file changed since last read, preventing silent overwrites by stale agents on a single host.

Instructions

Write a workspace text file (acquire -> write -> commit). DENIED with reason=stale_view if the file changed since you read it — a peer commit OR an out-of-band edit (another tool/editor): recover with swg_reacquire, then write FROM its bytes. A mid-write preempt returns reason=commit_preempted (disk may hold un-versioned bytes; reacquire_and_reconcile). SINGLE-HOST only. Out of guarantee and NOT detected in v1: writers on different hosts or across a synced/network mount, divergent-history reconciliation, semantic correctness, server-enforced auto-merge.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
contentYes
Behavior5/5

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

Annotations indicate readOnlyHint=false, so no contradiction. Description details stale view detection, preemption, single-host limitation, and v1 limitations. Adds significant behavioral context beyond annotations.

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?

Lengthy but efficient; every sentence adds value. Front-loaded with core action, then details. Not overly verbose given complexity.

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?

Fully explains error conditions, recovery procedures, limitations (single-host, no auto-merge). No output schema, but return values are implicitly clear from context. No gaps for agent invocation.

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 0%, requiring description to compensate. Description implies 'path' and 'content' via 'file' and 'bytes', but does not explicitly describe them. Since parameters are simple and purpose is clear, minimal but adequate.

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?

Clearly states 'Write a workspace text file' with specific workflow (acquire->write->commit). Distinguishes from siblings like swg_write_cas and mentions recovery tools.

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?

Explicitly says when to use (after acquire, before commit), when not (stale view, preempted), and recovery steps with alternative tools (swg_reacquire, reacquire_and_reconcile).

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/Cohexa-ai/agent-coherence'

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