Skip to main content
Glama

web3_challenge

Obtain a Sign-In with Ethereum (SIWE) challenge for a wallet address, the first step to generate a free API key using only a wallet. No browser or email required.

Instructions

Get a SIWE (Sign-In with Ethereum) challenge message for a wallet address. This is the first step to create a free API key using only a wallet — no browser or email required. The returned message must be signed with personal_sign (EIP-191), then submitted to web3_signup.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYesEthereum wallet address (e.g., '0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18')

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYesResult data object

Implementation Reference

  • src/index.ts:2073-2112 (registration)
    Registration of the web3_challenge tool via server.registerTool. Includes the tool name 'web3_challenge', description (SIWE challenge for wallet address), inputSchema (address), annotations, and the async handler.
    server.registerTool(
      "web3_challenge",
      {
        description:
          "Get a SIWE (Sign-In with Ethereum) challenge message for a wallet address. " +
          "This is the first step to create a free API key using only a wallet — no browser or email required. " +
          "The returned message must be signed with personal_sign (EIP-191), then submitted to web3_signup.",
        inputSchema: {
          address: z.string().describe("Ethereum wallet address (e.g., '0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18')"),
        },
        outputSchema: ObjectOutputSchema,
        annotations: AUTH_TOOL_ANNOTATIONS,
      },
      async (params: any) => {
        // This tool works even without an API key — it calls the unauthenticated challenge endpoint
        try {
          if (client) {
            const data = await api().web3.challenge(params.address);
            return formatResponse(data);
          }
          // If no client, make a direct fetch
          const response = await fetch("https://api.0xarchive.io/v1/auth/web3/challenge", {
            method: "POST",
            headers: { "Content-Type": "application/json" },
            body: JSON.stringify({ address: params.address }),
          });
          const data = await response.json();
          if (!response.ok) {
            return {
              content: [{ type: "text" as const, text: `Error: ${data.error || "Challenge request failed"}` }],
              isError: true,
            };
          }
          return formatResponse(data);
        } catch (err) {
          const error = err instanceof OxArchiveError ? err : new OxArchiveError(String(err), 500);
          return formatError(error);
        }
      }
    );
  • The handler function for web3_challenge. It first tries to call api().web3.challenge(params.address) if an SDK client exists, otherwise it makes a direct POST to https://api.0xarchive.io/v1/auth/web3/challenge with the address, returning the challenge message.
    async (params: any) => {
      // This tool works even without an API key — it calls the unauthenticated challenge endpoint
      try {
        if (client) {
          const data = await api().web3.challenge(params.address);
          return formatResponse(data);
        }
        // If no client, make a direct fetch
        const response = await fetch("https://api.0xarchive.io/v1/auth/web3/challenge", {
          method: "POST",
          headers: { "Content-Type": "application/json" },
          body: JSON.stringify({ address: params.address }),
        });
        const data = await response.json();
        if (!response.ok) {
          return {
            content: [{ type: "text" as const, text: `Error: ${data.error || "Challenge request failed"}` }],
            isError: true,
          };
        }
        return formatResponse(data);
      } catch (err) {
        const error = err instanceof OxArchiveError ? err : new OxArchiveError(String(err), 500);
        return formatError(error);
      }
    }
  • AUTH_TOOL_ANNOTATIONS — annotation helper marking web3 tools as non-read-only (since they create API keys). Used by web3_challenge registration.
    // Web3 tools are NOT read-only (they create accounts/keys)
    const AUTH_TOOL_ANNOTATIONS = {
      readOnlyHint: false,
      destructiveHint: false,
      idempotentHint: false,
      openWorldHint: true,
    } as const;
  • MISSING_KEY_MESSAGE constant that references web3_challenge (and web3_signup) in the setup instructions shown when no API key is configured.
    const MISSING_KEY_MESSAGE =
      `API key not configured. To use 0xArchive tools:\n\n` +
      `Option A — Browser signup:\n` +
      `1. Sign up at https://0xarchive.io and go to Dashboard to create an API key\n\n` +
      `Option B — Wallet signup (no browser needed):\n` +
      `1. Use the web3_challenge and web3_signup tools to get a free API key with your Ethereum wallet\n\n` +
      `Then reconfigure the MCP server with your key:\n\n` +
      `   claude mcp remove 0xarchive\n` +
      `   claude mcp add 0xarchive -s user -t stdio -e OXARCHIVE_API_KEY=0xa_your_api_key -- node /path/to/build/index.js\n\n` +
      `Start a new Claude Code session after configuring.\n\n` +
      `Free tier includes BTC historical data. Upgrade at https://0xarchive.io/pricing for all coins.`;
  • Input/output schemas for web3_challenge: inputSchema requires a single 'address' field (Ethereum wallet address string), outputSchema uses ObjectOutputSchema.
    {
      description:
        "Get a SIWE (Sign-In with Ethereum) challenge message for a wallet address. " +
        "This is the first step to create a free API key using only a wallet — no browser or email required. " +
        "The returned message must be signed with personal_sign (EIP-191), then submitted to web3_signup.",
      inputSchema: {
        address: z.string().describe("Ethereum wallet address (e.g., '0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18')"),
      },
      outputSchema: ObjectOutputSchema,
Behavior4/5

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

Beyond annotations (readOnlyHint=false, etc.), the description adds behavioral context: the tool generates a challenge message that must be signed via personal_sign (EIP-191) and then used in web3_signup. It clarifies that no browser or email is needed, which aids understanding of the interaction pattern.

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?

The description is two sentences long, front-loaded with the core purpose, and includes essential usage context. Every sentence adds value without redundancy.

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?

The tool is simple (one parameter) and has an output schema, so the description is largely complete. It could optionally mention challenge expiration or rate limits, but the current description is sufficient for correct usage.

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?

The input schema has 100% description coverage for the single 'address' parameter with a clear example. The description does not add further meaning to the parameter beyond the schema, so a baseline score of 3 is appropriate.

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 'Get a SIWE (Sign-In with Ethereum) challenge message for a wallet address,' specifying the verb (Get) and resource (SIWE challenge). It distinguishes itself from sibling tools like web3_signup by identifying it as the first step in the API key creation flow.

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 explains when to use the tool: 'first step to create a free API key using only a wallet — no browser or email required.' It also instructs that the returned message must be signed and submitted to web3_signup, providing a clear usage path. No alternatives are mentioned, but the context is sufficient.

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/0xArchiveIO/0xarchive-mcp'

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