Skip to main content
Glama

queryPinRequests

Check the status of IPFS content pinning requests by CID, filter by status, sort results, and manage pagination for tracking file storage on the Pinata network.

Instructions

Query the status of pin by CID requests

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
orderNoSort by date_queued
statusNoFilter by status
cidNoFilter by CID
limitNoLimit number of results
pageTokenNoToken for pagination

Implementation Reference

  • src/index.ts:1616-1670 (registration)
    Registration and handler implementation for queryPinRequests tool that queries the status of pin by CID requests. The tool accepts parameters for filtering by order (ASC/DESC), status, cid, limit, and pageToken, and makes a GET request to Pinata's API to retrieve pin request status information.
    server.tool(
      "queryPinRequests",
      "Query the status of pin by CID requests",
      {
        order: z
          .enum(["ASC", "DESC"])
          .optional()
          .describe("Sort by date_queued"),
        status: z
          .enum([
            "prechecking",
            "backfilled",
            "retreiving",
            "expired",
            "searching",
            "over_free_limit",
            "over_max_size",
            "invalid_object",
            "bad_host_node",
          ])
          .optional()
          .describe("Filter by status"),
        cid: z.string().optional().describe("Filter by CID"),
        limit: z.number().optional().describe("Limit number of results"),
        pageToken: z.string().optional().describe("Token for pagination"),
      },
      async ({ order, status, cid, limit, pageToken }) => {
        try {
          const params = new URLSearchParams();
          if (order) params.append("order", order);
          if (status) params.append("status", status);
          if (cid) params.append("cid", cid);
          if (limit) params.append("limit", limit.toString());
          if (pageToken) params.append("pageToken", pageToken);
    
          const url = `https://api.pinata.cloud/v3/files/public/pin_by_cid?${params.toString()}`;
    
          const response = await fetch(url, {
            method: "GET",
            headers: getHeaders(),
          });
    
          if (!response.ok) {
            throw new Error(
              `Failed to query pin requests: ${response.status} ${response.statusText}`
            );
          }
    
          const data = await response.json();
          return successResponse(data);
        } catch (error) {
          return errorResponse(error);
        }
      }
    );
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure but offers minimal information. It states the tool queries status, implying a read-only operation, but doesn't clarify if it requires authentication, has rate limits, returns paginated results (though 'pageToken' in schema hints at this), or what happens on errors. For a query tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 with zero waste—it directly states the tool's purpose without redundancy. It's appropriately sized for a query tool and front-loaded with essential information, making it easy to parse quickly.

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?

Given the tool's complexity (5 parameters, no annotations, no output schema), the description is incomplete. It doesn't explain the return format (e.g., list of requests with fields), error handling, or authentication needs. While the schema covers parameters well, the lack of behavioral context and output details leaves the agent with insufficient information for reliable use.

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?

The schema description coverage is 100%, with clear descriptions for all parameters (e.g., 'order' sorts by date_queued, 'status' filters by status). The description adds no additional parameter semantics beyond what the schema provides, such as explaining 'cid' filtering specifics or 'limit' defaults. Baseline score of 3 is appropriate as the schema adequately documents parameters.

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 action ('Query') and resource ('status of pin by CID requests'), making the purpose understandable. It distinguishes itself from siblings like 'pinByCid' or 'cancelPinRequest' by focusing on querying status rather than creating or modifying requests. However, it lacks specificity about what 'status' entails (e.g., pending, completed) beyond the enum values in the schema.

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 provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing existing pin requests), exclusions, or comparisons to sibling tools like 'listPaymentInstructionCids' or 'searchFiles' that might overlap in querying data. Usage is implied only through the tool name and description context.

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