createGroup
Organize files in your Pinata account by creating a new group for public or private IPFS storage.
Instructions
Create a new group in your Pinata account to organize files
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| network | No | Whether to create the group in public or private IPFS | public |
| name | Yes | Name for the new group |
Implementation Reference
- src/index.ts:722-761 (handler)The createGroup tool handler implementation that creates a new group in Pinata IPFS. It accepts network (public/private) and name parameters, makes a POST request to Pinata's v3/groups API, and returns the created group details or an error response.
server.tool( "createGroup", "Create a new group in your Pinata account to organize files", { network: z .enum(["public", "private"]) .default("public") .describe("Whether to create the group in public or private IPFS"), name: z.string().describe("Name for the new group"), }, async ({ network, name }) => { try { const url = `https://api.pinata.cloud/v3/groups/${network}`; const response = await fetch(url, { method: "POST", headers: getHeaders(), body: JSON.stringify({ name }), }); if (!response.ok) { throw new Error( `Failed to create group: ${response.status} ${response.statusText}` ); } const data = await response.json(); return { content: [ { type: "text", text: `✅ Group created successfully!\n\n${JSON.stringify(data, null, 2)}`, }, ], }; } catch (error) { return errorResponse(error); } } );