Skip to main content
Glama

getPaymentInstruction

Retrieve a x402 payment instruction using its unique identifier to access transaction details and processing information.

Instructions

Retrieve a specific x402 payment instruction by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe unique identifier of the payment instruction

Implementation Reference

  • src/index.ts:1088-1117 (registration)
    The getPaymentInstruction tool is registered with the MCP server. It retrieves a specific x402 payment instruction by ID from the Pinata API.
    server.tool(
      "getPaymentInstruction",
      "Retrieve a specific x402 payment instruction by ID",
      {
        id: z
          .string()
          .describe("The unique identifier of the payment instruction"),
      },
      async ({ id }) => {
        try {
          const url = `https://api.pinata.cloud/v3/x402/payment_instructions/${id}`;
    
          const response = await fetch(url, {
            method: "GET",
            headers: getHeaders(),
          });
    
          if (!response.ok) {
            throw new Error(
              `Failed to get payment instruction: ${response.status} ${response.statusText}`
            );
          }
    
          const data = await response.json();
          return successResponse(data);
        } catch (error) {
          return errorResponse(error);
        }
      }
    );

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/PinataCloud/pinata-mcp'

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