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);
        }
      }
    );
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. While 'list and filter' implies a read-only operation, it doesn't address important behavioral aspects like pagination behavior (implied by pageToken but not explained), rate limits, authentication requirements, or what happens when no filters are applied. The description is too minimal for a tool with 5 parameters.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise - a single sentence that communicates the core purpose efficiently. There's no wasted language or unnecessary elaboration, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 5 parameters, no annotations, and no output schema, the description is inadequate. It doesn't explain what the tool returns, how results are structured, or important behavioral context. The agent would need to guess about the response format and operational characteristics.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 100% description coverage, so all parameters are documented in the structured schema. The description adds no additional parameter information beyond what's already in the schema descriptions. This meets the baseline expectation when schema coverage is complete.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('list and filter') and resource ('x402 payment instructions for content monetization'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'listPaymentInstructionCids' or 'getPaymentInstruction', which also deal with payment instructions in different ways.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'getPaymentInstruction' (for single records) or 'listPaymentInstructionCids' (for related data). There's no mention of prerequisites, typical use cases, or when other tools might be more appropriate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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

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