Skip to main content
Glama

sign_transaction

Signs raw unsigned blockchain transactions for EVM or Solana networks without broadcasting them, returning signed data, parsed operations, and policy evaluation results.

Instructions

Sign an unsigned transaction without broadcasting. Provide raw transaction (base64 for Solana, hex for EVM). Returns signed transaction, parsed operations, and policy evaluation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
transactionYesRaw unsigned transaction (base64 for Solana, hex 0x-prefixed for EVM)
networkNoTarget network (e.g., "polygon-mainnet" or CAIP-2 "eip155:137"). Required for EVM wallets; auto-resolved for Solana.
wallet_idNoTarget wallet ID. Required for multi-wallet sessions; auto-resolved when session has a single wallet.

Implementation Reference

  • The registration and handler implementation for the 'sign_transaction' MCP tool. It validates inputs via Zod and calls the API endpoint /v1/transactions/sign.
    export function registerSignTransaction(
      server: McpServer,
      apiClient: ApiClient,
      walletContext?: WalletContext,
    ): void {
      server.tool(
        'sign_transaction',
        withWalletPrefix(
          'Sign an unsigned transaction without broadcasting. Provide raw transaction (base64 for Solana, hex for EVM). Returns signed transaction, parsed operations, and policy evaluation.',
          walletContext?.walletName,
        ),
        {
          transaction: z.string().describe('Raw unsigned transaction (base64 for Solana, hex 0x-prefixed for EVM)'),
          network: z.string().optional().describe('Target network (e.g., "polygon-mainnet" or CAIP-2 "eip155:137"). Required for EVM wallets; auto-resolved for Solana.'),
          wallet_id: z.string().optional().describe('Target wallet ID. Required for multi-wallet sessions; auto-resolved when session has a single wallet.'),
        },
        async (args) => {
          const body: Record<string, unknown> = { transaction: args.transaction };
          if (args.network) {
            body['network'] = args.network;
          }
          if (args.wallet_id) body.walletId = args.wallet_id;
          const result = await apiClient.post('/v1/transactions/sign', body);
          return toToolResult(result);
        },
      );
    }

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