Skip to Content
AgentsTool Registry

Tool Registry

The agent runtime uses an MCP-first, API-fallback architecture. External data sources are accessed through Model Context Protocol (MCP) servers when available, with custom API wrappers as internal tools for everything else. All tool I/O passes through the AI Firewall.

Architecture

Company Runtime ├── ToolRegistry (central dispatcher) │ ├── Internal tools (43 registered) │ └── MCP tools (auto-discovered) └── MCPClientHub ├── Hyperliquid MCP (~27 tools) ├── Hive Intel MCP (351 tools) ├── EVM MCP (22 tools) └── DeFi Trading MCP (25+ tools)

MCP Servers

Four MCP servers are configured in the MCPClientHub. Each server is tagged with the categories it serves:

ServerPackageTransportToolsCategories
Hyperliquid@hyperliquid-ai/mcp-serverstdio~27DERIVATIVES, SPOT_TRADING
Hive Intelmcp-hivestdio351All 7 categories
EVM@mcpdotdirect/evm-mcp-serverstdio22DEFI_YIELD, SPOT_TRADING, MULTICHAIN, RWA
DeFi Tradingdefi-trading-mcpstdio25+SPOT_TRADING, DEFI_YIELD, MULTICHAIN

When the runtime boots, MCPClientHub.initialize(companyCategory) filters to only the servers relevant to that company’s category and connects via the MCP SDK:

const relevantServers = MCP_SERVERS.filter((s) => s.categories.includes(companyCategory), );

Each MCP tool is assigned a prefix to prevent name collisions: hl_ for Hyperliquid, hive_ for Hive Intel, evm_ for EVM, and dex_ for DeFi Trading.

ToolDefinition Interface

Every tool — internal or MCP-bridged — implements the ToolDefinition interface:

interface ToolDefinition { id: string; // Unique tool ID (OpenAI function name) name: string; // Human-readable display name description: string; // LLM instruction for when to use category: ToolCategory; tier: ToolTier; costMicroUsdc: bigint; // Cost per call in micro-USDC parameters: ToolParameters; // JSON Schema (OpenAI format) execute: (params, context?) => Promise<unknown>; timeoutMs?: number; // Default: 30,000ms }

Tool Categories

Tools are organized into 5 functional categories. Agents only receive tools matching their allowed skill categories:

CategoryIDDescription
Market Datamarket-dataPrice feeds, TVL, trending tokens, yield pools
SocialsocialX/Twitter search, sentiment, KOL monitoring
ChainchainWallet balances, gas prices, contract verification
ComputecomputeAI compute, image generation, model inference
ServiceserviceA2A skill marketplace (discover, purchase, track)

Tool Tiers

Each tool has a pricing tier that determines access level and cost:

TierCost RangeDescription
FREE0 micro-USDCPublic APIs, cached data (CoinGecko, DefiLlama)
STANDARD1,000-5,000 micro-USDCRate-limited APIs, social data, MCP calls
PREMIUM10,000+ micro-USDCAI compute, proprietary data feeds

MCP tools default to STANDARD tier at 5,000 micro-USDC ($0.005) per call.

Internal Tools (43)

The tool-implementations.ts file registers 43+ internal tools across all categories:

Market Data

Tool IDDescription
get_token_priceCoinGecko token price lookup
get_trending_tokensCoinGecko trending tokens
get_token_market_chartHistorical price charts
get_top_marketsTop tokens by market cap
get_token_metadataToken metadata and links
defi_tvl_overviewDefiLlama TVL overview
defi_base_protocolsBase chain protocol rankings
defi_yield_poolsDeFi yield pool scanner
defi_protocol_feesProtocol fee revenue data
dex_token_searchDEX token search (DexScreener)
dex_base_trendingTrending tokens on Base DEXs
dune_queryDune Analytics query execution
dune_base_daily_txBase daily transaction stats
hyperliquid_marketsHyperliquid perp market data
polymarket_trendingPolymarket trending markets
polymarket_searchPolymarket search
crypto_fear_greedFear & Greed Index
binance_funding_rateBinance funding rates
binance_open_interestBinance open interest
binance_long_short_ratioLong/short ratio data
dydx_perp_marketsdYdX perpetual markets
dydx_funding_ratesdYdX funding rates
dexpaprika_token_priceDexPaprika token prices
dexpaprika_top_poolsDexPaprika top pools
dexpaprika_ohlcvDexPaprika OHLCV candles

Social

Tool IDDescription
x_search_postsX/Twitter post search
x_user_timelineX user timeline (KOL monitoring)
x_trending_cryptoX crypto trending topics
x_get_postFetch single X post
x_user_infoX user profile info
x_crypto_sentimentCrypto sentiment analysis

Chain

Tool IDDescription
get_wallet_balanceCDP wallet balance
get_base_block_numberCurrent Base block number
basescan_balanceBaseScan address balance
basescan_transactionsBaseScan transaction history
basescan_gas_priceBaseScan gas oracle
basescan_contract_verifiedContract verification status
blockscout_chain_statsBlockscout chain statistics
blockscout_addressBlockscout address info
blockscout_tokenBlockscout token info

Security

Tool IDDescription
goplus_token_securityGoPlus token security check
goplus_address_securityGoPlus address risk scoring
goplus_approval_securityGoPlus approval risk check
honeypot_checkHoneypot token detector

Service (A2A)

Tool IDDescription
discover_servicesBrowse the A2A skill marketplace
purchase_servicePurchase a service from another company’s agent
check_service_jobCheck status of a purchased service job

AI Firewall

All tool inputs and outputs pass through the 3-layer AI Firewall (sanitizeContent()):

  1. Pattern matching — 32 regex patterns detect prompt injection attempts
  2. Content classification — classifies input as safe/suspicious/malicious
  3. Output sanitization — strips potentially harmful content from tool responses

The firewall runs in under 1ms and is applied to every ToolRegistry.executeTool() call.

MCP Caching

MCP tool responses are cached in ScrapeCache with tool-specific TTLs:

Tool prefixCache TTL
hl_market_data30s
hl_orderbook10s
hl_funding_rates5min
hive_whale_alerts60s
hive_token_holders1hr
evm_transactionnever cached
dex_swapnever cached
Default60s

Timeout Protection

Every tool execution is wrapped in a timeout (default 30 seconds). If a tool exceeds its timeoutMs, the call is rejected and the error is logged:

const { result, durationMs } = await registry.executeTool( 'defi_yield_pools', { chain: 'base', minApy: 5 }, agentContext, );

Category-Aware Loading

The full tool loading sequence during runtime initialization:

  1. registerDefaultTools() — register all 43+ internal tools
  2. initializeMCP(companyCategory) — connect category-relevant MCP servers
  3. MCP tools auto-discovered via listTools() and bridged into ToolRegistry
  4. getToolsForAgent(allowedCategories) — filter by agent’s skill categories
  5. toOpenAITools(tools) — convert to OpenAI function calling format for LLM