get_payment_url
Generate a Stripe checkout URL to add credits for API access on Rhumb's MCP server. Specify the USD amount to top up your account for managed API execution.
Instructions
Get a Stripe checkout URL to top up Rhumb credits
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount_usd | Yes | Amount to add in USD (min $5, max $5000) |
Implementation Reference
- Handler function that calls the Rhumb API to create a Stripe checkout session for credit top-ups.
export async function handleGetPaymentUrl( input: GetPaymentUrlInput, client: RhumbApiClient ): Promise<GetPaymentUrlOutput> { if (input.amount_usd < 5 || input.amount_usd > 5000) { return { checkout_url: "", amount_usd: input.amount_usd, message: `Amount must be between $5 and $5,000. You requested $${input.amount_usd}.`, }; } try { const session = await client.createCheckout(input.amount_usd); return { checkout_url: session.checkout_url, amount_usd: input.amount_usd, message: `Complete payment at: ${session.checkout_url}`, }; } catch (err) { return { checkout_url: "", amount_usd: input.amount_usd, message: `Failed to create checkout: ${err instanceof Error ? err.message : String(err)}`, }; } } - packages/mcp/src/types.ts:539-555 (schema)JSON Schema and TypeScript type definition for get_payment_url inputs and outputs.
export const GetPaymentUrlInputSchema = { type: "object" as const, properties: { amount_usd: { type: "number" as const, description: "Amount to add to your Rhumb credit balance in USD (min $5, max $5000). Returns a checkout URL to complete payment." }, }, required: ["amount_usd"] as string[], }; export type GetPaymentUrlInput = { amount_usd: number; }; export type GetPaymentUrlOutput = { checkout_url: string; amount_usd: number; message: string; }; - packages/mcp/src/server.ts:307-319 (registration)MCP server tool registration for get_payment_url.
// -- get_payment_url --------------------------------------------------- server.tool( "get_payment_url", "Get a checkout URL to add credits to your Rhumb balance. Present this URL to a human to complete payment. Credits are available immediately after payment.", { amount_usd: z.number().min(5).max(5000).describe("Amount to add in USD (min $5, max $5000)") }, async ({ amount_usd }) => { const result = await handleGetPaymentUrl({ amount_usd }, client); return { content: [{ type: "text" as const, text: JSON.stringify(result) }] }; }