Skip to main content
Glama

anchor_hash

Anchor a 32-byte hash to Base and Solana mainnets in one call, receiving transaction hashes and block-explorer URLs as cryptographic proof of existence.

Instructions

Anchor a 32-byte hash to BOTH Base mainnet (as EIP-1559 calldata) and Solana mainnet (via the Memo program) in a single call. Returns both transaction hashes plus block-explorer URLs as cryptographic proof of when the hash existed. Pure infrastructure — no opinions about content. Use for DAO vote receipts, AI decision attestations, contract notarization, scientific data integrity, audit trails. $0.005 USDC.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hashNoPre-computed 32-byte hex hash (64 chars, no 0x prefix). Mutually exclusive with `data`.
dataNoArbitrary JSON to be canonicalized + SHA-256'd by the server. Mutually exclusive with `hash`.
noteNoOptional 200-char note included in the response (NOT on-chain).

Implementation Reference

  • Tool definition and inputSchema for the 'anchor_hash' tool. Defines three optional inputs: hash (64-char hex), data (arbitrary JSON), and note (200-char string). The description explains it anchors a 32-byte hash to both Base and Solana mainnets.
    {
      name: "anchor_hash",
      description:
        "Anchor a 32-byte hash to BOTH Base mainnet (as EIP-1559 calldata) and Solana mainnet (via the Memo program) in a single call. Returns both transaction hashes plus block-explorer URLs as cryptographic proof of when the hash existed. Pure infrastructure — no opinions about content. Use for DAO vote receipts, AI decision attestations, contract notarization, scientific data integrity, audit trails. $0.005 USDC.",
      inputSchema: {
        type: "object",
        properties: {
          hash: {
            type: "string",
            description: "Pre-computed 32-byte hex hash (64 chars, no 0x prefix). Mutually exclusive with `data`.",
          },
          data: {
            description: "Arbitrary JSON to be canonicalized + SHA-256'd by the server. Mutually exclusive with `hash`.",
          },
          note: {
            type: "string",
            description: "Optional 200-char note included in the response (NOT on-chain).",
          },
        },
      },
  • index.js:202-204 (registration)
    Registration of all tools (including anchor_hash) via ListToolsRequestSchema handler. Returns the TOOLS array which contains the anchor_hash definition.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: TOOLS,
    }));
  • Handler logic for 'anchor_hash' inside the buildRequest switch statement. Constructs a POST request to `${BASE_URL}/v1/anchor` with optional hash, data, and note fields in the JSON body. This is the core function that executes the anchor_hash tool logic by building the API request.
    case "anchor_hash":
      return {
        url: `${BASE_URL}/v1/anchor`,
        opts: {
          method: "POST",
          headers: { "Content-Type": "application/json" },
          body: JSON.stringify({
            ...(args.hash !== undefined ? { hash: args.hash } : {}),
            ...(args.data !== undefined ? { data: args.data } : {}),
            ...(args.note ? { note: String(args.note).slice(0, 200) } : {}),
          }),
        },
      };
  • The CallToolRequestSchema handler that dispatches all tool calls via buildRequest(), then executes the request using a payment-enabled fetch (paidFetch) and returns the JSON response. Used by all tools including anchor_hash.
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      const { name, arguments: args = {} } = request.params;
      let req;
      try {
        req = buildRequest(name, args);
      } catch (err) {
        return {
          content: [{ type: "text", text: `Error: ${err.message}` }],
          isError: true,
        };
      }
    
      try {
        const res = await paidFetch(req.url, req.opts);
    
        if (res.status === 402) {
          const body = await res.text().catch(() => "");
          const msg = paymentEnabled
            ? `Payment failed (402). The wallet may be out of USDC on Base, or the x402 facilitator rejected the payload.\n\nResponse body: ${body.slice(0, 300)}`
            : `Payment required (402). Set ANCHOR_WALLET_PRIVATE_KEY in your MCP config so this server can pay automatically:\n\n  "env": {\n    "ANCHOR_WALLET_PRIVATE_KEY": "0xYOUR_BASE_WALLET_PRIVATE_KEY"\n  }\n\nFund the wallet with USDC on Base (any amount > $0.05 is plenty). The wallet pays $0.001–$0.010 per call.\n\nResponse body: ${body.slice(0, 300)}`;
          return { content: [{ type: "text", text: msg }], isError: true };
        }
    
        if (!res.ok) {
          const body = await res.text().catch(() => "");
          return {
            content: [{ type: "text", text: `anchor-x402 returned ${res.status}: ${body.slice(0, 500)}` }],
            isError: true,
          };
        }
    
        const data = await res.json();
        return {
          content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
        };
      } catch (err) {
        return {
          content: [{ type: "text", text: `anchor-x402 request failed: ${err.message}` }],
          isError: true,
        };
      }
    });
Behavior3/5

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

No annotations are provided, so the description must disclose behavioral traits. It mentions the cost ($0.005 USDC), the dual-chain anchoring, and that it returns transaction hashes and URLs. It states 'pure infrastructure — no opinions about content', but does not discuss permanence, reversibility, or potential errors. This is adequate but not highly detailed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single paragraph that front-loads the core purpose, then details returns, use cases, and cost. It is dense but not overly long. Minor redundancy ('Pure infrastructure') could be trimmed, but overall it is efficient.

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

Completeness4/5

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

Given the tool has no output schema, the description explains the return values (both transaction hashes plus block-explorer URLs). It covers intended use cases, cost, and behavior. It lacks details about prerequisites (e.g., needing USDC balance) or error scenarios, but for a simple tool with three parameters it is reasonably complete.

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 covers all 3 parameters with full descriptions. The description adds meaning: it clarifies that 'data' is canonicalized and SHA-256'd by the server, and that 'note' is optional and off-chain. This goes beyond the schema, which only describes the 'hash' parameter's format and mutual exclusivity.

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?

The description clearly states the tool's purpose: anchoring a 32-byte hash to both Base mainnet and Solana mainnet in a single call. It specifies the verb 'anchor' and the resource (hash), and distinguishes from siblings like 'attest_decision' which likely handles decision attestations rather than generic hash anchoring.

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

Usage Guidelines4/5

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

The description provides explicit use cases (DAO vote receipts, AI decision attestations, etc.), giving clear context for when to use the tool. However, it does not explicitly mention when not to use alternatives or compare to sibling tools like 'attest_decision'.

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/hypeprinter007-stack/anchor-x402-mcp'

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