Skip to main content
Glama

create_spl_token

Create a new SPL token on the Solana blockchain by specifying decimals and wallet authority for minting operations.

Instructions

Create a new SPL token with specified decimals

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
walletNameYesName of the wallet that will be the mint authority
decimalsNoNumber of decimal places for the token (default: 9)
freezeAuthorityNoWhether to enable freeze authority (default: false)

Implementation Reference

  • The handler function that creates a new SPL token mint using createMint from @solana/spl-token, setting the specified wallet as mint authority and optionally freeze authority.
    async function handleCreateSplToken(args: any) { const { walletName, decimals = 9, freezeAuthority = false } = args; const wallet = wallets.get(walletName); if (!wallet) { throw new Error(`Wallet '${walletName}' not found`); } ensureConnection(); const freezeAuthorityPubkey = freezeAuthority ? wallet.keypair.publicKey : null; const mint = await createMint( connection, wallet.keypair, wallet.keypair.publicKey, freezeAuthorityPubkey, decimals ); return { success: true, tokenMint: mint.toString(), decimals, mintAuthority: wallet.keypair.publicKey.toString(), freezeAuthority: freezeAuthorityPubkey ? freezeAuthorityPubkey.toString() : null, explorerUrl: `https://explorer.solana.com/address/${mint.toString()}?cluster=${currentNetwork}` }; }
  • The tool definition in the tools array, including name, description, and input schema for validation.
    { name: "create_spl_token", description: "Create a new SPL token with specified decimals", inputSchema: { type: "object", properties: { walletName: { type: "string", description: "Name of the wallet that will be the mint authority" }, decimals: { type: "number", description: "Number of decimal places for the token (default: 9)" }, freezeAuthority: { type: "boolean", description: "Whether to enable freeze authority (default: false)" } }, required: ["walletName"] } },
  • src/index.ts:1330-1331 (registration)
    The switch case in the main CallToolRequestSchema handler that dispatches to the create_spl_token handler.
    case "create_spl_token": result = await handleCreateSplToken(args);

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/ExpertVagabond/solana-mcp-server'

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