Skip to main content
Glama
buildwithgrove

Grove's MCP Server for Pocket Network

decode_hex

Convert hexadecimal strings into readable UTF-8 text, ASCII characters, or raw byte data for blockchain transaction analysis and data interpretation.

Instructions

Decode hex string to UTF-8, ASCII, and bytes

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hexYesHex string to decode

Implementation Reference

  • Handler execution logic for the 'decode_hex' tool. Extracts the 'hex' argument and delegates to AdvancedBlockchainService.decodeHex, then formats the response.
    case 'decode_hex': { const hex = args?.hex as string; const result = advancedBlockchain.decodeHex(hex); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], isError: !result.success, }; }
  • Input schema definition for the 'decode_hex' tool, specifying a required 'hex' string parameter.
    inputSchema: { type: 'object', properties: { hex: { type: 'string', description: 'Hex string to decode', }, }, required: ['hex'], },
  • Tool registration object defining name, description, and input schema for 'decode_hex' returned by registerUtilityHandlers.
    { name: 'decode_hex', description: 'Decode hex string to UTF-8, ASCII, and bytes', inputSchema: { type: 'object', properties: { hex: { type: 'string', description: 'Hex string to decode', }, }, required: ['hex'], }, },
  • Core implementation of hex decoding in AdvancedBlockchainService. Converts hex to bytes, then to UTF-8 and ASCII strings, returns structured response.
    decodeHex(hex: string): EndpointResponse { try { const cleanHex = hex.startsWith('0x') ? hex.slice(2) : hex; const bytes = Buffer.from(cleanHex, 'hex'); const utf8 = bytes.toString('utf8'); const ascii = bytes.toString('ascii'); return { success: true, data: { hex, utf8, ascii, bytes: Array.from(bytes), length: bytes.length, }, }; } catch (error) { return { success: false, error: error instanceof Error ? error.message : 'Failed to decode hex', }; } }

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/buildwithgrove/mcp-pocket'

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