search_transactions_semantic
Find blockchain transactions using natural language queries with AI-powered semantic search to locate specific on-chain activities without requiring exact transaction details.
Instructions
Semantic search for transactions using AI-powered vector similarity matching
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | The query to search for | |
| limit | No | The number of results to return (default: 10) |
Implementation Reference
- index.js:152-169 (registration)Registration of the 'search_transactions_semantic' tool in the ListTools response, including name, description, and input schema.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'], }, },
- index.js:704-705 (handler)Handler implementation for 'search_transactions_semantic' tool. Forwards arguments to the ChainFetch API endpoint '/api/v1/ethereum/transactions/semantic_search' via the makeRequest helper method.case 'search_transactions_semantic': return await this.makeRequest('/api/v1/ethereum/transactions/semantic_search', 'GET', args, null, token);
- index.js:634-682 (helper)Shared helper method 'makeRequest' used by all tool handlers, including 'search_transactions_semantic', to proxy 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(); }