Skip to main content
Glama

erc8128_sign_request

Sign HTTP requests with ERC-8128 signatures to authenticate and secure API calls using wallet-based cryptography.

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 handler function for the erc8128_sign_request tool that prepares the request and calls the backend API.
      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);
      },
    );
  • The registration function registerErc8128SignRequest that adds the tool to the MCP server.
    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,
        ),
  • The Zod schema definition for the input parameters of the erc8128_sign_request tool.
    {
      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()).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)'),
    },

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