Skip to main content
Glama

listPaymentInstructionCids

Retrieve Content Identifiers (CIDs) linked to a specific payment instruction ID in the Pinata MCP server for IPFS content management.

Instructions

List CIDs associated with a payment instruction

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe payment instruction ID
limitNoLimit the number of results returned
pageTokenNoToken for pagination

Implementation Reference

  • Complete implementation of the listPaymentInstructionCids tool - registers the tool with MCP server and contains the handler function that makes a GET request to Pinata API to list CIDs associated with a payment instruction
    server.tool(
      "listPaymentInstructionCids",
      "List CIDs associated with a payment instruction",
      {
        id: z.string().describe("The payment instruction ID"),
        limit: z
          .number()
          .optional()
          .describe("Limit the number of results returned"),
        pageToken: z.string().optional().describe("Token for pagination"),
      },
      async ({ id, limit, pageToken }) => {
        try {
          const params = new URLSearchParams();
          if (limit) params.append("limit", limit.toString());
          if (pageToken) params.append("pageToken", pageToken);
    
          const url = `https://api.pinata.cloud/v3/x402/payment_instructions/${id}/cids?${params.toString()}`;
    
          const response = await fetch(url, {
            method: "GET",
            headers: getHeaders(),
          });
    
          if (!response.ok) {
            throw new Error(
              `Failed to list CIDs: ${response.status} ${response.statusText}`
            );
          }
    
          const data = await response.json();
          return successResponse(data);
        } catch (error) {
          return errorResponse(error);
        }
      }
    );
  • Input parameter schema definition for listPaymentInstructionCids - defines id (required), limit (optional), and pageToken (optional) parameters using Zod validation
    {
      id: z.string().describe("The payment instruction ID"),
      limit: z
        .number()
        .optional()
        .describe("Limit the number of results returned"),
      pageToken: z.string().optional().describe("Token for pagination"),
  • Helper function getHeaders() used by the tool to construct authorization headers with the Pinata JWT token
    const getHeaders = () => {
      if (!PINATA_JWT) {
        throw new Error("PINATA_JWT environment variable is not set");
      }
      return {
        Authorization: `Bearer ${PINATA_JWT}`,
        "Content-Type": "application/json",
      };
    };
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. It states the action ('List') but doesn't describe key behaviors like whether this is a read-only operation, if it requires specific permissions, how pagination works with 'pageToken', or what the output format looks like (e.g., list of strings or objects). This leaves significant gaps for an agent to understand the tool's behavior.

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 a single, direct sentence that efficiently conveys the core purpose without unnecessary words. It's front-loaded with the essential information, 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 3 parameters, no annotations, and no output schema, the description is insufficient. It lacks details on behavioral traits (e.g., read-only vs. mutating), usage context, and output format. Given the complexity of handling CIDs and pagination, more context is needed to guide an agent effectively.

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 input schema has 100% description coverage, clearly documenting each parameter ('id', 'limit', 'pageToken'). The description doesn't add any semantic details beyond this, such as explaining what a CID represents or how pagination functions. Since the schema does the heavy lifting, a baseline score of 3 is appropriate.

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 resource ('CIDs associated with a payment instruction'), making the purpose understandable. However, it doesn't distinguish this tool from potential alternatives like 'getPaymentInstruction' or 'listPaymentInstructions', which could list payment instructions themselves rather than their CIDs.

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. Given sibling tools like 'getPaymentInstruction' (which might retrieve payment instruction details) and 'listPaymentInstructions' (which lists payment instructions), there's no indication of when listing CIDs is appropriate, such as for tracking associated content or verifying attachments.

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