Skip to main content
Glama
monostate

Crossmint HR Airdrop MCP

by monostate

calculate_amounts

Calculate token amounts for employees based on uniform distribution or role-specific allocations using roleAmounts or uniformAmount inputs in the Crossmint HR Airdrop MCP server.

Instructions

Calculate token amounts for each employee

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
roleAmountsNoToken amounts by role (if CSV with roles is used)
uniformAmountNoUniform amount for all employees (if no CSV role-mapping is used)

Implementation Reference

  • The main execution logic for the 'calculate_amounts' tool. Validates input, calculates token amounts per employee based on uniform or role-based allocation using defaults or provided values, updates employee state with tokenAmount, computes total, and returns formatted summary.
      private async handleCalculateAmounts(args: any) {
        if (this.state.employees.length === 0) {
          throw new McpError(
            ErrorCode.InvalidRequest,
            'No employees added. Please generate wallets first.'
          );
        }
    
        // Validate input
        const schema = z.object({
          uniformAmount: z.number().positive().optional(),
          roleAmounts: z
            .object({
              operational: z.number().positive().optional(),
              developer: z.number().positive().optional(),
              manager: z.number().positive().optional(),
              VP: z.number().positive().optional(),
              VIP: z.number().positive().optional(),
            })
            .optional(),
        });
        
        const { uniformAmount, roleAmounts } = schema.parse(args);
        
        // Set default role amounts if not provided
        const defaultRoleTokens = {
          operational: 100,
          developer: 200,
          manager: 300,
          vp: 400,
          vip: 500,
        };
        
        // Combine with provided role amounts
        const roleTokens: Record<string, number> = {
          ...defaultRoleTokens,
          ...(roleAmounts || {}),
        };
        
        let totalAmount = 0;
        
        // Update employee records with token amounts
        this.state.employees = this.state.employees.map((employee) => {
          let tokenAmount: number;
          
          if (uniformAmount) {
            // Use uniform amount for all employees
            tokenAmount = uniformAmount;
          } else if (employee.role) {
            // Use role-based amount if role is available
            const role = employee.role.toLowerCase();
            if (role === 'operational') tokenAmount = roleTokens.operational || 100;
            else if (role === 'developer') tokenAmount = roleTokens.developer || 200;
            else if (role === 'manager') tokenAmount = roleTokens.manager || 300;
            else if (role === 'vp') tokenAmount = roleTokens.vp || 400;
            else if (role === 'vip') tokenAmount = roleTokens.vip || 500;
            else tokenAmount = 100; // Default fallback
          } else {
            // Default amount if no role specified
            tokenAmount = 100;
          }
          
          totalAmount += tokenAmount;
          
          return {
            ...employee,
            tokenAmount,
          };
        });
        
        return {
          content: [
            {
              type: 'text',
              text: `
    Token amounts calculated successfully:
    ${this.state.employees
      .map(
        (employee) =>
          `- ${employee.name || employee.email}: ${employee.tokenAmount} tokens (${
            employee.role || 'No role'
          })`
      )
      .join('\n')}
    
    Total tokens to be distributed: ${totalAmount}
    ${
      this.state.createdToken
        ? `Token supply: ${this.state.createdToken.supply}`
        : 'No token created yet. Please create a token with sufficient supply.'
    }
    
    Next step: Calculate gas fees for the airdrop.
              `.trim(),
            },
          ],
        };
      }
  • src/server.ts:235-258 (registration)
    Tool registration in the ListToolsRequestSchema handler, defining the tool name, description, and input schema for MCP clients to discover and call the tool.
    {
      name: 'calculate_amounts',
      description: 'Calculate token amounts for each employee',
      inputSchema: {
        type: 'object',
        properties: {
          uniformAmount: {
            type: 'number',
            description: 'Uniform amount for all employees (if no CSV role-mapping is used)',
          },
          roleAmounts: {
            type: 'object',
            properties: {
              operational: { type: 'number' },
              developer: { type: 'number' },
              manager: { type: 'number' },
              VP: { type: 'number' },
              VIP: { type: 'number' },
            },
            description: 'Token amounts by role (if CSV with roles is used)',
          },
        },
      },
    },
  • Zod validation schema inside the handler matching the tool's inputSchema for runtime parameter validation.
    const schema = z.object({
      uniformAmount: z.number().positive().optional(),
      roleAmounts: z
        .object({
          operational: z.number().positive().optional(),
          developer: z.number().positive().optional(),
          manager: z.number().positive().optional(),
          VP: z.number().positive().optional(),
          VIP: z.number().positive().optional(),
        })
        .optional(),
    });
  • src/server.ts:328-329 (registration)
    Dispatch case in the CallToolRequestSchema switch statement that routes tool calls to the specific handler.
    case 'calculate_amounts':
      return await this.handleCalculateAmounts(args);
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure but only states the calculation purpose. It doesn't reveal whether this is a read-only operation, if it requires specific permissions, what the output format is, or any rate limits or side effects, leaving significant gaps.

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

Conciseness5/5

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

The description is a single, efficient sentence that directly states the tool's purpose without any fluff or redundancy. It's appropriately sized and front-loaded, making it easy to understand quickly.

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 the complexity (2 parameters with nested objects) and lack of annotations or output schema, the description is insufficient. It doesn't explain the calculation logic, output format, or how parameters interact, leaving the agent with incomplete context for proper tool invocation.

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 thoroughly. The description adds no additional meaning beyond what the schema provides, such as explaining the relationship between 'roleAmounts' and 'uniformAmount' or usage scenarios, meeting the baseline for high coverage.

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

Purpose4/5

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

The description clearly states the action ('calculate') and target ('token amounts for each employee'), providing a specific verb+resource combination. However, it doesn't differentiate from sibling tools like 'calculate_fees' or 'start_airdrop' which might involve similar calculations, so it misses the top score.

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?

The description offers no guidance on when to use this tool versus alternatives like 'calculate_fees' or 'start_airdrop', nor does it mention prerequisites or context. It merely states what it does without indicating appropriate scenarios.

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/monostate/Employees-Airdrop-Rewards-MCP'

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