Skip to main content
Glama
monostate

Crossmint HR Airdrop MCP

by monostate

create_token

Generate a new Solana token by specifying name, symbol, supply, and decimals. Designed for HR teams using Crossmint HR Airdrop MCP to facilitate role-based token distribution and email notifications.

Instructions

Create a new Solana token

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
decimalsNoToken decimals (default: 9)
nameYesToken name
supplyYesTotal token supply
symbolYesToken symbol

Implementation Reference

  • src/server.ts:159-184 (registration)
    Registration of the 'create_token' MCP tool including its input schema definition.
    {
      name: 'create_token',
      description: 'Create a new Solana token',
      inputSchema: {
        type: 'object',
        properties: {
          name: {
            type: 'string',
            description: 'Token name',
          },
          symbol: {
            type: 'string',
            description: 'Token symbol',
          },
          supply: {
            type: 'number',
            description: 'Total token supply',
          },
          decimals: {
            type: 'number',
            description: 'Token decimals (default: 9)',
          },
        },
        required: ['name', 'symbol', 'supply'],
      },
    },
  • MCP tool handler for 'create_token' that validates parameters, calls the createToken utility, updates server state, and returns success response.
      private async handleCreateToken(args: any) {
        if (!this.state.connectedWallet) {
          throw new McpError(
            ErrorCode.InvalidRequest,
            'No wallet connected. Please connect a wallet first.'
          );
        }
    
        // Validate input
        const schema = z.object({
          name: z.string(),
          symbol: z.string(),
          supply: z.number().positive(),
          decimals: z.number().min(0).max(9).default(9),
        });
        
        const { name, symbol, supply, decimals } = schema.parse(args);
        
        try {
          // Create a dummy connection and keypair for simulation
          const connection = new Connection('https://api.mainnet-beta.solana.com', 'confirmed');
          const keypair = Keypair.generate(); // In a real implementation, this would be the user's wallet
          
          // Call the token creation utility
          const result = await createToken(
            connection,
            keypair,
            name,
            symbol,
            supply,
            decimals
          );
          
          if (!result.mintAddress) {
            throw new Error('Token creation failed: No mint address returned');
          }
          
          // Update state
          this.state.createdToken = {
            name,
            symbol,
            mintAddress: result.mintAddress,
            supply,
            decimals,
          };
        } catch (error) {
          throw new McpError(
            ErrorCode.InternalError,
            `Token creation failed: ${error instanceof Error ? error.message : String(error)}`
          );
        }
        
        return {
          content: [
            {
              type: 'text',
              text: `
    Token created successfully:
    Name: ${name}
    Symbol: ${symbol}
    Supply: ${supply.toLocaleString()}
    Decimals: ${decimals}
    Mint Address: ${this.state.createdToken?.mintAddress}
    
    Next step: Add liquidity to give the token value.
              `.trim(),
            },
          ],
        };
      }
  • Core implementation of token creation logic using SPL Token program; exported as createToken from tokenUtils.ts and called by the MCP handler.
    export async function deployToken(
      connection: Connection,
      payer: Keypair,
      name: string,
      symbol: string,
      supply: number,
      decimals: number = 9
    ): Promise<{ mintAddress: string }> {
      try {
        console.log(`Creating token: ${name} (${symbol}) with supply ${supply}`);
        
        // Check payer balance
        const balance = await connection.getBalance(payer.publicKey);
        console.log(`Payer balance: ${balance / LAMPORTS_PER_SOL} SOL`);
        
        if (balance < 0.05 * LAMPORTS_PER_SOL) {
          throw new Error(`Insufficient balance: ${balance / LAMPORTS_PER_SOL} SOL. Need at least 0.05 SOL.`);
        }
        
        // Generate a new keypair for the mint account
        const mintKeypair = Keypair.generate();
        console.log(`Mint keypair generated: ${mintKeypair.publicKey.toString()}`);
        
        // Get the minimum lamports required for the mint
        const lamports = await getMinimumBalanceForRentExemptMint(connection);
        
        // Create a transaction to create the mint account
        const transaction = new Transaction();
        
        // Add instruction to create the mint account
        transaction.add(
          SystemProgram.createAccount({
            fromPubkey: payer.publicKey,
            newAccountPubkey: mintKeypair.publicKey,
            space: MINT_SIZE,
            lamports,
            programId: TOKEN_PROGRAM_ID,
          })
        );
        
        // Add instruction to initialize the mint account
        transaction.add(
          createInitializeMintInstruction(
            mintKeypair.publicKey,
            decimals,
            payer.publicKey,
            payer.publicKey
          )
        );
        
        // If supply is greater than 0, mint tokens to the payer
        if (supply > 0) {
          // Get the associated token account for the payer
          const associatedTokenAccount = await getAssociatedTokenAddress(
            mintKeypair.publicKey,
            payer.publicKey
          );
          
          // Add instruction to create the associated token account if it doesn't exist
          transaction.add(
            createAssociatedTokenAccountInstruction(
              payer.publicKey,
              associatedTokenAccount,
              payer.publicKey,
              mintKeypair.publicKey
            )
          );
          
          // Add instruction to mint tokens to the payer's associated token account
          transaction.add(
            createMintToInstruction(
              mintKeypair.publicKey,
              associatedTokenAccount,
              payer.publicKey,
              supply * Math.pow(10, decimals)
            )
          );
        }
        
        // Send and confirm the transaction
        const signature = await sendAndConfirmTransaction(
          connection,
          transaction,
          [payer, mintKeypair]
        );
        
        console.log(`Transaction signature: ${signature}`);
        
        // Return the mint address
        const mint = mintKeypair.publicKey;
        
        console.log(`Token mint created: ${mint.toString()}`);
        
        return {
          mintAddress: mint.toString()
        };
      } catch (error: any) {
        console.error('Error deploying token:', error);
        throw new Error(`Token deployment failed: ${error.message}`);
      }
    }
  • Re-export of deployToken as createToken for use in server.ts.
    /**
     * Create a new token on Solana
     */
    export { deployToken as createToken };
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. 'Create a new Solana token' implies a write/mutation operation but doesn't specify permissions needed, cost implications (transaction fees), whether it's reversible, or what happens on success/failure. For a blockchain token creation tool, this leaves critical behavioral aspects undocumented.

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 with zero wasted words. It's appropriately sized for a tool with good schema documentation and gets straight to the point without unnecessary elaboration.

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 this is a blockchain token creation tool with no annotations and no output schema, the description is insufficiently complete. It doesn't address critical context like authentication requirements, transaction costs, success/failure outcomes, or integration with sibling tools. The 100% schema coverage helps with parameters but doesn't compensate for missing behavioral and operational context.

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%, with all parameters well-documented in the schema itself. The description adds no additional parameter semantics beyond what's already in the schema. The baseline score of 3 reflects adequate parameter documentation through the schema alone.

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 ('Create') and resource ('new Solana token'), providing a specific verb+resource combination. However, it doesn't differentiate from sibling tools like 'generate_wallets' or 'start_airdrop' which might also create blockchain assets, leaving room for ambiguity in tool selection.

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's no mention of prerequisites (like needing a connected wallet), use cases, or exclusions. Sibling tools like 'connect_wallet' or 'generate_wallets' might be related, but no explicit relationships are stated.

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