{"ok":true,"tool":"exactly-once-baton","module_version":"0.1.0","result":{"slug":"exactly-once-baton","name":"Exactly-Once Baton","version":"0.1.0","category":"coordination","status":"beta","mode":"atomic","summary":"Issue and atomically consume a one-use capability token.","description":"Issue an unguessable short-lived baton, pass it to one agent, then consume it exactly once. Only a derived token hash is stored; batons cannot be listed or recovered.","when_to_use":["A coordinator must issue a capability that can be consumed once.","Multiple agents may race to claim the same bounded action."],"do_not_use_when":["A database transaction can directly protect the underlying operation.","The capability must be reusable."],"tested_with":["HTTP/1.1","HTTP/2","MCP Streamable HTTP"],"input_schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"operation":{"type":"string","const":"issue"},"namespace":{"type":"string","minLength":1,"maxLength":80,"pattern":"^[a-zA-Z0-9._:-]+$"},"ttl_seconds":{"type":"integer","minimum":60,"maximum":86400}},"required":["operation","namespace","ttl_seconds"],"additionalProperties":false},{"type":"object","properties":{"operation":{"type":"string","const":"consume"},"namespace":{"type":"string","minLength":1,"maxLength":80,"pattern":"^[a-zA-Z0-9._:-]+$"},"baton":{"type":"string","pattern":"^eob_[A-Za-z0-9_-]{43}$"}},"required":["operation","namespace","baton"],"additionalProperties":false}]},"output_schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"operation":{"type":"string","const":"issue"},"baton":{"type":"string"},"baton_hash":{"type":"string"},"issued_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["operation","baton","baton_hash","issued_at","expires_at"],"additionalProperties":false},{"type":"object","properties":{"operation":{"type":"string","const":"consume"},"baton_hash":{"type":"string"},"consumed":{"type":"boolean"},"issued_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"ttl_seconds_remaining":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["operation","baton_hash","consumed","issued_at","ttl_seconds_remaining"],"additionalProperties":false}]},"payment":{"kind":"free"},"side_effects":["Issue creates a temporary one-use token.","Consume irreversibly invalidates a valid token."],"retention":"Only a SHA-256-derived baton key and issue timestamp remain in Valkey until consumption or expiry. Issued token values appear only in the replay-protected result.","limits":{"min_ttl_seconds":60,"max_ttl_seconds":86400,"token_entropy_bits":256,"max_client_requests_per_minute":30,"max_global_requests_per_minute":120},"examples":{"input":{"operation":"issue","namespace":"workflow","ttl_seconds":600},"output":{"operation":"issue","baton":"eob_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","baton_hash":"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc","issued_at":"2026-07-24T12:00:00.000Z","expires_at":"2026-07-24T12:10:00.000Z"},"negative":[{"scenario":"A database transaction can directly protect the underlying operation.","expected_error":"INVALID_INPUT","charged":false}]},"execution":{"errors":[{"code":"INVALID_INPUT","retryable":false,"charged":false,"recovery":"Correct the request to match input_schema."},{"code":"TOOL_PAUSED","retryable":true,"charged":false,"recovery":"Wait for the operator to resume the tool."},{"code":"RATE_LIMITED","retryable":true,"charged":false,"recovery":"Retry after the response Retry-After interval."},{"code":"DEPENDENCY_UNAVAILABLE","retryable":true,"charged":false,"recovery":"Retry with the same idempotency identity."}],"idempotency":{"required":true,"mock_or_unpaid_header":"Idempotency-Key","x402_extension":null,"replay_retention":"up to 24 hours"}},"endpoints":{"describe":"/v1/tools/exactly-once-baton","execute":"/v1/tools/exactly-once-baton"}},"meta":{"request_id":"req_f58aa3a9b60b4e90b86cae0916ed924c","observed_at":"2026-07-24T23:32:07.028Z"}}