Skip to main content
Glama

Crossmint HR Airdrop MCP

by monostate

check_balance

Verify the SOL token balance of a connected wallet within Crossmint HR Airdrop MCP, designed for corporate HR teams managing token distributions to employees.

Instructions

Check the SOL balance of the connected wallet

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "properties": {}, "type": "object" }

Implementation Reference

  • The handler function that executes the check_balance tool. It verifies a wallet is connected, retrieves the cached SOL balance, estimates required SOL for airdrop based on employee count, and returns a formatted status message.
    private async handleCheckBalance() { if (!this.state.connectedWallet) { throw new McpError( ErrorCode.InvalidRequest, 'No wallet connected. Please connect a wallet first.' ); } // In a real implementation, we would refresh the balance from the blockchain // For this demo, we'll just return the cached balance const { publicKey, solBalance } = this.state.connectedWallet; // Calculate required SOL for employees const employeeCount = this.state.employees.length || 1; // Default to 1 if no employees yet const requiredSol = 0.1 * employeeCount; // 0.1 SOL per employee const isSufficient = solBalance >= requiredSol; return { content: [ { type: 'text', text: ` Wallet Public Key: ${publicKey} Current SOL Balance: ${solBalance.toFixed(5)} SOL Required for Airdrop: ~${requiredSol.toFixed(5)} SOL (0.1 SOL per employee) Status: ${isSufficient ? 'Sufficient balance' : 'Insufficient balance'} ${!isSufficient ? 'Insufficient tokens. Create a new token? (yes/no)' : ''} `.trim(), }, ], }; }
  • The input schema for the check_balance tool, defined as an empty object since no parameters are required.
    inputSchema: { type: 'object', properties: {}, },
  • src/server.ts:152-158 (registration)
    Registration of the check_balance tool in the ListToolsRequestSchema handler, including name, description, and schema.
    name: 'check_balance', description: 'Check the SOL balance of the connected wallet', inputSchema: { type: 'object', properties: {}, }, },
  • src/server.ts:318-319 (registration)
    Dispatch case in the CallToolRequestSchema handler that routes check_balance calls to the handleCheckBalance method.
    case 'check_balance': return await this.handleCheckBalance();

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