Skip to main content
Glama

fence_prepare

Reserve a side-effecting tool call to prevent duplicate executions. Pass a stable intent; if the action already ran, replay its recorded result instead of rerunning it.

Instructions

Ask permission to run a side-effecting tool call. intent is a stable id for the logical action (e.g. charge:order-123) -- attempts sharing an intent are the SAME action and only one will ever execute. Returns {status:'fresh', prepared} when this attempt wins (run the tool, then call fence_commit or fence_abort with the ticket), or {status:'already_done', cert} when this exact action already ran (use the recorded result; do NOT run the tool). Errors mean do not run: another attempt is in flight, a previous attempt failed (reconcile first), a dependency changed (ReadSetStale), or a same-instant race was lost (DomainRace).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
argsNoArbitrary JSON arguments for the tool call being fenced.
toolYesName of the tool/effect being fenced, e.g. `"charge_card"`.
agentYesIdentifier of the calling agent.
domainYesThe contention scope this effect will act on, e.g. `"order:123"`.
intentYesStable identifier for the logical action, e.g. `"charge:order-123"`. Attempts sharing an intent are the SAME action: only one ever executes; later attempts get the recorded outcome replayed. Mint a new intent only for a genuinely new action.
parentNoHex SHA-256 hash of the effect certificate this one causally follows. Omit for a genesis effect with no prior cause.
read_setNoOther domains this decision cross-checked, and the sequence observed for each. Do not include `domain` itself here — its own sequence is about to be advanced by the reservation, so an entry for it would go stale the instant that happens. Same-domain lineage belongs in `parent`.
known_clockNoThe calling agent's current view of causal history.
Behavior5/5

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

No annotations are provided, so the description carries full burden. It discloses idempotency semantics, single-execution guarantees, replay behavior, and four distinct failure modes. This is exactly the behavioral context needed for a fencing primitive.

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?

Three focused sentences covering purpose, return states, and error handling. No filler; every clause serves a decision the agent must make.

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?

Given the tool's complexity, the description fully captures usage protocol, including consequences for each outcome and required follow-up actions (fence_commit/fence_abort). Output schema absent, but return values are described in prose.

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 covers all 8 parameters with descriptions (100% coverage), so baseline 3 applies. Description reinforces intent's stable-id semantics but doesn't add new parameter-specific detail beyond schema; the protocol context (fresh/already_done) supplies useful surrounding semantics but not per-parameter meaning.

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?

Description uses a specific verb ('Ask permission') and identifies the resource (side-effecting tool call execution). It clearly differentiates from sibling tools fence_commit/fence_abort by framing this as the preparation/reservation step.

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?

Description explicitly specifies action based on return: on fresh, run then call fence_commit/fence_abort; on already_done, do NOT run; on errors, do not run and reconcile. It names error types for further guidance, making it superior for an agent to decide when to use this tool.

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/aurumflux20/effectfence'

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