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
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The payment instruction ID | |
| limit | No | Limit the number of results returned | |
| pageToken | No | Token for pagination |
Implementation Reference
- src/index.ts:1237-1273 (handler)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); } } ); - src/index.ts:1240-1246 (schema)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"), - src/index.ts:100-108 (helper)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", }; };