Skip to main content
Glama

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
NameRequiredDescriptionDefault
idYesID of the pin request to cancel

Implementation Reference

  • 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);
        }
      }
    );

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