Skip to main content
Glama

Execute an after-order payment (mobile API)

pay_after_order
Destructive

Settle an unpaid mobile-API order after checkout by providing the order ID, invoice number, payment method, and a one-time confirmation token.

Instructions

Execute an after-order payment on an unpaid mobile-API order (AfterOrderRequestBody: order id, invoice number, payment id from after_order_payments, optional stored-card id and device fingerprint). High-impact, money movement: requires a one-time token from prepare_mutation (action=after_order_payment) and explicit user confirmation. Do not use for legacy web WCF orders — that is web_pay_after_order. Requires a loaded mobile API access token — check account_status first; if none is loaded, run auth_start, have the user complete the browser sign-in, then auth_exchange with the returned code and state.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
card_idNoStored-card id to pay with, if the user has one on file.
order_idYesThe unpaid order id (from `order`).
payment_idYesPayment method id from `after_order_payments`.
invoice_numberYesInvoice number for the payment (from the order detail).
confirmation_tokenYesOne-time token from `prepare_mutation` prepared with the matching action.
device_fingerprintNoDevice fingerprint expected by the payment gateway, if known.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errNo
msgNo
dataNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A4.7/5.0
Behavior5/5

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

The description adds significant behavioral context beyond annotations: it labels the operation as 'high-impact, money movement,' requires a one-time token and explicit user confirmation, and explains the authentication flow. These details reinforce the destructive and non-idempotent hints without contradicting them.

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?

The description is four sentences, front-loaded with purpose and the distinction from the legacy tool, followed by prerequisites and auth steps. Every sentence adds value with no redundancy, making it both concise and well-structured.

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 high-impact payment tool with 6 parameters, the description covers purpose, usage boundaries, prerequisites, and authentication steps. The output schema exists, so return details are not needed. Nothing essential is missing for an agent to call it correctly.

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

Parameters3/5

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

Schema coverage is 100% with thorough parameter descriptions, so the description adds little new semantic detail. It does mention the source of payment_id (`after_order_payments`) and the token requirement, but these are already in the schema. Since coverage is high, baseline 3 is appropriate.

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?

The description states the specific action: 'Execute an after-order payment on an unpaid mobile-API order,' clearly identifying the resource and distinguishing it from `web_pay_after_order` for legacy web WCF orders. It explicitly names the alternative, making the purpose unambiguous.

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?

It provides explicit when-to-use guidance: for unpaid mobile-API orders, and when-not-to-use: for legacy web WCF orders, naming the alternative tool. It also outlines a clear prerequisite workflow: require a one-time token from `prepare_mutation` and check `account_status` for a loaded token, with a fallback auth flow.

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