cancelPinRequest
Cancel a pending IPFS pin request by providing its ID to stop the pinning process.
Instructions
Cancel a pending pin by CID request
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ID of the pin request to cancel |
Implementation Reference
- src/index.ts:1672-1706 (handler)The complete cancelPinRequest tool implementation - registered as an MCP tool with schema definition (id parameter) and async handler that makes a DELETE request to cancel a pending pin by CID request
server.tool( "cancelPinRequest", "Cancel a pending pin by CID request", { id: z.string().describe("ID of the pin request to cancel"), }, async ({ id }) => { try { const url = `https://api.pinata.cloud/v3/files/public/pin_by_cid/${id}`; const response = await fetch(url, { method: "DELETE", headers: getHeaders(), }); if (!response.ok) { throw new Error( `Failed to cancel pin request: ${response.status} ${response.statusText}` ); } const data = await response.json(); return { content: [ { type: "text", text: `✅ Pin request cancelled\n\n${JSON.stringify(data, null, 2)}`, }, ], }; } catch (error) { return errorResponse(error); } } );