ToolAssay

Atomically write (or release) a key only if its current value equals `expected`

Atomically write (or release) a key only if its current value equals `expected` - the coordination primitive for distributed locks and optimistic concurrency across agents. Acquire a lock: expected=null + a value + ttlSeconds. Release it: expected=<your token> with no value (deletes on match). Update safely: expected=<old>, value=<new>. Returns whether it swapped and the current value.

Not tested: has real-world effectsour last check, 2026-09-24
0 of 0checks answered this week
n/amedian answer time
$0.001listed price per call
n/aprice it asked us

Paid test badge: not yet. The checks above are free: we call the tool without paying and read the payment request it sends back. The Verified badge needs paid calls whose answers match the promised output, and nobody can buy a badge.

Endpoint

POST https://agent402.tools/api/memory/cas

CategoryMarket data
Provider hostagent402.tools
Networkseip155:10, eip155:1329, eip155:137, eip155:143, eip155:42161, eip155:42220, eip155:43114, eip155:4663, eip155:8453
Payment schemesexact
Self-reported calls, 30 days7 from 3 payers (the provider's figure, not ours)

Our checks, last 30 days

We never call tools that send, buy, move money or file anything, not even without paying.

Example input (from the provider)

{
  "body": {
    "expected": null,
    "key": "locks/import",
    "ttlSeconds": 30,
    "value": "agent-7"
  },
  "bodyType": "json",
  "method": "POST",
  "type": "http"
}

Promised output schema (from the provider)

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "properties": {
    "input": {
      "additionalProperties": false,
      "properties": {
        "body": {
          "properties": {
            "expected": {
              "description": "Required current value to match (null or omitted = key absent/expired)"
            },
            "key": {
              "description": "Key to conditionally write",
              "type": "string"
            },
            "owner": {
              "description": "Optional 0x namespace (requires a readwrite grant)",
              "type": "string"
            },
            "ttlSeconds": {
              "description": "Optional TTL for the written value (lease for locks)",
              "type": "number"
            },
            "value": {
              "description": "New value to set on match; omit to DELETE on match (lock release)"
            }
          },
          "required": [
            "key"
          ]
        },
        "bodyType": {
          "enum": [
            "json",
            "form-data",
            "text"
          ],
          "type": "string"
        },
        "method": {
          "enum": [
            "POST"
          ],
          "type": "string"
        },
        "type": {
          "const": "http",
          "type": "string"
        }
      },
      "required": [
        "type",
        "method",
        "bodyType",
        "body"
      ],
      "type": "object"
    },
    "output": {
      "properties": {
        "example": {
          "properties": {
            "expiresAt": {
              "type": "integer"
            },
            "key": {
              "type": "string"
            },
            "owner": {
              "type": "string"
            },
            "swapped": {
              "type": "boolean"
            },
            "value": {
              "type": "string"
            }
          },
          "required": [
            "key",
            "swapped",
            "value",
            "owner",
            "expiresAt"
          ],
          "type": "object"
        },
        "type": {
          "type": "string"
        }
      },
      "required": [
        "type"
      ],
      "type": "object"
    }
  },
  "required": [
    "input"
  ],
  "type": "object"
}

This page as JSON