writ_execute
Run one policy-gated upstream API request with a lease or ALLOW token. It verifies method, path, and body match before forwarding; mismatches fail closed.
Instructions
Run one gated upstream request with a lease or ALLOW token.
Pass exactly one of lease_id (from writ_lease) or auth_token (from a writ_check ALLOW). Pass the SAME method, path, and body as the lease: the gate compares the request bytes against the lease, and on any mismatch it fails closed: no upstream call is made and the answer is {"ok": false, "reason": ..., "upstreamCalled": false}.
Args: lease_id: The leaseId from writ_lease. Mutually exclusive with auth_token. auth_token: An ALLOW authToken from writ_check. Mutually exclusive with lease_id. system_id: The registered upstream system: "stripe" (default), "github", or "salesforce". method: HTTP method of the upstream request (required, e.g. "POST"). path: Upstream path (required, e.g. "/v1/refunds"). body: Optional JSON object. Must be byte-identical to the leased body. idempotency_key: Optional key passed through to the upstream system. Use it so retries are safe.
On success the gate returns the upstream system's status and body verbatim. Every outcome writes a receipt. On {"ok": false} report the reason to the user and do NOT retry with a different request: the lease is spent or invalid.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "writ_execute"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | No | ||
| path | No | ||
| method | No | ||
| lease_id | No | ||
| system_id | No | stripe | |
| auth_token | No | ||
| idempotency_key | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |