Skip to main content
Glama
Cohexa-ai

Agent Coherence — Stale Write Guard (FS)

Official

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
SWG_ROOTNoRoot directory of the workspace to guard. Defaults to the current working directory.(current working directory)
SWG_MANAGEDNoComma-separated list of glob patterns to narrow which files are managed. If not set, the whole workspace is guarded.

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
swg_readA

Read a workspace text file under coherence tracking. Returns {content, version}; the version is the comparand you pass to swg_write_cas. A sticky-INVALID view returns fresh bytes but stays INVALID — use swg_reacquire to recover before writing. 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.

swg_writeA

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.

swg_reacquireA

Recover from a stale_view deny: re-mint identity and return the CURRENT bytes. You MUST write FROM these exact bytes — the server enforces version lineage, NOT that your content was derived from what you read. 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.

swg_statusA

Report coherence state: coordinator on|off|unknown (unknown is NOT off), per-path enforced|not_registered, is_attached/is_degraded/session_id, and heterogeneous_scope_detectable=false (a multi-host or differently-scoped setup is NOT distinguishable in v1). 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.

swg_write_casA

Concurrent same-key write via compare-and-set. You read (swg_read returns the version comparand; swg_reacquire does NOT — it is for swg_write recovery), MERGE, then call swg_write_cas(path, expected_version, new_content). Stale-write-rejected: if a peer committed since your read, the CAS is a TYPED CONFLICT (reason=version_mismatch, current_version returned) — NOT an auto-merge; re-read at current_version, re-merge, and retry. The per-session conflict counter bounds only a COOPERATING agent (one session, stops on retryable=false); it is NOT livelock-proof against a fresh session or one that ignores retryable=false. 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.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

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