Skip to main content
Glama

removeFileFromGroup

Remove a specific file from a designated group in your Pinata IPFS storage to manage content organization and access control.

Instructions

Remove a file from a group in your Pinata account

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
networkNoWhether the group and file are in public or private IPFSpublic
groupIdYesThe ID of the group to remove the file from
fileIdYesThe ID of the file to remove from the group

Implementation Reference

  • Complete implementation of removeFileFromGroup tool - removes a file from a Pinata group via DELETE request to API endpoint
    server.tool(
      "removeFileFromGroup",
      "Remove a file from a group in your Pinata account",
      {
        network: z
          .enum(["public", "private"])
          .default("public")
          .describe("Whether the group and file are in public or private IPFS"),
        groupId: z
          .string()
          .describe("The ID of the group to remove the file from"),
        fileId: z.string().describe("The ID of the file to remove from the group"),
      },
      async ({ network, groupId, fileId }) => {
        try {
          const url = `https://api.pinata.cloud/v3/groups/${network}/${groupId}/ids/${fileId}`;
    
          const response = await fetch(url, {
            method: "DELETE",
            headers: getHeaders(),
          });
    
          if (!response.ok) {
            throw new Error(
              `Failed to remove file from group: ${response.status} ${response.statusText}`
            );
          }
    
          const data = await response.json();
          return {
            content: [
              {
                type: "text",
                text: `✅ File removed from group successfully\n\n${JSON.stringify(data, null, 2)}`,
              },
            ],
          };
        } catch (error) {
          return errorResponse(error);
        }
      }
    );
  • The removeFileFromGroup tool registration and handler implementation. Removes a file from a Pinata group by making a DELETE request to the API endpoint with network, groupId, and fileId parameters. Returns success message or error response.
    server.tool(
      "removeFileFromGroup",
      "Remove a file from a group in your Pinata account",
      {
        network: z
          .enum(["public", "private"])
          .default("public")
          .describe("Whether the group and file are in public or private IPFS"),
        groupId: z
          .string()
          .describe("The ID of the group to remove the file from"),
        fileId: z.string().describe("The ID of the file to remove from the group"),
      },
      async ({ network, groupId, fileId }) => {
        try {
          const url = `https://api.pinata.cloud/v3/groups/${network}/${groupId}/ids/${fileId}`;
    
          const response = await fetch(url, {
            method: "DELETE",
            headers: getHeaders(),
          });
    
          if (!response.ok) {
            throw new Error(
              `Failed to remove file from group: ${response.status} ${response.statusText}`
            );
          }
    
          const data = await response.json();
          return {
            content: [
              {
                type: "text",
                text: `✅ File removed from group 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