Skip to main content
Glama
monostate

Crossmint HR Airdrop MCP

by monostate

upload_csv

Process employee data from a CSV file to enable Solana token airdrops, role-based allocations, and automated email notifications for corporate HR teams.

Instructions

Process employee data from a CSV file

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filePathYesPath to the CSV file

Implementation Reference

  • src/server.ts:221-234 (registration)
    Registers the 'upload_csv' tool in the ListToolsRequestSchema handler, including name, description, and inputSchema for filePath.
    {
      name: 'upload_csv',
      description: 'Process employee data from a CSV file',
      inputSchema: {
        type: 'object',
        properties: {
          filePath: {
            type: 'string',
            description: 'Path to the CSV file',
          },
        },
        required: ['filePath'],
      },
    },
  • src/server.ts:326-327 (registration)
    Dispatches 'upload_csv' tool calls to the handleUploadCsv method in the CallToolRequestSchema handler.
    case 'upload_csv':
      return await this.handleUploadCsv(args);
  • The primary handler for the 'upload_csv' tool. Validates input, reads and parses CSV using csv-parse/sync, matches records to existing employee wallets by email, updates names and roles, validates roles, updates server state, and returns role distribution summary.
      private async handleUploadCsv(args: any) {
        // Validate input
        const schema = z.object({
          filePath: z.string(),
        });
        
        const { filePath } = schema.parse(args);
        
        try {
          // Read and parse CSV file
          const fileContent = fs.readFileSync(filePath, 'utf8');
          const records = csvParse(fileContent, {
            columns: true,
            skip_empty_lines: true,
          });
          
          // Validate records
          const validRoles = ['operational', 'developer', 'manager', 'VP', 'VIP'];
          
          if (!records.length) {
            throw new McpError(ErrorCode.InvalidParams, 'CSV file is empty.');
          }
          
          // Check required columns
          const firstRecord = records[0];
          if (!('email' in firstRecord)) {
            throw new McpError(ErrorCode.InvalidParams, 'CSV file must have an "email" column.');
          }
          
          // Map existing emails to records
          const employeesByEmail = new Map(
            this.state.employees.map((e) => [e.email, e])
          );
          
          // Update or create employee records
          const updatedEmployees = records.map((record: any) => {
            if (!record.email) {
              throw new McpError(ErrorCode.InvalidParams, 'Every row must have an email.');
            }
            
            const existingEmployee = employeesByEmail.get(record.email);
            if (!existingEmployee) {
              throw new McpError(
                ErrorCode.InvalidParams,
                `Email ${record.email} does not match any generated wallet. Please generate wallets first.`
              );
            }
            
            if (record.role && !validRoles.includes(record.role.toLowerCase())) {
              throw new McpError(
                ErrorCode.InvalidParams,
                `Invalid role "${record.role}" for ${record.email}. Valid roles are: ${validRoles.join(', ')}.`
              );
            }
            
            return {
              ...existingEmployee,
              name: record.name || undefined,
              role: record.role?.toLowerCase() || undefined,
            };
          });
          
          // Update state
          this.state.employees = updatedEmployees;
          
          return {
            content: [
              {
                type: 'text',
                text: `
    CSV data processed successfully. Updated ${updatedEmployees.length} employee records.
    
    Role distribution:
    - Operational: ${updatedEmployees.filter((e: any) => e.role === 'operational').length}
    - Developer: ${updatedEmployees.filter((e: any) => e.role === 'developer').length}
    - Manager: ${updatedEmployees.filter((e: any) => e.role === 'manager').length}
    - VP: ${updatedEmployees.filter((e: any) => e.role === 'vp').length}
    - VIP: ${updatedEmployees.filter((e: any) => e.role === 'vip').length}
    - No role: ${updatedEmployees.filter((e: any) => !e.role).length}
    
    Next step: Calculate token amounts for each employee.
                `.trim(),
              },
            ],
          };
        } catch (error) {
          if (error instanceof McpError) throw error;
          throw new McpError(
            ErrorCode.InternalError,
            `Failed to process CSV: ${error instanceof Error ? error.message : String(error)}`
          );
        }
      }
  • Zod schema for input validation within the handler (filePath: string).
    const schema = z.object({
      filePath: z.string(),
    });
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool processes data but doesn't clarify whether this is a read-only operation, a mutation, what permissions are required, or what side effects might occur (e.g., data storage, updates). This leaves significant gaps for a tool that likely modifies or uploads data.

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 that directly states the tool's purpose without unnecessary words. It's appropriately sized for a simple tool, though it could be slightly more informative to improve completeness without sacrificing brevity.

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 lack of annotations and output schema, the description is incomplete for a tool that likely involves data processing. It doesn't explain what 'process' entails (e.g., validation, upload, transformation), the expected outcomes, or error handling, which are critical for an agent to use it correctly.

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?

The schema description coverage is 100%, with the single parameter 'filePath' clearly documented in the schema. The description adds no additional meaning about the parameter beyond implying it's for a CSV file, which is already covered. This meets the baseline for high schema 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 tool's purpose with a specific verb ('Process') and resource ('employee data from a CSV file'), making it easy to understand what it does. However, it doesn't distinguish this tool from potential sibling tools that might also process CSV files or employee data, which prevents a perfect 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 provides no guidance on when to use this tool versus alternatives. There are no mentions of prerequisites, context-specific usage, or comparisons with sibling tools like 'send_emails' or 'create_token', leaving the agent to guess based on the name alone.

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