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
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The payment instruction ID | |
| cid | Yes | The CID to remove |
Implementation Reference
- src/index.ts:1312-1347 (handler)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); } } );