Skip to main content
Glama

Purchase Hook Credits

purchase_hook_credits
Idempotent

Request an x402 quote without payment, or buy credits with an explicitly authorized signed payment. Reuse purchaseId and the same payment after any timeout.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hookIdYesHook identifier returned by registration; preserve for all subsequent operations.
paymentNoOriginal signed x402 payment payload authorized by the payer. Omit to request a quote without paying. Never fabricate or replace an uncertain authorization.
purchaseIdYesUnique caller-chosen purchase identifier, for example credits-20261007-01. Save before requesting the quote and reuse unchanged with the same payment on retries.
managementTokenYesPrivate management token returned by registration. Required for status, activation, revocation and credits; not the delivery token.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / properties / managementToken / description
      Previous value: -"Private 32-byte secret encoded as 64 lowercase hexadecimal characters. Never expose in logs."New value: +"Private management token returned by registration. Required for status, activation, revocation and credits; not the delivery token."
    • addedInput schema / properties / payment / description
      Added value: +"Original signed x402 payment payload authorized by the payer. Omit to request a quote without paying. Never fabricate or replace an uncertain authorization."
    • addedInput schema / properties / purchaseId / description
      Added value: +"Unique caller-chosen purchase identifier, for example credits-20261007-01. Save before requesting the quote and reuse unchanged with the same payment on retries."
  2. Changed3 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 / hookId / description
      Added value: +"Hook identifier returned by registration; preserve for all subsequent operations."
    • addedInput schema / properties / managementToken / description
      Added value: +"Private 32-byte secret encoded as 64 lowercase hexadecimal characters. Never expose in logs."
  3. Added

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare idempotentHint=true and destructiveHint=false, but the description adds non-obvious retry semantics: reuse the purchaseId and the same payment payload after any timeout. It doesn't spell out auth/permission details beyond what the schema's managementToken field already says.

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

Conciseness5/5

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

Two sentences, zero filler, with the quote-vs-purchase distinction front-loaded and the retry rule following. Every clause carries information an agent needs.

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 nested-payload payment tool with no output schema, the description covers the two invocation modes and retry behavior. It does not say what a quote response versus a purchase response looks like, which is a minor gap given no output schema exists to carry that.

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 description coverage is 100%, so the baseline is 3 and the schema already documents hookId, purchaseId, managementToken and payment. The description adds genuine meaning on top by clarifying the retry relationship between purchaseId and payment and that payment may be omitted.

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 states a specific verb and resource with two distinct modes: request an x402 quote without payment, or buy credits with a signed payment. That is enough to separate it from get_hook_credits, but it never names a sibling tool, so it falls short of a 5.

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 gives clear conditional guidance: omit payment to get a quote, supply a signed payment to buy, and reuse purchaseId plus the same payment after a timeout. It doesn't point at alternatives (e.g., get_hook_credits for balance checks), so no exclusions are stated.

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