Skip to main content
Glama

addSignature

Attach EIP-712 cryptographic signatures to CIDs for content verification and authentication on IPFS networks.

Instructions

Add an EIP-712 cryptographic signature to a CID for content verification

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
networkNoWhether the file is on public or private IPFSpublic
cidYesThe CID to sign
signatureYesThe EIP-712 signature
addressYesThe wallet address that created the signature

Implementation Reference

  • Complete implementation of the 'addSignature' tool. It registers and implements an MCP tool that adds an EIP-712 cryptographic signature to a CID for content verification on Pinata. The tool accepts parameters for network (public/private), cid, signature, and address, then makes a POST request to the Pinata API endpoint.
    server.tool(
      "addSignature",
      "Add an EIP-712 cryptographic signature to a CID for content verification",
      {
        network: z
          .enum(["public", "private"])
          .default("public")
          .describe("Whether the file is on public or private IPFS"),
        cid: z.string().describe("The CID to sign"),
        signature: z.string().describe("The EIP-712 signature"),
        address: z.string().describe("The wallet address that created the signature"),
      },
      async ({ network, cid, signature, address }) => {
        try {
          const url = `https://api.pinata.cloud/v3/files/${network}/signature/${cid}`;
    
          const response = await fetch(url, {
            method: "POST",
            headers: getHeaders(),
            body: JSON.stringify({ signature, address }),
          });
    
          if (!response.ok) {
            const errorText = await response.text();
            throw new Error(
              `Failed to add signature: ${response.status} ${response.statusText}\n${errorText}`
            );
          }
    
          const data = await response.json();
          return {
            content: [
              {
                type: "text",
                text: `✅ Signature added 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