filter_airdrops
Filter cryptocurrency airdrops by minimum value, status, blockchain, or search terms using advanced criteria from DeFiLlama data. Streamline tracking and analysis for efficient decision-making.
Instructions
Filtrar airdrops por critérios específicos
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chain | No | Filtrar por blockchain | |
| minValue | No | Valor mínimo estimado do airdrop | |
| searchTerm | No | Buscar por termo no nome ou descrição | |
| status | No | Status do airdrop (Active, Ended, TBD, etc.) |
Implementation Reference
- src/index.ts:190-226 (handler)The handler function for the filter_airdrops tool. It filters the cached airdrops list using status, chain, and searchTerm parameters (minValue is accepted but not applied in filtering), and returns a JSON-formatted response with the filtered results.private async filterAirdrops(args: { minValue?: number; status?: string; chain?: string; searchTerm?: string }) { // Garantir que temos dados if (this.cachedAirdrops.length === 0) { await this.getAirdrops({ forceRefresh: true }); } let filtered = [...this.cachedAirdrops]; if (args.status) { filtered = filtered.filter(a => a.status?.toLowerCase().includes(args.status!.toLowerCase())); } if (args.chain) { filtered = filtered.filter(a => a.chain?.toLowerCase().includes(args.chain!.toLowerCase())); } if (args.searchTerm) { const term = args.searchTerm.toLowerCase(); filtered = filtered.filter(a => a.name.toLowerCase().includes(term) || a.description?.toLowerCase().includes(term) ); } return { content: [ { type: 'text', text: JSON.stringify({ total: filtered.length, filters: args, airdrops: filtered }, null, 2) } ] }; }
- src/index.ts:66-86 (schema)Input schema defining the parameters for the filter_airdrops tool: minValue (number), status (string), chain (string), searchTerm (string).inputSchema: { type: 'object', properties: { minValue: { type: 'number', description: 'Valor mínimo estimado do airdrop' }, status: { type: 'string', description: 'Status do airdrop (Active, Ended, TBD, etc.)' }, chain: { type: 'string', description: 'Filtrar por blockchain' }, searchTerm: { type: 'string', description: 'Buscar por termo no nome ou descrição' } } }
- src/index.ts:63-87 (registration)Tool registration in the ListTools handler, including name, description, and input schema.{ name: 'filter_airdrops', description: 'Filtrar airdrops por critérios específicos', inputSchema: { type: 'object', properties: { minValue: { type: 'number', description: 'Valor mínimo estimado do airdrop' }, status: { type: 'string', description: 'Status do airdrop (Active, Ended, TBD, etc.)' }, chain: { type: 'string', description: 'Filtrar por blockchain' }, searchTerm: { type: 'string', description: 'Buscar por termo no nome ou descrição' } } } },
- src/index.ts:128-129 (registration)Dispatch to the filterAirdrops handler in the CallTool switch statement.case 'filter_airdrops': return await this.filterAirdrops(args as any);