Skip to main content
Glama

listPaymentInstructions

Retrieve and filter x402 payment instructions for content monetization by CID, name, or ID to manage revenue streams.

Instructions

List and filter x402 payment instructions for content monetization

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoLimit the number of results returned
pageTokenNoToken for pagination
cidNoFilter by associated CID
nameNoFilter by name
idNoFilter by specific payment instruction ID

Implementation Reference

  • Complete implementation of the listPaymentInstructions tool - includes tool registration with schema definition and the async handler that lists and filters x402 payment instructions via the Pinata API
    server.tool(
      "listPaymentInstructions",
      "List and filter x402 payment instructions for content monetization",
      {
        limit: z
          .number()
          .optional()
          .describe("Limit the number of results returned"),
        pageToken: z.string().optional().describe("Token for pagination"),
        cid: z.string().optional().describe("Filter by associated CID"),
        name: z.string().optional().describe("Filter by name"),
        id: z.string().optional().describe("Filter by specific payment instruction ID"),
      },
      async ({ limit, pageToken, cid, name, id }) => {
        try {
          const params = new URLSearchParams();
          if (limit) params.append("limit", limit.toString());
          if (pageToken) params.append("pageToken", pageToken);
          if (cid) params.append("cid", cid);
          if (name) params.append("name", name);
          if (id) params.append("id", id);
    
          const url = `https://api.pinata.cloud/v3/x402/payment_instructions?${params.toString()}`;
    
          const response = await fetch(url, {
            method: "GET",
            headers: getHeaders(),
          });
    
          if (!response.ok) {
            throw new Error(
              `Failed to list payment instructions: ${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