get_payment
Retrieve the current status of a payment using its payment ID. No authentication needed.
Instructions
Check the status of a specific payment by its ID. No authentication required.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| paymentId | Yes | Payment ID (pay_...) |
Implementation Reference
- src/index.ts:210-226 (handler)The core handler function for the 'get_payment' tool. It accepts a paymentId string, makes an unauthenticated GET request to /payments/{paymentId}, and returns the payment status response.
// Tool 6: Get Payment server.tool( "get_payment", "Check the status of a specific payment by its ID. No authentication required.", { paymentId: z.string().describe("Payment ID (pay_...)"), }, async ({ paymentId }) => { try { const res = await callApi("GET", `/payments/${paymentId}`, undefined, false); if (!res.ok) return errorResponse("Get payment failed", res); return successResponse(res.json); } catch (e) { return { content: [{ type: "text" as const, text: `Get payment error: ${e}` }], isError: true }; } }, ); - src/index.ts:214-216 (schema)Input schema for the get_payment tool: requires a 'paymentId' string parameter (described as 'Payment ID (pay_...)').
{ paymentId: z.string().describe("Payment ID (pay_...)"), }, - src/index.ts:211-226 (registration)Registration of the tool named 'get_payment' via server.tool() on the McpServer instance. The registration includes its description ('Check the status of a specific payment by its ID. No authentication required.'), schema, and handler.
server.tool( "get_payment", "Check the status of a specific payment by its ID. No authentication required.", { paymentId: z.string().describe("Payment ID (pay_...)"), }, async ({ paymentId }) => { try { const res = await callApi("GET", `/payments/${paymentId}`, undefined, false); if (!res.ok) return errorResponse("Get payment failed", res); return successResponse(res.json); } catch (e) { return { content: [{ type: "text" as const, text: `Get payment error: ${e}` }], isError: true }; } }, );