Skip to main content
Glama
Frontier-Compute

Frontier-Compute/zcash-mcp

zcash_identity_register

Register an agent identity on the ZAP1 protocol by submitting an AGENT_REGISTER attestation with a unique agent ID and public key hash. Returns the leaf hash and verification URLs for the registration event.

Instructions

Register an agent identity on ZAP1 via an AGENT_REGISTER attestation. Returns the leaf hash and verification URLs for the registration event.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
agent_idYesUnique agent identifier to register
pubkey_hashYesSHA-256 of the agent's public key (64-char hex)

Implementation Reference

  • Async handler function that makes a POST request to ZAP1 API /attest with event_type AGENT_REGISTER, wallet_hash=agent_id, input_hash=pubkey_hash, and returns the JSON response or an error.
      async ({ agent_id, pubkey_hash }) => {
        try {
          const res = await fetch(`${ZAP1_API}/attest`, {
            method: "POST",
            headers: { "Content-Type": "application/json" },
            body: JSON.stringify({
              event_type: "AGENT_REGISTER",
              wallet_hash: agent_id,
              input_hash: pubkey_hash,
            }),
            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 defining inputs: agent_id (string, max 128 chars) and pubkey_hash (64-char hex string, SHA-256 of the agent's public key).
    {
      agent_id: z.string().max(128).describe("Unique agent identifier to register"),
      pubkey_hash: z.string().regex(/^[0-9a-fA-F]{64}$/, "pubkey_hash must be 64-char hex").describe("SHA-256 of the agent's public key (64-char hex)"),
    },
  • The registerIdentityTool function registers the 'zcash_identity_register' tool on the MCP server via server.tool().
    export function registerIdentityTool(server: McpServer) {
      server.tool(
        "zcash_identity_register",
        "Register an agent identity on ZAP1 via an AGENT_REGISTER attestation. Returns the leaf hash and verification URLs for the registration event.",
        {
          agent_id: z.string().max(128).describe("Unique agent identifier to register"),
          pubkey_hash: z.string().regex(/^[0-9a-fA-F]{64}$/, "pubkey_hash must be 64-char hex").describe("SHA-256 of the agent's public key (64-char hex)"),
        },
        async ({ agent_id, pubkey_hash }) => {
          try {
            const res = await fetch(`${ZAP1_API}/attest`, {
              method: "POST",
              headers: { "Content-Type": "application/json" },
              body: JSON.stringify({
                event_type: "AGENT_REGISTER",
                wallet_hash: agent_id,
                input_hash: pubkey_hash,
              }),
              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,
            };
          }
        }
      );
    }
  • src/index.ts:45-45 (registration)
    Top-level invocation of registerIdentityTool(server) to register the tool at server startup.
    registerIdentityTool(server);
  • Configuration constants: ZAP1_API base URL and API_TIMEOUT_MS used by the handler.
    const ZAP1_API = process.env.ZAP1_API_URL ?? "https://pay.frontiercompute.io";
    const API_TIMEOUT_MS = 15_000;
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. It mentions registration via attestation and returned outputs but does not describe side effects (e.g., whether it's idempotent, what happens if the agent_id already exists, permission requirements, or error conditions).

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 concise sentences front-load the purpose and return value. No unnecessary words or redundancy.

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

Completeness3/5

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

For a simple registration tool with two parameters and no output schema, the description covers purpose and return fields. However, it lacks context on uniqueness, failure scenarios, or relation to other tools, which would be helpful for an agent to use it correctly.

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?

Schema description coverage is 100%, so both parameters (agent_id, pubkey_hash) are documented in the schema. The tool description does not add further semantic meaning beyond what the schema already provides, achieving baseline score.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states the tool registers an agent identity on ZAP1 via a specific attestation type, and mentions return values (leaf hash, verification URLs). It distinguishes itself from sibling tools like zcash_create_invoice or zcash_shield which operate on different domains.

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?

No guidance on when to use this tool versus alternatives (e.g., get_agent_status for checking existing registration, or other identity-related tools). The description only states what it does, not the context or prerequisites.

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