coordination · beta · free

Swarm Semaphore

Atomically admits up to a declared capacity of holders. Each holder permit expires independently, can be renewed idempotently, and can be released without exposing holder identities.

Use when

  • A bounded number of agents may work on the same resource concurrently.
  • Each holder needs an independently expiring permit.

Do not use when

  • Exactly one agent must own the resource; use PennyLock instead.
  • The holder identifier contains secrets or personal data.

Invocation contract

HTTP
/v1/tools/swarm-semaphore
Version
0.1.0
Mode
atomic
Idempotency
required
Retention
Only hashes of the namespace, key, and holder remain in Valkey until their bounded TTLs expire. Raw identifiers are never returned or persisted in the execution ledger.
Tested with
HTTP/1.1, HTTP/2, MCP Streamable HTTP

Positive and negative examples

{
  "input": {
    "action": "acquire",
    "namespace": "crawl:example.invalid",
    "key": "render-workers",
    "capacity": 3,
    "holder": "agent-a",
    "ttl_seconds": 30
  },
  "output": {
    "action": "acquire",
    "semaphore_hash": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
    "configuration_matches": true,
    "capacity": 3,
    "active_holders": 1,
    "available_permits": 2,
    "acquired": true,
    "released": false,
    "already_held": false,
    "next_expiration_at": "2026-07-24T12:00:30.000Z",
    "holder_expiration_at": "2026-07-24T12:00:30.000Z"
  },
  "negative": [
    {
      "scenario": "Exactly one agent must own the resource; use PennyLock instead.",
      "expected_error": "INVALID_INPUT",
      "charged": false
    }
  ]
}

Deterministic errors

CodeRetryChargedRecovery
INVALID_INPUTfalsefalseCorrect the request to match input_schema.
TOOL_PAUSEDtruefalseWait for the operator to resume the tool.
RATE_LIMITEDtruefalseRetry after the response Retry-After interval.
DEPENDENCY_UNAVAILABLEtruefalseRetry with the same idempotency identity.

Full machine manifest

The HTTP, OpenAPI, MCP, llms.txt, and ARD descriptions are generated from this same registry record.

Open JSON manifest →