Skip to main content
Glama

removeCidFromPaymentInstruction

Remove a CID association from a payment instruction in Pinata MCP to manage IPFS content links and update payment records.

Instructions

Remove a CID association from a payment instruction

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe payment instruction ID
cidYesThe CID to remove

Implementation Reference

  • Complete implementation of the removeCidFromPaymentInstruction tool. It's registered with the MCP server, takes payment instruction ID and CID as parameters, and makes a DELETE request to the Pinata API to remove the CID association from the payment instruction.
    server.tool(
      "removeCidFromPaymentInstruction",
      "Remove a CID association from a payment instruction",
      {
        id: z.string().describe("The payment instruction ID"),
        cid: z.string().describe("The CID to remove"),
      },
      async ({ id, cid }) => {
        try {
          const url = `https://api.pinata.cloud/v3/x402/payment_instructions/${id}/cids/${cid}`;
    
          const response = await fetch(url, {
            method: "DELETE",
            headers: getHeaders(),
          });
    
          if (!response.ok) {
            throw new Error(
              `Failed to remove CID from payment instruction: ${response.status} ${response.statusText}`
            );
          }
    
          const data = await response.json();
          return {
            content: [
              {
                type: "text",
                text: `✅ CID removed from payment instruction successfully\n\n${JSON.stringify(data, null, 2)}`,
              },
            ],
          };
        } 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