Skip to main content
Glama
chainfetch

ChainFETCH MCP Server

Official
by chainfetch

search_tokens_json

Search for blockchain tokens using multiple parameters including name, symbol, address, token type, and holder count ranges to filter and retrieve token data.

Instructions

JSON search for tokens with comprehensive search parameters

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoToken name
symbolNoToken symbol
addressNoToken contract address
typeNoToken type (ERC-20, ERC-721, ERC-1155)
holders_count_minNoMinimum holder count
holders_count_maxNoMaximum holder count
limitNoNumber of results to return (default: 10, max: 50)
offsetNoNumber of results to skip for pagination (default: 0)

Implementation Reference

  • Handler implementation for the 'search_tokens_json' tool. Executes by calling the ChainFETCH API endpoint '/api/v1/ethereum/tokens/json_search' with the provided arguments using the shared makeRequest helper.
    case 'search_tokens_json': return await this.makeRequest('/api/v1/ethereum/tokens/json_search', 'GET', args, null, token);
  • Input schema definition for the 'search_tokens_json' tool, including properties for filtering tokens by name, symbol, address, type, holder counts, and pagination.
    { name: 'search_tokens_json', description: 'JSON search for tokens with comprehensive search parameters', inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Token name', }, symbol: { type: 'string', description: 'Token symbol', }, address: { type: 'string', description: 'Token contract address', }, type: { type: 'string', description: 'Token type (ERC-20, ERC-721, ERC-1155)', }, holders_count_min: { type: 'integer', description: 'Minimum holder count', }, holders_count_max: { type: 'integer', description: 'Maximum holder count', }, limit: { type: 'integer', description: 'Number of results to return (default: 10, max: 50)', default: 10, }, offset: { type: 'integer', description: 'Number of results to skip for pagination (default: 0)', default: 0, }, }, required: [], }, },
  • index.js:37-608 (registration)
    Registration of all tools including 'search_tokens_json' in the MCP server's listTools request handler.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: [ // Address endpoints { name: 'search_addresses_semantic', description: 'Semantic search for Ethereum addresses using AI-powered vector similarity matching', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'The query to search for', }, limit: { type: 'integer', description: 'The number of results to return (default: 10)', default: 10, }, }, required: ['query'], }, }, { name: 'search_addresses_json', description: 'JSON search for addresses with 150+ parameters for comprehensive filtering', inputSchema: { type: 'object', properties: { eth_balance_min: { type: 'string', description: 'Minimum ETH balance (in ETH, e.g., "1.5")', }, eth_balance_max: { type: 'string', description: 'Maximum ETH balance (in ETH, e.g., "10.0")', }, is_contract: { type: 'boolean', description: 'Whether the address is a contract', }, is_verified: { type: 'boolean', description: 'Whether the address is verified', }, has_token_transfers: { type: 'boolean', description: 'Whether the address has token transfers', }, transactions_count_min: { type: 'integer', description: 'Minimum transactions count', }, transactions_count_max: { type: 'integer', description: 'Maximum transactions count', }, limit: { type: 'integer', description: 'Number of results to return (default: 10, max: 50)', default: 10, }, offset: { type: 'integer', description: 'Number of results to skip for pagination (default: 0)', default: 0, }, }, required: [], }, }, { name: 'search_addresses_llm', description: 'LLM-powered address search using LLaMA 3.2 3B to intelligently select from 150+ parameters', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Natural language query for address search', }, }, required: ['query'], }, }, { name: 'get_address_summary', description: 'Get AI-generated summary for a specific address', inputSchema: { type: 'object', properties: { address_hash: { type: 'string', description: 'The address hash to get summary for', }, }, required: ['address_hash'], }, }, { name: 'get_address_info', description: 'Get detailed information about a specific Ethereum address', inputSchema: { type: 'object', properties: { address: { type: 'string', description: 'The address hash to get info for', }, }, required: ['address'], }, }, // Transaction endpoints { name: 'search_transactions_semantic', description: 'Semantic search for transactions using AI-powered vector similarity matching', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'The query to search for', }, limit: { type: 'integer', description: 'The number of results to return (default: 10)', default: 10, }, }, required: ['query'], }, }, { name: 'search_transactions_json', description: 'JSON search for transactions with 254+ carefully curated parameters', inputSchema: { type: 'object', properties: { hash: { type: 'string', description: 'Transaction hash', }, value_min: { type: 'string', description: 'Minimum transaction value in WEI', }, value_max: { type: 'string', description: 'Maximum transaction value in WEI', }, gas_used_min: { type: 'string', description: 'Minimum gas used', }, gas_used_max: { type: 'string', description: 'Maximum gas used', }, from_hash: { type: 'string', description: 'From address hash', }, to_hash: { type: 'string', description: 'To address hash', }, block_number_min: { type: 'integer', description: 'Minimum block number', }, block_number_max: { type: 'integer', description: 'Maximum block number', }, limit: { type: 'integer', description: 'Number of results to return (default: 10, max: 50)', default: 10, }, offset: { type: 'integer', description: 'Number of results to skip for pagination (default: 0)', default: 0, }, }, required: [], }, }, { name: 'search_transactions_llm', description: 'LLM-powered transaction search using LLaMA 3.2 3B to select from 254 parameters', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Natural language query for transaction search', }, }, required: ['query'], }, }, { name: 'get_transaction_summary', description: 'Get AI-generated summary for a specific transaction', inputSchema: { type: 'object', properties: { transaction_hash: { type: 'string', description: 'The transaction hash to get summary for', }, }, required: ['transaction_hash'], }, }, { name: 'get_transaction_info', description: 'Get detailed information about a specific transaction', inputSchema: { type: 'object', properties: { transaction: { type: 'string', description: 'The transaction hash to get info for', }, }, required: ['transaction'], }, }, // Block endpoints { name: 'search_blocks_semantic', description: 'Semantic search for blocks using AI-powered vector similarity matching', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'The query to search for', }, limit: { type: 'integer', description: 'The number of results to return (default: 10)', default: 10, }, }, required: ['query'], }, }, { name: 'search_blocks_json', description: 'JSON search for blocks with 120+ parameters', inputSchema: { type: 'object', properties: { hash: { type: 'string', description: 'Block hash', }, height_min: { type: 'integer', description: 'Minimum block height', }, height_max: { type: 'integer', description: 'Maximum block height', }, gas_used_min: { type: 'string', description: 'Minimum gas used', }, gas_used_max: { type: 'string', description: 'Maximum gas used', }, transaction_count_min: { type: 'integer', description: 'Minimum transaction count', }, transaction_count_max: { type: 'integer', description: 'Maximum transaction count', }, miner_hash: { type: 'string', description: 'Miner address hash', }, limit: { type: 'integer', description: 'Number of results to return (default: 10, max: 50)', default: 10, }, offset: { type: 'integer', description: 'Number of results to skip for pagination (default: 0)', default: 0, }, }, required: [], }, }, { name: 'search_blocks_llm', description: 'LLM-powered block search using LLaMA 3.2 3B to select from 120+ parameters', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Natural language query for block search', }, }, required: ['query'], }, }, { name: 'get_block_summary', description: 'Get AI-generated summary for a specific block', inputSchema: { type: 'object', properties: { block_number: { type: 'string', description: 'The block number to get summary for', }, }, required: ['block_number'], }, }, { name: 'get_block_info', description: 'Get detailed information about a specific block', inputSchema: { type: 'object', properties: { block: { type: 'string', description: 'The block number to get info for', }, }, required: ['block'], }, }, // Token endpoints { name: 'search_tokens_semantic', description: 'Semantic search for tokens using AI-powered vector similarity matching', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'The query to search for', }, limit: { type: 'integer', description: 'The number of results to return (default: 10)', default: 10, }, }, required: ['query'], }, }, { name: 'search_tokens_json', description: 'JSON search for tokens with comprehensive search parameters', inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Token name', }, symbol: { type: 'string', description: 'Token symbol', }, address: { type: 'string', description: 'Token contract address', }, type: { type: 'string', description: 'Token type (ERC-20, ERC-721, ERC-1155)', }, holders_count_min: { type: 'integer', description: 'Minimum holder count', }, holders_count_max: { type: 'integer', description: 'Maximum holder count', }, limit: { type: 'integer', description: 'Number of results to return (default: 10, max: 50)', default: 10, }, offset: { type: 'integer', description: 'Number of results to skip for pagination (default: 0)', default: 0, }, }, required: [], }, }, { name: 'search_tokens_llm', description: 'LLM-powered token search using AI to select optimal parameters', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Natural language query for token search', }, }, required: ['query'], }, }, { name: 'get_token_summary', description: 'Get AI-generated summary for a specific token', inputSchema: { type: 'object', properties: { token_address: { type: 'string', description: 'The token address hash to get summary for', }, }, required: ['token_address'], }, }, { name: 'get_token_info', description: 'Get detailed information about a specific token', inputSchema: { type: 'object', properties: { token: { type: 'string', description: 'The token address hash', }, }, required: ['token'], }, }, { name: 'get_nft_instance_info', description: 'Get NFT instance information', inputSchema: { type: 'object', properties: { token: { type: 'string', description: 'The token address', }, instance_id: { type: 'string', description: 'The instance ID', }, }, required: ['token', 'instance_id'], }, }, // Smart Contract endpoints { name: 'search_smart_contracts_semantic', description: 'Semantic search for smart contracts using AI-powered vector similarity matching', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'The query to search for', }, limit: { type: 'integer', description: 'The number of results to return (default: 10)', default: 10, }, }, required: ['query'], }, }, { name: 'search_smart_contracts_json', description: 'JSON search for smart contracts with 50+ parameters', inputSchema: { type: 'object', properties: { is_verified: { type: 'boolean', description: 'Whether the contract is verified', }, name: { type: 'string', description: 'Contract name', }, language: { type: 'string', description: 'Programming language (e.g., "solidity")', }, proxy_type: { type: 'string', description: 'Proxy type (e.g., "eip1967")', }, optimization_enabled: { type: 'boolean', description: 'Whether optimization is enabled', }, limit: { type: 'integer', description: 'Number of results to return (default: 10, max: 50)', default: 10, }, offset: { type: 'integer', description: 'Number of results to skip for pagination (default: 0)', default: 0, }, }, required: [], }, }, { name: 'search_smart_contracts_llm', description: 'LLM-powered smart contract search using AI to select from 150+ parameters', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Natural language query for smart contract search', }, }, required: ['query'], }, }, { name: 'get_smart_contract_summary', description: 'Get AI-generated summary for a specific smart contract', inputSchema: { type: 'object', properties: { address: { type: 'string', description: 'The smart contract address to get summary for', }, }, required: ['address'], }, }, { name: 'get_smart_contract_info', description: 'Get detailed information about a specific smart contract', inputSchema: { type: 'object', properties: { address: { type: 'string', description: 'The smart contract address', }, }, required: ['address'], }, }, ],
  • Shared helper function used by all tool handlers, including search_tokens_json, to make authenticated HTTP requests to the ChainFETCH API.
    async makeRequest(endpoint, method = 'GET', params = {}, body = null, token = null) { const chainfetchToken = token || process.env.CHAINFETCH_API_TOKEN; if (!chainfetchToken) { throw new McpError( ErrorCode.InvalidRequest, 'CHAINFETCH_API_TOKEN is required' ); } const url = new URL(`${API_BASE_URL}${endpoint}`); // Add query parameters for GET requests if (method === 'GET' && Object.keys(params).length > 0) { Object.entries(params).forEach(([key, value]) => { if (value !== undefined && value !== null) { if (Array.isArray(value)) { value.forEach(v => url.searchParams.append(`${key}[]`, v)); } else { url.searchParams.append(key, value.toString()); } } }); } const fetchOptions = { method, headers: { 'Authorization': `Bearer ${chainfetchToken}`, 'Content-Type': 'application/json', }, }; if (body && method !== 'GET') { fetchOptions.body = JSON.stringify(body); } const response = await fetch(url.toString(), fetchOptions); if (!response.ok) { const errorText = await response.text(); throw new McpError( ErrorCode.InternalError, `API request failed: ${response.status} ${response.statusText} - ${errorText}` ); } return await response.json(); }

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/chainfetch/chainfetch-mcp-server'

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