Skip to main content
Glama

testAuthentication

Verify Pinata JWT authentication status to ensure API access for IPFS file operations.

Instructions

Verify that your Pinata JWT is valid and working

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • src/index.ts:130-163 (registration)
    Tool registration and handler for testAuthentication - verifies Pinata JWT validity by making a GET request to the Pinata API
    server.tool(
      "testAuthentication",
      "Verify that your Pinata JWT is valid and working",
      {},
      async () => {
        try {
          const response = await fetch(
            "https://api.pinata.cloud/data/testAuthentication",
            {
              method: "GET",
              headers: getHeaders(),
            }
          );
    
          if (!response.ok) {
            throw new Error(
              `Authentication failed: ${response.status} ${response.statusText}`
            );
          }
    
          const data = await response.json();
          return {
            content: [
              {
                type: "text",
                text: `✅ Authentication successful!\n\n${JSON.stringify(data, null, 2)}`,
              },
            ],
          };
        } catch (error) {
          return errorResponse(error);
        }
      }
    );
  • Handler function that executes the authentication test by calling Pinata's testAuthentication API endpoint
    async () => {
      try {
        const response = await fetch(
          "https://api.pinata.cloud/data/testAuthentication",
          {
            method: "GET",
            headers: getHeaders(),
          }
        );
    
        if (!response.ok) {
          throw new Error(
            `Authentication failed: ${response.status} ${response.statusText}`
          );
        }
    
        const data = await response.json();
        return {
          content: [
            {
              type: "text",
              text: `✅ Authentication successful!\n\n${JSON.stringify(data, null, 2)}`,
            },
          ],
        };
      } catch (error) {
        return errorResponse(error);
      }
    }
  • Helper function that constructs headers with Bearer token authentication using PINATA_JWT environment variable
    const getHeaders = () => {
      if (!PINATA_JWT) {
        throw new Error("PINATA_JWT environment variable is not set");
      }
      return {
        Authorization: `Bearer ${PINATA_JWT}`,
        "Content-Type": "application/json",
      };
    };
  • Helper function that formats error responses in a consistent MCP format
    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?

No annotations are provided, so the description carries the full burden. It states the tool verifies JWT validity, implying a read-only, non-destructive operation, but doesn't disclose behavioral traits like error handling, rate limits, or response format. For a tool with zero annotation coverage, this is a significant gap in transparency.

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, clear sentence: 'Verify that your Pinata JWT is valid and working.' It's front-loaded with the core purpose, has no wasted words, and is appropriately sized for a simple tool.

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 simplicity (0 parameters, no output schema, no annotations), the description is minimal. It states the purpose but lacks context on usage, behavioral details, or output expectations. For a tool in a server with many authentication-related siblings, more completeness is needed to guide the agent effectively.

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

Parameters4/5

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

The input schema has 0 parameters with 100% coverage, so no parameters need documentation. The description doesn't add parameter details, which is acceptable here. Baseline is 4 for zero parameters, as there's nothing to compensate for.

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 tool's purpose: 'Verify that your Pinata JWT is valid and working.' It specifies the action (verify) and the resource (Pinata JWT), making it easy to understand. However, it doesn't explicitly differentiate from sibling tools, which include various authentication-related tools like 'createSignedUploadUrl' or 'addSignature,' so it misses the top score.

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, such as needing a JWT to test, or compare it to other tools like 'createSignedUploadUrl' for authentication setup. This leaves the agent without context for tool selection.

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