Skip to main content
Glama

add_mint

Add a mint to your wallet by specifying the mint URL within the MCP Money server. Enables AI agents to manage monetary functionalities effectively.

Instructions

Add a mint to the wallet

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
mintUrlYesMint URL to add

Implementation Reference

  • Core handler function in MCPWallet class that adds the mint URL to the wallet's mints list if not present, updates NDK wallet, republishes wallet info and mint list to Nostr, and saves the configuration.
    async addMint(mintUrl: string): Promise<void> { if (!this.wallet || !this.walletData) throw new Error('Wallet not initialized'); try { // Add mint to wallet if not already present const currentMints = this.wallet.mints || []; if (!currentMints.includes(mintUrl)) { this.wallet.mints = [...currentMints, mintUrl]; this.walletData.mints = this.wallet.mints; // Republish wallet info to Nostr with updated mints await this.wallet.publish(); // Update mint list for nutzap reception await this.publishMintList(); this.saveWallet(); } else { } } catch (error) { console.error('Error adding mint:', error); throw error; } }
  • wallet.ts:586-595 (registration)
    Registers the 'add_mint' tool in the MCP server's listTools response, including name, description, and input schema.
    name: 'add_mint', description: 'Add a mint to the wallet', inputSchema: { type: 'object', properties: { mintUrl: { type: 'string', description: 'Mint URL to add' } }, required: ['mintUrl'] } }
  • MCP tool dispatch handler in callTool switch that validates input, calls the wallet.addMint method, and returns success response.
    case 'add_mint': const { mintUrl: mintToAdd } = args; if (!mintToAdd) { throw new Error('mintUrl is required'); } await this.wallet.addMint(mintToAdd); return { content: [{ type: 'text', text: `Added mint: ${mintToAdd}` }] };
  • Input schema definition for the add_mint tool, specifying mintUrl as a required string.
    inputSchema: { type: 'object', properties: { mintUrl: { type: 'string', description: 'Mint URL to add' } }, required: ['mintUrl'] }

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/pablof7z/mcp-money'

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