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
| Name | Required | Description | Default |
|---|---|---|---|
| network | No | Whether the group and file are in public or private IPFS | public |
| groupId | Yes | The ID of the group to remove the file from | |
| fileId | Yes | The ID of the file to remove from the group |
Implementation Reference
- src/index.ts:915-956 (handler)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); } } ); - src/index.ts:915-956 (handler)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); } } );