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
| Name | Required | Description | Default |
|---|---|---|---|
| mintUrl | Yes | Mint URL to add |
Implementation Reference
- wallet.ts:478-502 (handler)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'] } }
- wallet.ts:690-696 (handler)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}` }] };
- wallet.ts:588-594 (schema)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'] }