Skip to main content
Glama

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
NameRequiredDescriptionDefault
networkNoWhether to create the group in public or private IPFSpublic
nameYesName for the new group

Implementation Reference

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

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