Skip to main content
Glama

Issue API Receipt

issue_api_receipt
Idempotent

Buy a portable signed commitment to a declared API exchange when a recipient needs independently verifiable receipt integrity: response handoff, archived decision input, or change investigation. Costs 0.002 USDC per receipt via x402 when enabled; verification is free. A local log may suffice for disposable data. Requires caller-approved budget. Keep event, idempotency key and original payment unchanged on retry. Attests a client declaration, not provider origin, content truth or independent observation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
eventYesCommitment-only HTTP exchange declaration built locally with the SDK. No raw URLs, headers or bodies.
idempotencyKeyYesOne stable key per purchase, saved before payment. Keep it, the event and original payment authorization unchanged on retries.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed17 schema fields changed
    • addedInput schema / properties / event / description
      Added value: +"Commitment-only HTTP exchange declaration built locally with the SDK. No raw URLs, headers or bodies."
    • addedInput schema / properties / event / properties / attestation / description
      Added value: +"The caller declares the exchange; Datoka does not independently observe it."
    • addedInput schema / properties / event / properties / bodyEncoding / description
      Added value: +"Hash application bytes after HTTP decoding, without JSON reserialization."
    • addedInput schema / properties / event / properties / completedAt / description
      Added value: +"Declared UTC completion with milliseconds; must be at or after startedAt."
    • addedInput schema / properties / event / properties / headerEncoding / description
      Added value: +"Use the SDK header selection and JCS canonicalization before hashing."
    • addedInput schema / properties / event / properties / method / description
      Added value: +"Actual HTTP method of the locally captured exchange, for example GET."
    • changedInput schema / properties / event / properties / requestBodyHash / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "algorithm": {
      -        "const": "sha256",
      -        "type": "string"
      -      },
      -      "digest": {
      -        "pattern": "^[a-f0-9]{64}$",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "algorithm",
      -      "digest"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "algorithm": {
      +        "const": "sha256",
      +        "description": "Digest algorithm; always sha256.",
      +        "type": "string"
      +      },
      +      "digest": {
      +        "description": "SHA-256 of exact locally captured bytes, encoded as 64 lowercase hexadecimal characters.",
      +        "pattern": "^[a-f0-9]{64}$",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "algorithm",
      +      "digest"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / event / properties / requestHeadersHash / properties / algorithm / description
      Added value: +"Digest algorithm; always sha256."
    • addedInput schema / properties / event / properties / requestHeadersHash / properties / digest / description
      Added value: +"SHA-256 of exact locally captured bytes, encoded as 64 lowercase hexadecimal characters."
    • changedInput schema / properties / event / properties / responseBodyHash / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "algorithm": {
      -        "const": "sha256",
      -        "type": "string"
      -      },
      -      "digest": {
      -        "pattern": "^[a-f0-9]{64}$",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "algorithm",
      -      "digest"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "algorithm": {
      +        "const": "sha256",
      +        "description": "Digest algorithm; always sha256.",
      +        "type": "string"
      +      },
      +      "digest": {
      +        "description": "SHA-256 of exact locally captured bytes, encoded as 64 lowercase hexadecimal characters.",
      +        "pattern": "^[a-f0-9]{64}$",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "algorithm",
      +      "digest"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / event / properties / responseHeadersHash / properties / algorithm / description
      Added value: +"Digest algorithm; always sha256."
    • addedInput schema / properties / event / properties / responseHeadersHash / properties / digest / description
      Added value: +"SHA-256 of exact locally captured bytes, encoded as 64 lowercase hexadecimal characters."
    • addedInput schema / properties / event / properties / startedAt / description
      Added value: +"Declared UTC start with milliseconds, for example 2026-10-07T08:00:00.000Z."
    • addedInput schema / properties / event / properties / status / description
      Added value: +"Actual HTTP response status, including error responses; for example 200 or 404."
    • addedInput schema / properties / event / properties / targetHash / properties / algorithm / description
      Added value: +"Digest algorithm; always sha256."
    • addedInput schema / properties / event / properties / targetHash / properties / digest / description
      Added value: +"SHA-256 of exact locally captured bytes, encoded as 64 lowercase hexadecimal characters."
    • addedInput schema / properties / event / properties / version / description
      Added value: +"Declaration format version; preserve this literal."
  2. Changed5 schema fields changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedInput schema / properties / event / properties / apiId / description
      Added value: +"Caller-chosen API identifier; not a certified provider identity."
    • addedInput schema / properties / event / properties / exchangeId / description
      Added value: +"Stable identifier for one declared HTTP exchange."
    • addedInput schema / properties / event / properties / requestHeadersHash / description
      Added value: +"SHA-256 of locally canonicalized selected request headers. Never send raw headers."
    • addedInput schema / properties / event / properties / responseHeadersHash / description
      Added value: +"SHA-256 of locally canonicalized selected response headers."
  3. Changed4 schema fields changed
    • addedInput schema / properties / event / properties / requestBodyHash / description
      Added value: +"SHA-256 of exact application request bytes; null means no body, not an empty body."
    • addedInput schema / properties / event / properties / responseBodyHash / description
      Added value: +"SHA-256 of exact application response bytes after HTTP decoding. Preserve those bytes; do not reserialize JSON."
    • addedInput schema / properties / event / properties / targetHash / description
      Added value: +"SHA-256 of the exact UTF-8 target URL, computed locally. Never invent a digest or send the URL itself."
    • addedInput schema / properties / idempotencyKey / description
      Added value: +"One stable key per purchase, saved before payment. Keep it, the event and original payment authorization unchanged on retries."
  4. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -{
      -  "$schema": "http://json-schema.org/draft-07/schema#",
      -  "additionalProperties": false,
      -  "properties": {
      -    "event": {
      -      "additionalProperties": false,
      -      "properties": {
      -        "apiId": {
      -          "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
      -          "type": "string"
      -        },
      -        "attestation": {
      -          "const": "client_declared",
      -          "type": "string"
      -        },
      -        "bodyEncoding": {
      -          "const": "application_bytes",
      -          "type": "string"
      -        },
      -        "completedAt": {
      -          "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{3}(?:Z))$",
      -          "type": "string"
      -        },
      -        "exchangeId": {
      -          "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
      -          "type": "string"
      -        },
      -        "headerEncoding": {
      -          "const": "jcs-selected-headers-v1",
      -          "type": "string"
      -        },
      -        "method": {
      -          "enum": [
      -            "GET",
      -            "HEAD",
      -            "POST",
      -            "PUT",
      -            "PATCH",
      -            "DELETE",
      -            "OPTIONS"
      -          ],
      -          "type": "string"
      -        },
      -        "requestBodyHash": {
      -          "anyOf": [
      -            {
      -              "additionalProperties": false,
      -              "properties": {
      -                "algorithm": {
      -                  "const": "sha256",
      -                  "type": "string"
      -                },
      -                "digest": {
      -                  "pattern": "^[a-f0-9]{64}$",
      -                  "type": "string"
      -                }
      -              },
      -              "required": [
      -                "algorithm",
      -                "digest"
      -              ],
      -              "type": "object"
      -            },
      -            {
      -              "type": "null"
      -            }
      -          ]
      -        },
      -        "requestHeadersHash": {
      -          "additionalProperties": false,
      -          "properties": {
      -            "algorithm": {
      -              "const": "sha256",
      -              "type": "string"
      -            },
      -            "digest": {
      -              "pattern": "^[a-f0-9]{64}$",
      -              "type": "string"
      -            }
      -          },
      -          "required": [
      -            "algorithm",
      -            "digest"
      -          ],
      -          "type": "object"
      -        },
      -        "responseBodyHash": {
      -          "anyOf": [
      -            {
      -              "additionalProperties": false,
      -              "properties": {
      -                "algorithm": {
      -                  "const": "sha256",
      -                  "type": "string"
      -                },
      -                "digest": {
      -                  "pattern": "^[a-f0-9]{64}$",
      -                  "type": "string"
      -                }
      -              },
      -              "required": [
      -                "algorithm",
      -                "digest"
      -              ],
      -              "type": "object"
      -            },
      -            {
      -              "type": "null"
      -            }
      -          ]
      -        },
      -        "responseHeadersHash": {
      -          "additionalProperties": false,
      -          "properties": {
      -            "algorithm": {
      -              "const": "sha256",
      -              "type": "string"
      -            },
      -            "digest": {
      -              "pattern": "^[a-f0-9]{64}$",
      -              "type": "string"
      -            }
      -          },
      -          "required": [
      -            "algorithm",
      -            "digest"
      -          ],
      -          "type": "object"
      -        },
      -        "startedAt": {
      -          "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{3}(?:Z))$",
      -          "type": "string"
      -        },
      -        "status": {
      -          "maximum": 599,
      -          "minimum": 200,
      -          "type": "integer"
      -        },
      -        "targetHash": {
      -          "additionalProperties": false,
      -          "properties": {
      -            "algorithm": {
      -              "const": "sha256",
      -              "type": "string"
      -            },
      -            "digest": {
      -              "pattern": "^[a-f0-9]{64}$",
      -              "type": "string"
      -            }
      -          },
      -          "required": [
      -            "algorithm",
      -            "digest"
      -          ],
      -          "type": "object"
      -        },
      -        "version": {
      -          "const": "datoka.api.exchange.v1",
      -          "type": "string"
      -        }
      -      },
      -      "required": [
      -        "version",
      -        "attestation",
      -        "apiId",
      -        "exchangeId",
      -        "method",
      -        "status",
      -        "startedAt",
      -        "completedAt",
      -        "targetHash",
      -        "requestBodyHash",
      -        "responseBodyHash",
      -        "requestHeadersHash",
      -        "responseHeadersHash",
      -        "bodyEncoding",
      -        "headerEncoding"
      -      ],
      -      "type": "object"
      -    },
      -    "receipt": {
      -      "additionalProperties": false,
      -      "properties": {
      -        "algorithm": {
      -          "const": "Ed25519",
      -          "type": "string"
      -        },
      -        "body": {
      -          "additionalProperties": false,
      -          "properties": {
      -            "id": {
      -              "format": "uuid",
      -              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
      -              "type": "string"
      -            },
      -            "issuedAt": {
      -              "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{3}(?:Z))$",
      -              "type": "string"
      -            },
      -            "issuer": {
      -              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
      -              "type": "string"
      -            },
      -            "keyId": {
      -              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
      -              "type": "string"
      -            },
      -            "previous": {
      -              "anyOf": [
      -                {
      -                  "pattern": "^[a-f0-9]{64}$",
      -                  "type": "string"
      -                },
      -                {
      -                  "type": "null"
      -                }
      -              ]
      -            },
      -            "request": {
      -              "additionalProperties": false,
      -              "properties": {
      -                "chain": {
      -                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
      -                  "type": "string"
      -                },
      -                "eventType": {
      -                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
      -                  "type": "string"
      -                },
      -                "scope": {
      -                  "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
      -                  "type": "string"
      -                },
      -                "subject": {
      -                  "additionalProperties": false,
      -                  "properties": {
      -                    "algorithm": {
      -                      "const": "sha256",
      -                      "type": "string"
      -                    },
      -                    "digest": {
      -                      "pattern": "^[a-f0-9]{64}$",
      -                      "type": "string"
      -                    },
      -                    "encoding": {
      -                      "enum": [
      -                        "jcs",
      -                        "bytes"
      -                      ],
      -                      "type": "string"
      -                    }
      -                  },
      -                  "required": [
      -                    "algorithm",
      -                    "encoding",
      -                    "digest"
      -                  ],
      -                  "type": "object"
      -                }
      -              },
      -              "required": [
      -                "scope",
      -                "chain",
      -                "eventType",
      -                "subject"
      -              ],
      -              "type": "object"
      -            },
      -            "sequence": {
      -              "exclusiveMinimum": 0,
      -              "maximum": 9007199254740991,
      -              "type": "integer"
      -            },
      -            "version": {
      -              "const": "datoka.receipt.v1",
      -              "type": "string"
      -            }
      -          },
      -          "required": [
      -            "version",
      -            "id",
      -            "issuer",
      -            "keyId",
      -            "issuedAt",
      -            "request",
      -            "sequence",
      -            "previous"
      -          ],
      -          "type": "object"
      -        },
      -        "signature": {
      -          "pattern": "^[A-Za-z0-9_-]{86}$",
      -          "type": "string"
      -        }
      -      },
      -      "required": [
      -        "body",
      -        "algorithm",
      -        "signature"
      -      ],
      -      "type": "object"
      -    }
      -  },
      -  "required": [
      -    "event",
      -    "receipt"
      -  ],
      -  "type": "object"
      -}New value: +null
  5. First observed

TDQS

A4.2/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the annotations, it discloses cost (0.002 USDC per receipt via x402), that verification is free, that a caller-approved budget is required, that inputs/payment must be unchanged on retry, and the crucial trust caveat that it attests a client declaration rather than provider origin or content truth. This is exactly the kind of context annotations cannot carry.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Dense but front-loaded: the core action and cost come first, then prerequisites and caveats. Some clauses are stacked tightly, but every sentence carries distinct information (use cases, cost, budget, retry rule, trust limit).

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a paid, idempotent mutation with a deep nested schema, the description covers cost, authorization, retry discipline and the trust boundary. The only real gap is that it never characterizes the returned receipt (there is no output schema), leaving the agent to infer what 'buy' produces.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3, but the description adds real semantic value: the idempotency key and event must be held stable across retries with the original payment authorization, which is not derivable from the schema's pattern/description alone.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description gives a specific verb+resource (buy a portable signed commitment / receipt) and grounds it in concrete scenarios (response handoff, archived decision input, change investigation). It does not name sibling tools like prepare_api_exchange or verify_api_receipt, so differentiation is implied rather than explicit.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It states clear use contexts and even a when-not condition (a local log may suffice for disposable data), plus prerequisites (caller-approved budget). It stops short of pointing the agent at the alternative sibling tools (e.g. verify_api_receipt for free verification), which would make routing unambiguous.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources