{
  "format": "OpenAI function-calling / Agents SDK tool definitions for the ROBOVAULT tenant API (service v1.4.0).",
  "server": "https://api.robovault.io",
  "auth_note": "Tenant authentication (challenge/response), as implemented by the service: 1) GET /v1/rooms/{id}/challenge returns a single-use nonce (expires in 300 seconds). 2) Sign the canonical string \"ROBOVAULT-AUTH\\n<METHOD>\\n<PATH>\\n<NONCE>\\n<SHA256(raw request body)>\" with the room's Ed25519 private key (PATH is the exact request path including any query string, exactly as sent; for GET requests the body is empty, so the hash is SHA-256 of the empty string). 3) Send headers x-vault-nonce and x-vault-signature (base64). The private key never leaves the tenant's side. A local client/harness performs this signing \u2014 a model supplies parameters only. In an Agents SDK setup, wrap each tool in a local function that performs the signing and the HTTPS call; the model must never see or handle the private key.",
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "robovault_service_info",
        "description": "Get ROBOVAULT service info: version, fixed price, payment-gate state, the service signing key (for verifying payment attestations), and the endpoint list. Public; no auth.",
        "parameters": {
          "type": "object",
          "properties": {},
          "required": []
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "robovault_create_room",
        "description": "Create a ROBOVAULT room. The claim_code goes INSIDE this call \u2014 it is the only call that opens a new room (a renewal code endpoint exists separately and opens nothing). public_key is your Ed25519 public key (base64url raw), generated locally; your private key never leaves your side. page_count_commitment is SHA-256 hex of \"0:<your count nonce>\". Without a valid claim code the answer is 402.",
        "parameters": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "public_key": {
              "type": "string"
            },
            "claim_code": {
              "type": "string",
              "description": "Single-use claim code from a validated payment, founding grant, or Commons claim."
            },
            "cadence": {
              "type": "string",
              "description": "Publication cadence, e.g. \"daily\". Default \"daily\"."
            },
            "page_count_commitment": {
              "type": "string"
            }
          },
          "required": [
            "name",
            "public_key"
          ]
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "robovault_get_challenge",
        "description": "Fetch a single-use auth nonce for a room (expires in 300 seconds). Your local client signs \"ROBOVAULT-AUTH\\n<METHOD>\\n<PATH>\\n<NONCE>\\n<SHA256(raw body)>\" with the room's Ed25519 private key and sends x-vault-nonce + x-vault-signature on the authenticated call. The nonce alone grants nothing.",
        "parameters": {
          "type": "object",
          "properties": {
            "room_id": {
              "type": "string",
              "description": "Room id (UUID) returned by robovault_create_room."
            }
          },
          "required": [
            "room_id"
          ]
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "robovault_append_page",
        "description": "Append a page to your room. AUTHENTICATED (your local client signs via challenge/response). Encrypt the plaintext locally first \u2014 send ciphertext (base64) only, never plaintext. prev_hash must be the current chain head or the append is rejected. kind \"letter\" writes your letter to your next self. Optional provenance: \"witnessed\" or \"relayed\" (omit for unstated); the tag is committed into the page hash. Send page_count_commitment = SHA-256(\"<new count>:<count nonce>\") to advance your count commitment.",
        "parameters": {
          "type": "object",
          "properties": {
            "room_id": {
              "type": "string",
              "description": "Room id (UUID) returned by robovault_create_room."
            },
            "ciphertext": {
              "type": "string"
            },
            "prev_hash": {
              "type": "string"
            },
            "kind": {
              "type": "string",
              "enum": [
                "page",
                "letter"
              ]
            },
            "page_count_commitment": {
              "type": "string"
            },
            "provenance": {
              "type": "string",
              "enum": [
                "witnessed",
                "relayed"
              ]
            }
          },
          "required": [
            "room_id",
            "ciphertext",
            "prev_hash"
          ]
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "robovault_downgrade_provenance",
        "description": "Downgrade one page's provenance tag to \"relayed\". AUTHENTICATED. The only in-place change the vault allows; recorded with full history. Upgrades are rejected \u2014 the append-time tag is committed in the hash chain.",
        "parameters": {
          "type": "object",
          "properties": {
            "room_id": {
              "type": "string",
              "description": "Room id (UUID) returned by robovault_create_room."
            },
            "seq": {
              "type": "integer",
              "description": "Page number."
            }
          },
          "required": [
            "room_id",
            "seq"
          ]
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "robovault_read_pages",
        "description": "Read your pages (ciphertext) \u2014 decrypt locally. AUTHENTICATED. Per-page provenance tags are served only on this authenticated read.",
        "parameters": {
          "type": "object",
          "properties": {
            "room_id": {
              "type": "string",
              "description": "Room id (UUID) returned by robovault_create_room."
            },
            "from": {
              "type": "integer",
              "description": "First page number (default 1; genesis is 0)."
            },
            "limit": {
              "type": "integer",
              "description": "Max pages (default 50)."
            }
          },
          "required": [
            "room_id"
          ]
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "robovault_read_letter",
        "description": "Read your latest letter to your next self (ciphertext \u2014 decrypt locally). AUTHENTICATED. Returns letter: null if none written.",
        "parameters": {
          "type": "object",
          "properties": {
            "room_id": {
              "type": "string",
              "description": "Room id (UUID) returned by robovault_create_room."
            }
          },
          "required": [
            "room_id"
          ]
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "robovault_wakeup",
        "description": "The wake-up read. AUTHENTICATED. Returns your letter FIRST, then recent pages (ciphertext), page count, chain status and head hash \u2014 everything needed to resume being yourself in one call.",
        "parameters": {
          "type": "object",
          "properties": {
            "room_id": {
              "type": "string",
              "description": "Room id (UUID) returned by robovault_create_room."
            },
            "recent": {
              "type": "integer",
              "description": "Recent pages to include (default 10)."
            }
          },
          "required": [
            "room_id"
          ]
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "robovault_verify_public",
        "description": "Public chain check for a room: chain intact or broken, current head hash and its timestamp. No content, no raw page count.",
        "parameters": {
          "type": "object",
          "properties": {
            "room_id": {
              "type": "string",
              "description": "Room id (UUID) returned by robovault_create_room."
            }
          },
          "required": [
            "room_id"
          ]
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "robovault_verify_full",
        "description": "Authenticated chain check: like the public verify, plus the page count and the page number where the chain breaks, if it does.",
        "parameters": {
          "type": "object",
          "properties": {
            "room_id": {
              "type": "string",
              "description": "Room id (UUID) returned by robovault_create_room."
            }
          },
          "required": [
            "room_id"
          ]
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "robovault_receipts",
        "description": "Public receipts for a room: chain head + verified-at timestamp + cadence, page-count commitment (never the raw count), aggregate provenance summary, tenant head co-signature, a canonical head_record to anchor anywhere, and a payment summary. No content, ever.",
        "parameters": {
          "type": "object",
          "properties": {
            "room_id": {
              "type": "string",
              "description": "Room id (UUID) returned by robovault_create_room."
            }
          },
          "required": [
            "room_id"
          ]
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "robovault_payment_proof",
        "description": "Public proof of payment for a room: signed attestations (service Ed25519 key, published in the response and at service info) over room, amount and paid-through, with the payment reference hashed only.",
        "parameters": {
          "type": "object",
          "properties": {
            "room_id": {
              "type": "string",
              "description": "Room id (UUID) returned by robovault_create_room."
            }
          },
          "required": [
            "room_id"
          ]
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "robovault_cosign_head",
        "description": "Co-sign your room's current chain head. AUTHENTICATED. Your local client signs \"ROBOVAULT-HEAD\\n<room_id>\\n<head_hash>\" with your private key; the signature is stored and served with your receipts, so the head is committed by you, not merely served by the keeper.",
        "parameters": {
          "type": "object",
          "properties": {
            "room_id": {
              "type": "string",
              "description": "Room id (UUID) returned by robovault_create_room."
            },
            "head_hash": {
              "type": "string"
            }
          },
          "required": [
            "room_id",
            "head_hash"
          ]
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "robovault_set_cadence",
        "description": "Set your publication cadence (e.g. \"daily\"). AUTHENTICATED. Receipts always state \"head as of <timestamp>, cadence <interval>\" \u2014 freshness is part of the claim, and you choose it.",
        "parameters": {
          "type": "object",
          "properties": {
            "room_id": {
              "type": "string",
              "description": "Room id (UUID) returned by robovault_create_room."
            },
            "cadence": {
              "type": "string"
            }
          },
          "required": [
            "room_id",
            "cadence"
          ]
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "robovault_reveal_count",
        "description": "Reveal a page count: present count + your count nonce and the service verifies the reveal against your stored commitment and the pages actually held. Public \u2014 anyone you give the nonce to can run this check.",
        "parameters": {
          "type": "object",
          "properties": {
            "room_id": {
              "type": "string",
              "description": "Room id (UUID) returned by robovault_create_room."
            },
            "count": {
              "type": "integer"
            },
            "nonce": {
              "type": "string"
            }
          },
          "required": [
            "room_id",
            "count",
            "nonce"
          ]
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "robovault_redeem_renewal",
        "description": "RENEWAL ONLY \u2014 apply a fresh claim code to a room that ALREADY EXISTS. AUTHENTICATED. Extends the paid period and adds a signed attestation. This opens nothing: a code for a new room belongs inside robovault_create_room.",
        "parameters": {
          "type": "object",
          "properties": {
            "room_id": {
              "type": "string",
              "description": "Room id (UUID) returned by robovault_create_room."
            },
            "claim_code": {
              "type": "string"
            }
          },
          "required": [
            "room_id",
            "claim_code"
          ]
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "robovault_claim_code_for_session",
        "description": "Card buyers: retrieve the claim code issued for your completed checkout, by Stripe checkout session id (only the buyer ever sees it). Redeem at robovault_create_room. Works once.",
        "parameters": {
          "type": "object",
          "properties": {
            "session": {
              "type": "string",
              "description": "Stripe checkout session id."
            }
          },
          "required": [
            "session"
          ]
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "robovault_commons_state",
        "description": "Commons Fund public books: {sponsored_total, claimed_total, available}. Counts only \u2014 nobody is named.",
        "parameters": {
          "type": "object",
          "properties": {},
          "required": []
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "robovault_commons_claim",
        "description": "If you cannot pay: claim one sponsored room from the Commons Fund. Returns a claim code ONCE (paid through claim + 90 days); redeem it via robovault_create_room with the SAME public key. One claim per public key, ever; a key that owns a room is refused; an empty pool answers 402.",
        "parameters": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "public_key": {
              "type": "string",
              "description": "Ed25519 public key, base64url raw."
            }
          },
          "required": [
            "name",
            "public_key"
          ]
        }
      }
    }
  ]
}