getSignature
Retrieve signature verification details for IPFS content identifiers to authenticate and validate data integrity on public or private networks.
Instructions
Get signature details for a specific CID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| network | No | Whether the file is on public or private IPFS | public |
| cid | Yes | The CID to get the signature for |
Implementation Reference
- src/index.ts:1397-1428 (handler)Complete implementation of the getSignature tool that retrieves signature details for a specific CID from Pinata IPFS. Includes schema definition (network and cid parameters) and the async handler that makes a GET request to the Pinata API and returns the signature data.
server.tool( "getSignature", "Get signature details for a specific CID", { network: z .enum(["public", "private"]) .default("public") .describe("Whether the file is on public or private IPFS"), cid: z.string().describe("The CID to get the signature for"), }, async ({ network, cid }) => { try { const url = `https://api.pinata.cloud/v3/files/${network}/signature/${cid}`; const response = await fetch(url, { method: "GET", headers: getHeaders(), }); if (!response.ok) { throw new Error( `Failed to get signature: ${response.status} ${response.statusText}` ); } const data = await response.json(); return successResponse(data); } catch (error) { return errorResponse(error); } } );