Skip to main content
Glama

erc8128_sign_request

Sign HTTP requests using ERC-8128 to generate cryptographic headers (Signature-Input, Signature, Content-Digest) for secure authentication and integrity.

Instructions

Sign an HTTP request using ERC-8128 (RFC 9421 + EIP-191). Returns Signature-Input, Signature, and Content-Digest headers for the given HTTP method, URL, headers, and body.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
methodYesHTTP method
urlYesTarget URL to sign for
headersNoHTTP headers to include in signature
bodyNoRequest body (used for Content-Digest)
wallet_idNoTarget wallet ID. Required for multi-wallet sessions; auto-resolved when session has a single wallet.
networkNoNetwork ID (e.g., evm-ethereum-mainnet)
presetNoCovered Components preset (default: standard)
ttl_secondsNoSignature TTL in seconds (default: 300)

Implementation Reference

  • The registerErc8128SignRequest function registers the 'erc8128_sign_request' tool on the MCP server. The handler accepts parameters (method, url, headers, body, wallet_id, network, preset, ttl_seconds), builds a request body, and calls POST /v1/erc8128/sign via the ApiClient.
    export function registerErc8128SignRequest(
      server: McpServer,
      apiClient: ApiClient,
      walletContext?: WalletContext,
    ): void {
      server.tool(
        'erc8128_sign_request',
        withWalletPrefix(
          'Sign an HTTP request using ERC-8128 (RFC 9421 + EIP-191). Returns Signature-Input, Signature, and Content-Digest headers for the given HTTP method, URL, headers, and body.',
          walletContext?.walletName,
        ),
        {
          method: z.enum(['GET', 'POST', 'PUT', 'DELETE', 'PATCH']).describe('HTTP method'),
          url: z.string().url().describe('Target URL to sign for'),
          headers: z.record(z.string(), z.string()).optional().describe('HTTP headers to include in signature'),
          body: z.string().optional().describe('Request body (used for Content-Digest)'),
          wallet_id: z.string().optional().describe('Target wallet ID. Required for multi-wallet sessions; auto-resolved when session has a single wallet.'),
          network: z.string().optional().describe('Network ID (e.g., evm-ethereum-mainnet)'),
          preset: z.enum(['minimal', 'standard', 'strict']).optional().describe('Covered Components preset (default: standard)'),
          ttl_seconds: z.number().optional().describe('Signature TTL in seconds (default: 300)'),
        },
        async (args) => {
          const requestBody: Record<string, unknown> = {
            method: args.method,
            url: args.url,
          };
          if (args.headers) requestBody['headers'] = args.headers;
          if (args.body) requestBody['body'] = args.body;
          if (args.wallet_id) requestBody['walletId'] = args.wallet_id;
          if (args.network) requestBody['network'] = args.network;
          if (args.preset) requestBody['preset'] = args.preset;
          if (args.ttl_seconds !== undefined) requestBody['ttlSeconds'] = args.ttl_seconds;
          const result = await apiClient.post('/v1/erc8128/sign', requestBody);
          return toToolResult(result);
        },
      );
    }
  • Zod schema defintion for input validation: method (enum GET/POST/PUT/DELETE/PATCH), url (string-url), headers (optional record), body (optional string), wallet_id (optional), network (optional), preset (optional enum minimal/standard/strict), ttl_seconds (optional number).
    {
      method: z.enum(['GET', 'POST', 'PUT', 'DELETE', 'PATCH']).describe('HTTP method'),
      url: z.string().url().describe('Target URL to sign for'),
      headers: z.record(z.string(), z.string()).optional().describe('HTTP headers to include in signature'),
      body: z.string().optional().describe('Request body (used for Content-Digest)'),
      wallet_id: z.string().optional().describe('Target wallet ID. Required for multi-wallet sessions; auto-resolved when session has a single wallet.'),
      network: z.string().optional().describe('Network ID (e.g., evm-ethereum-mainnet)'),
      preset: z.enum(['minimal', 'standard', 'strict']).optional().describe('Covered Components preset (default: standard)'),
      ttl_seconds: z.number().optional().describe('Signature TTL in seconds (default: 300)'),
    },
  • Import of registerErc8128SignRequest from the tool module at line 47.
    import { registerErc8128SignRequest } from './tools/erc8128-sign-request.js';
    import { registerErc8128VerifySignature } from './tools/erc8128-verify-signature.js';
    import { registerListNfts } from './tools/list-nfts.js';
    import { registerGetNftMetadata } from './tools/get-nft-metadata.js';
    import { registerTransferNft } from './tools/transfer-nft.js';
    import { registerBuildUserop } from './tools/build-userop.js';
    import { registerSignUserop } from './tools/sign-userop.js';
    import { registerHyperliquidTools } from './tools/hyperliquid.js';
    import { registerPolymarketTools } from './tools/polymarket.js';
    import { registerListOffchainActions } from './tools/list-offchain-actions.js';
    import { registerListCredentials } from './tools/list-credentials.js';
    import { registerGetRpcProxyUrl } from './tools/get-rpc-proxy-url.js';
    import { registerResolveAsset } from './tools/resolve-asset.js';
    
    // Resource registrations (Task 2)
    import { registerWalletBalance } from './resources/wallet-balance.js';
    import { registerWalletAddress } from './resources/wallet-address.js';
    import { registerSystemStatus } from './resources/system-status.js';
    import { registerSkillResources } from './resources/skills.js';
    
    export interface WalletContext {
      walletName?: string; // e.g., 'trading-bot'
    }
    
    /**
     * Prefix description with wallet name for multi-wallet identification (MCPS-03).
     */
    export function withWalletPrefix(description: string, walletName?: string): string {
      return walletName ? `[${walletName}] ${description}` : description;
    }
    
    export function createMcpServer(apiClient: ApiClient, walletContext?: WalletContext): McpServer {
      const serverName = walletContext?.walletName
        ? `waiaas-${walletContext.walletName}`
        : 'waiaas-wallet';
    
      const server = new McpServer({
        name: serverName,
        version: PKG_VERSION,
      });
    
      // Register 42 tools
      registerConnectInfo(server, apiClient);
      registerListSessions(server, apiClient);
      registerGetPolicies(server, apiClient, walletContext);
      registerGetTokens(server, apiClient, walletContext);
      registerSendToken(server, apiClient, walletContext);
      registerGetBalance(server, apiClient, walletContext);
      registerGetAddress(server, apiClient, walletContext);
      registerGetAssets(server, apiClient, walletContext);
      registerListTransactions(server, apiClient, walletContext);
      registerGetTransaction(server, apiClient, walletContext);
      registerGetNonce(server, apiClient, walletContext);
      registerCallContract(server, apiClient, walletContext);
      registerApproveToken(server, apiClient, walletContext);
      registerSendBatch(server, apiClient, walletContext);
      registerGetWalletInfo(server, apiClient, walletContext);
      registerEncodeCalldata(server, apiClient, walletContext);
      registerSignTransaction(server, apiClient, walletContext);
      registerX402Fetch(server, apiClient, walletContext);
      registerWcConnect(server, apiClient, walletContext);
      registerWcStatus(server, apiClient, walletContext);
      registerWcDisconnect(server, apiClient, walletContext);
      registerListIncomingTransactions(server, apiClient, walletContext);
      registerGetIncomingSummary(server, apiClient, walletContext);
      registerGetDefiPositions(server, apiClient, walletContext);
      registerGetHealthFactor(server, apiClient, walletContext);
      registerSimulateTransaction(server, apiClient, walletContext);
      registerErc8004GetAgentInfo(server, apiClient, walletContext);
      registerErc8004GetReputation(server, apiClient, walletContext);
      registerErc8004GetValidationStatus(server, apiClient, walletContext);
      registerGetProviderStatus(server, apiClient, walletContext);
      registerSignMessage(server, apiClient, walletContext);
      registerErc8128SignRequest(server, apiClient, walletContext);
      registerErc8128VerifySignature(server, apiClient, walletContext);
      registerListNfts(server, apiClient, walletContext);
      registerGetNftMetadata(server, apiClient, walletContext);
      registerTransferNft(server, apiClient, walletContext);
      registerBuildUserop(server, apiClient, walletContext);
      registerSignUserop(server, apiClient, walletContext);
      registerHyperliquidTools(server, apiClient, walletContext);
      registerPolymarketTools(server, apiClient, walletContext);
      registerListOffchainActions(server, apiClient, walletContext);
      registerListCredentials(server, apiClient, walletContext);
  • Registration call inside createMcpServer: registerErc8128SignRequest(server, apiClient, walletContext) at line 120.
    registerErc8128SignRequest(server, apiClient, walletContext);
  • Uses apiClient.post('/v1/erc8128/sign', requestBody) to call the backend API, and toToolResult to convert the response to MCP CallToolResult format.
      const result = await apiClient.post('/v1/erc8128/sign', requestBody);
      return toToolResult(result);
    },
Behavior3/5

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

No annotations provided, so description carries full burden. It explains returns headers but does not disclose side effects, permissions, or state changes. Basic behavior is clear but lacks depth (e.g., does not mention if the request is actually sent).

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 the core action and output. Every sentence adds value with no 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?

For an 8-parameter tool with no output schema and no annotations, the description covers the main inputs and output headers. However, it omits details on presets, TTL, and wallet_id auto-resolution that would aid full understanding.

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% with clear per-parameter descriptions. The description adds the output header names but does not enhance parameter understanding beyond the schema.

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 signs an HTTP request using ERC-8128 (RFC 9421 + EIP-191) and specifies the returned headers (Signature-Input, Signature, Content-Digest). It distinguishes from the sibling tool erc8128_verify_signature by focusing on signing.

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?

No explicit guidance on when to use this tool versus alternatives like erc8128_verify_signature. The description implies usage for signing HTTP requests but lacks context on prerequisites or scenarios.

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/minhoyoo-iotrust/WAIaaS'

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