Skip to main content
Glama

listGroups

Retrieve and filter groups from your Pinata IPFS account to organize and manage stored content efficiently.

Instructions

List groups in your Pinata account with optional filtering by name

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
networkNoWhether to list groups in public or private IPFSpublic
nameNoFilter groups by name
limitNoMaximum number of results to return
pageTokenNoToken for pagination

Implementation Reference

  • Main implementation of the listGroups tool. Registers the MCP tool with schema validation for network (public/private), name filter, limit, and pageToken parameters. The handler builds query parameters and makes a GET request to the Pinata API to list groups.
    server.tool(
      "listGroups",
      "List groups in your Pinata account with optional filtering by name",
      {
        network: z
          .enum(["public", "private"])
          .default("public")
          .describe("Whether to list groups in public or private IPFS"),
        name: z.string().optional().describe("Filter groups by name"),
        limit: z
          .number()
          .optional()
          .describe("Maximum number of results to return"),
        pageToken: z.string().optional().describe("Token for pagination"),
      },
      async ({ network, name, limit, pageToken }) => {
        try {
          const params = new URLSearchParams();
          if (name) params.append("name", name);
          if (limit) params.append("limit", limit.toString());
          if (pageToken) params.append("pageToken", pageToken);
    
          const url = `https://api.pinata.cloud/v3/groups/${network}?${params.toString()}`;
    
          const response = await fetch(url, {
            method: "GET",
            headers: getHeaders(),
          });
    
          if (!response.ok) {
            throw new Error(
              `Failed to list groups: ${response.status} ${response.statusText}`
            );
          }
    
          const data = await response.json();
          return successResponse(data);
        } catch (error) {
          return errorResponse(error);
        }
      }
    );
  • getHeaders() helper function that constructs authorization headers for Pinata API requests, used by listGroups handler to authenticate API calls.
    const getHeaders = () => {
      if (!PINATA_JWT) {
        throw new Error("PINATA_JWT environment variable is not set");
      }
      return {
        Authorization: `Bearer ${PINATA_JWT}`,
        "Content-Type": "application/json",
      };
    };
  • successResponse() helper function that formats successful API responses as MCP content with JSON formatting, used by listGroups to return group data.
    const successResponse = (data: unknown) => ({
      content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }],
    });
  • errorResponse() helper function that formats error messages for MCP content, used by listGroups to handle and return API errors.
    const errorResponse = (error: unknown) => ({
      content: [
        {
          type: "text" as const,
          text: `Error: ${error instanceof Error ? error.message : String(error)}`,
        },
      ],
      isError: true,
    });
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions filtering but doesn't describe pagination behavior (implied by 'pageToken' parameter), rate limits, authentication requirements, or what the output looks like. For a list operation with 4 parameters, this leaves significant gaps in understanding how the tool behaves.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that states the core purpose upfront with no wasted words. It's appropriately sized for a list operation and gets straight to the point without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 4 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain the return format, pagination behavior, error conditions, or how the 'network' parameter affects results. The agent would need to guess about important behavioral aspects of this list operation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents all 4 parameters. The description adds minimal value by mentioning 'optional filtering by name' which corresponds to one parameter, but doesn't provide additional context beyond what's in the schema. This meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('List') and resource ('groups in your Pinata account'), making the purpose unambiguous. It distinguishes from siblings like 'getGroup' (singular) by indicating it returns multiple groups. However, it doesn't explicitly differentiate from other list tools like 'listPaymentInstructions' beyond the resource type.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description mentions 'optional filtering by name' but provides no guidance on when to use this tool versus alternatives like 'searchFiles' or 'getGroup'. There's no indication of prerequisites, typical use cases, or when not to use it. The agent must infer usage from the tool name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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