Skip to main content
Glama

get_payment

Check the status of a PayBot payment by providing a payment ID to monitor transaction progress and confirm completion.

Instructions

Get the status of a PayBot payment

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paymentIdYesThe payment ID to look up

Implementation Reference

  • src/index.ts:61-72 (registration)
    The tool registration for 'get_payment' which defines the input schema (paymentId) and the handler function that executes the tool logic
    // Tool: get_payment
    server.tool(
      'get_payment',
      'Get the status of a PayBot payment',
      {
        paymentId: z.string().describe('The payment ID to look up'),
      },
      async ({ paymentId }) => {
        const result = await paybotRequest('GET', `/v1/payments/${paymentId}`);
        return { content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }] };
      },
    );
  • The actual handler function that executes the get_payment tool logic - makes a GET request to /v1/payments/{paymentId} and returns the result
    async ({ paymentId }) => {
      const result = await paybotRequest('GET', `/v1/payments/${paymentId}`);
      return { content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }] };
    },
  • Input schema definition for the get_payment tool - accepts a paymentId string parameter
    {
      paymentId: z.string().describe('The payment ID to look up'),
  • The paybotRequest helper function used by get_payment handler to make authenticated API requests to the PayBot backend
    async function paybotRequest<T>(method: string, path: string, body?: unknown): Promise<T> {
      const response = await fetch(`${PAYBOT_BASE_URL}${path}`, {
        method,
        headers: {
          'Content-Type': 'application/json',
          Authorization: `Bearer ${PAYBOT_API_KEY}`,
        },
        body: body ? JSON.stringify(body) : undefined,
      });
    
      if (!response.ok) {
        const errorBody = await response.text().catch(() => 'Unknown error');
        throw new Error(`PayBot API error (${response.status}): ${errorBody}`);
      }
    
      return (await response.json()) as T;
    }
Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/RBKunnela/paybot-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server