get_token_summary
Generate AI-powered summaries for Ethereum tokens by providing the token address to analyze token details and characteristics.
Instructions
Get AI-generated summary for a specific token
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| token_address | Yes | The token address hash to get summary for |
Implementation Reference
- index.js:461-473 (registration)Registration of the get_token_summary tool in the listTools response, including name, description, and input schema.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'], }, },
- index.js:463-472 (schema)Input schema definition for the get_token_summary tool, specifying the required token_address parameter.inputSchema: { type: 'object', properties: { token_address: { type: 'string', description: 'The token address hash to get summary for', }, }, required: ['token_address'], },
- index.js:747-749 (handler)Handler implementation in the switch statement of handleToolCall method. Executes by calling makeRequest to the ChainFETCH API endpoint /api/v1/ethereum/tokens/summary with the provided arguments.case 'get_token_summary': return await this.makeRequest('/api/v1/ethereum/tokens/summary', 'GET', args, null, token);
- index.js:634-682 (helper)Supporting helper function makeRequest that handles API calls to ChainFETCH, used by all tool handlers including get_token_summary.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(); }