Skip to main content
Glama
zarelli1

MCP DeFiLlama Airdrops

by zarelli1

get_best_airdrops

Discover high-value cryptocurrency airdrops filtered by criteria like value and deadline. Access ranked airdrop data from DeFiLlama for integration into automation workflows.

Instructions

Obter os melhores airdrops baseado em critérios de valor e facilidade

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoNúmero máximo de airdrops para retornar
sortByNoCritério de ordenaçãovalue

Implementation Reference

  • The main handler function that ensures data is loaded, filters active/TBD airdrops, sorts them by the specified criteria (value, deadline, or name), takes the top limit, and returns JSON-formatted response.
    private async getBestAirdrops(args: { limit?: number; sortBy?: string }) {
      // Garantir que temos dados
      if (this.cachedAirdrops.length === 0) {
        await this.getAirdrops({ forceRefresh: true });
      }
    
      let airdrops = [...this.cachedAirdrops];
      const limit = args.limit || 10;
    
      // Filtrar apenas airdrops ativos
      airdrops = airdrops.filter(a => 
        a.status?.toLowerCase().includes('active') || 
        a.status?.toLowerCase().includes('ativo') ||
        a.status?.toLowerCase() === 'tbd'
      );
    
      // Ordenar baseado no critério
      switch (args.sortBy) {
        case 'value':
          airdrops.sort((a, b) => {
            const aValue = this.parseValue(a.value);
            const bValue = this.parseValue(b.value);
            return bValue - aValue;
          });
          break;
        case 'deadline':
          airdrops.sort((a, b) => {
            const aDate = new Date(a.deadline || '9999-12-31');
            const bDate = new Date(b.deadline || '9999-12-31');
            return aDate.getTime() - bDate.getTime();
          });
          break;
        default:
          airdrops.sort((a, b) => a.name.localeCompare(b.name));
      }
    
      const best = airdrops.slice(0, limit);
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify({
              total: best.length,
              criteria: { limit, sortBy: args.sortBy },
              bestAirdrops: best
            }, null, 2)
          }
        ]
      };
    }
  • Input schema defining optional parameters 'limit' (number, default 10) and 'sortBy' (string enum: value/deadline/name, default 'value').
    inputSchema: {
      type: 'object',
      properties: {
        limit: {
          type: 'number',
          description: 'Número máximo de airdrops para retornar',
          default: 10
        },
        sortBy: {
          type: 'string',
          enum: ['value', 'deadline', 'name'],
          description: 'Critério de ordenação',
          default: 'value'
        }
      }
    }
  • src/index.ts:88-107 (registration)
    Tool registration in the listTools response, including name, description, and input schema.
    {
      name: 'get_best_airdrops',
      description: 'Obter os melhores airdrops baseado em critérios de valor e facilidade',
      inputSchema: {
        type: 'object',
        properties: {
          limit: {
            type: 'number',
            description: 'Número máximo de airdrops para retornar',
            default: 10
          },
          sortBy: {
            type: 'string',
            enum: ['value', 'deadline', 'name'],
            description: 'Critério de ordenação',
            default: 'value'
          }
        }
      }
    },
  • src/index.ts:131-132 (registration)
    Dispatcher case in CallToolRequestSchema handler that routes calls to the getBestAirdrops method.
    case 'get_best_airdrops':
      return await this.getBestAirdrops(args as any);
  • Helper function to parse airdrop value strings into numbers, handling currency symbols, spaces, and multipliers (K, M, B). Used in sorting by value.
    private parseValue(value?: string): number {
      if (!value) return 0;
      
      // Remover símbolos e converter para número
      const cleaned = value.replace(/[$,\s]/g, '');
      const num = parseFloat(cleaned);
      
      if (isNaN(num)) return 0;
      
      // Detectar multiplicadores (K, M, B)
      if (value.toLowerCase().includes('k')) return num * 1000;
      if (value.toLowerCase().includes('m')) return num * 1000000;
      if (value.toLowerCase().includes('b')) return num * 1000000000;
      
      return num;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It mentions criteria ('valor e facilidade') but doesn't disclose behavioral traits like data source, freshness, rate limits, or error handling. This is inadequate for a tool with no annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence in Portuguese that states the purpose and criteria. It's appropriately sized and front-loaded, though it could be slightly more structured by separating purpose from criteria.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and a tool that likely returns a list of airdrops, the description is incomplete. It doesn't explain return values, data format, or provide enough context for an agent to understand the tool's behavior fully.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters ('limit' and 'sortBy') with details. The description adds no additional meaning beyond what the schema provides, such as explaining 'valor' or 'facilidade' criteria, resulting in the baseline score.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the purpose ('Obter os melhores airdrops') with criteria ('baseado em critérios de valor e facilidade'), which is clear but somewhat vague. It distinguishes from sibling 'get_airdrops' by implying a 'best' selection, but doesn't explicitly differentiate from 'filter_airdrops'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use this tool versus alternatives like 'get_airdrops' or 'filter_airdrops'. The description implies it's for getting 'best' airdrops, but doesn't specify scenarios or exclusions, leaving usage ambiguous.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

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/zarelli1/mcp-defillama-airdrops'

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