Skip to main content
Glama

Get payment result

get_payment_result
Read-only

Read the result of a paid call, by its paymentId. Use it when pay_service answered {"status":"pending"} (the service was still working when the Router stopped waiting — a payment was attempted, the call keeps running and its outcome is not known yet), or to recover a result whose response you lost. Reading costs nothing and charges nothing. Every answer with a state carries payment.status. state: "Pending" — still running, call again in a few seconds. state: "Ready" — status is the service's HTTP status and body its response (bodyEncoding says whether it is parsed JSON, text, or base64). state: "Failed" — the call ended without a response; failureReason says why. That does not prove nothing was charged, so check deliveryStatus in list_payments before paying again. {"status":"not_available"} — nothing to return: results are kept for 24 hours for the account that paid, and only then. {"status":"not_retained"} — the service is a partner API whose licence forbids keeping a copy of its answers, so no result of it is ever stored: its answer went only to the original pay_service call, and reading again will not change that. Do NOT call pay_service again to get a pending result: that does not return a new one. A paid body that is binary (audio, images, PDFs) or whose JSON form is larger than this server's inline limit is not inlined once the Router is confirmed to have kept the result: bodyOmitted comes instead, and it does NOT mean the body is empty. It gives the contentType, the sizeBytes and how to get the bytes: contentUrl to download with your API key (see its instructions), or the MCP resource resourceUri, also sent as a resource_link content block, read with the credential you send to this server. Fetching it charges nothing; do not pay again to get it. Pass inline: true to get such a body in the result anyway, at its full size. Requires your Nevermined API key on the Authorization header.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "paymentId": "<paymentId>"
    },
    "name": "get_payment_result"
  }
}

Input Schema

NameRequiredDescriptionDefault
inlineNoReturn the body in the result even when it is binary or larger than the inline limit, as base64 for binary. It can be very large (a paid audio file is hundreds of thousands of characters) and fill your context: set it only when you cannot fetch the body by `contentUrl` or `resourceUri`.
paymentIdYesThe `paymentId` a pay_service result returned.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / inline
      Added value: +{
      +  "description": "Return the body in the result even when it is binary or larger than the inline limit, as base64 for binary. It can be very large (a paid audio file is hundreds of thousands of characters) and fill your context: set it only when you cannot fetch the body by `contentUrl` or `resourceUri`.",
      +  "type": "boolean"
      +}
  2. Changed2 schema fields changed
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / paymentId / pattern
      Added value: +"^([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)$"
  3. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Far exceeds the annotations: it states the read is free, the 24-hour retention limit tied to the paying account, the licence-driven non-retention case, the meaning of each `state`, and that `bodyOmitted` does not mean an empty body. The auth requirement (Nevermined API key on the Authorization header) and the alternative retrieval paths (`contentUrl`, `resourceUri`) are also disclosed. It falls just short of 5 because the response envelope is described piecemeal rather than as a coherent whole, leaving some ambiguity about fields not mentioned.

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

Conciseness3/5

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

Front-loading is good — purpose and trigger come first — but the text is a single dense block of long sentences with repeated "costs nothing / charges nothing" assurances stated twice. The state-by-state and bodyOmitted material is mostly load-bearing, yet it would read far better split into lines, and some clauses restate each other.

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

Completeness5/5

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

For a two-parameter read tool with no output schema, the description covers everything an agent needs: when to call it, what each state means, what to do on Pending, what to do when the body is omitted, and how the result may be permanently unavailable. Nothing material is missing for correct invocation or interpretation.

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 the baseline would be 3, but the description adds genuine meaning: it explains where `paymentId` comes from (a `pay_service` result) and warns that `inline: true` can return hundreds of thousands of characters and flood the context, which the schema also notes but the description reinforces with the retrieval alternatives. `paymentId` itself gets no format guidance beyond the schema, keeping this below 5.

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

Purpose5/5

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

Opens with a specific verb and resource: "Read the result of a paid call, by its `paymentId`." It immediately distinguishes itself from `pay_service` by tying its use to that tool returning a pending status, so an agent can pick it out of the sibling set without opening the schema.

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

Usage Guidelines5/5

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

Gives explicit triggers (pay_service answered pending, or you lost the response) and an explicit prohibition ("Do NOT call pay_service again to get a pending result"). It further bounds usage by explaining when the tool cannot help — the 24-hour retention window and partner-API `not_retained` cases — plus a named sibling (`list_payments`) for the re-charge decision.

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