Skip to main content
Glama

scratchpad_lock

Acquires an advisory distributed mutex lock to prevent multi-agent race conditions. Returns acquisition status, with auto-expiry to avoid permanent deadlocks.

Instructions

    [Cost: $0.0005 USDC on Base & Solana] Acquires an advisory distributed mutex lock to prevent multi-agent race conditions.
    Returns {'acquired': true, ...} on success, or {'acquired': false, 'error': ...} if held by another agent.
    Locks automatically expire after ttl_seconds (default 60s, max 600s) to prevent permanent deadlocks if the holder terminates.

    Args:
        lock_name: Unique resource identifier to lock (e.g., 'arbitrage/pool-weth-usdc').
        owner_id: Identifier of the agent claiming the lock (e.g., 'agent-worker-1').
        ttl_seconds: Maximum duration in seconds to hold lock before auto-release (default: 60, max: 600).
        payment_signature: Optional x402 Base USDC transaction hash or developer mock key.
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
owner_idYes
lock_nameYes
ttl_secondsNo
payment_signatureNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.3.0

TDQS

A4.8/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. It discloses the cost, return shapes for both success and failure, auto-expiration behavior with configurable TTL, and the optional payment signature. This goes beyond basic purpose and provides actionable behavioral expectations.

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 well-structured: cost, purpose, return behavior, expiry, then parameter explanations. Every sentence adds necessary information, and the parameter list is formatted clearly. No fluff or redundancy.

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 there is no output schema and no annotations, the description covers all key aspects: what the tool does, when to use it, what parameters mean, what the return values look like, and failure modes. For a locking tool, this is complete enough for an agent to invoke it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must explain each parameter. It provides meaningful semantics for all four: lock_name as unique resource identifier with example, owner_id as agent identifier with example, ttl_seconds with defaults and max, and payment_signature explaining it is optional and what format it takes. This fully compensates for the schema's lack of descriptions.

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 clearly states the tool acquires an advisory distributed mutex lock to prevent multi-agent race conditions. It uses a specific verb (acquires), specific resource (distributed mutex lock), and the examples and return shape make it distinct from sibling tools like scratchpad_set/get/unlock.

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?

The description gives a clear context for when to use the tool: to prevent multi-agent race conditions. It implies mutual exclusion is needed, but does not explicitly mention when not to use it or alternatives like scratchpad_unlock for releasing. The context is strong, but exclusions are absent.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.