Skip to main content
Glama
Frontier-Compute

Frontier-Compute/zcash-mcp

zcash_prove_payment

Prove payment inclusion on-chain by fetching a ZAP1 Merkle proof bundle for a leaf hash. Returns leaf, path, root, and anchor.

Instructions

Fetch a ZAP1 Merkle proof bundle for a leaf hash. Returns the full proof: leaf, path, root, and anchor. Use this to prove payment inclusion on-chain.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
leaf_hashYesHex-encoded leaf hash (64 chars)

Implementation Reference

  • Handler function that fetches a ZAP1 Merkle proof bundle from the API for a given leaf hash and returns it as JSON.
      async ({ leaf_hash }) => {
        try {
          const res = await fetch(`${ZAP1_API}/verify/${leaf_hash}/proof.json`, {
            signal: AbortSignal.timeout(API_TIMEOUT_MS),
          });
    
          if (!res.ok) {
            const text = await res.text();
            throw new Error(`${res.status}: ${text}`);
          }
    
          const data = await res.json();
          return {
            content: [
              {
                type: "text" as const,
                text: JSON.stringify(data, null, 2),
              },
            ],
          };
        } catch (err) {
          const msg = err instanceof Error ? err.message : String(err);
          return {
            content: [{ type: "text" as const, text: `Error: ${msg}` }],
            isError: true,
          };
        }
      }
    );
  • Zod schema for the tool input: leaf_hash must be a 64-character hex string.
    {
      leaf_hash: z.string().regex(/^[0-9a-fA-F]{64}$/, "leaf_hash must be 64-char hex").describe("Hex-encoded leaf hash (64 chars)"),
    },
  • Registration of the 'zcash_prove_payment' tool on the MCP server via server.tool().
    export function registerReceiptTool(server: McpServer) {
      server.tool(
        "zcash_prove_payment",
        "Fetch a ZAP1 Merkle proof bundle for a leaf hash. Returns the full proof: leaf, path, root, and anchor. Use this to prove payment inclusion on-chain.",
        {
          leaf_hash: z.string().regex(/^[0-9a-fA-F]{64}$/, "leaf_hash must be 64-char hex").describe("Hex-encoded leaf hash (64 chars)"),
        },
        async ({ leaf_hash }) => {
          try {
            const res = await fetch(`${ZAP1_API}/verify/${leaf_hash}/proof.json`, {
              signal: AbortSignal.timeout(API_TIMEOUT_MS),
            });
    
            if (!res.ok) {
              const text = await res.text();
              throw new Error(`${res.status}: ${text}`);
            }
    
            const data = await res.json();
            return {
              content: [
                {
                  type: "text" as const,
                  text: JSON.stringify(data, null, 2),
                },
              ],
            };
          } catch (err) {
            const msg = err instanceof Error ? err.message : String(err);
            return {
              content: [{ type: "text" as const, text: `Error: ${msg}` }],
              isError: true,
            };
          }
        }
      );
    }
Behavior4/5

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

With no annotations, the description carries full burden. It discloses the output components (leaf, path, root, anchor) clearly. No side effects or auth needs are mentioned, but for a simple fetch tool this is sufficient.

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?

Two sentences, front-loaded with action, no wasted words. Every sentence adds value.

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

Completeness5/5

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

For a simple tool with one parameter and no output schema, the description is complete: it states what it does, what it returns, and the purpose. No gaps.

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?

Input schema covers the single parameter (leaf_hash) with pattern and description, achieving 100% coverage. The description adds no additional parameter meaning, so baseline 3 is appropriate.

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?

Description clearly states it fetches a ZAP1 Merkle proof bundle, with specific verb 'Fetch' and resource. It also mentions the purpose to prove payment inclusion on-chain. However, it does not explicitly distinguish from sibling tools like verify_proof.

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

Usage Guidelines3/5

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

Description implies when to use (to prove payment inclusion) but lacks explicit guidance on when not to use or alternative tools. No exclusions or context provided beyond a single sentence.

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/Frontier-Compute/zcash-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server