Skip to main content
Glama

add_mint

Add a mint URL to your wallet to enable money functionalities via Nostr and Cashu for AI agents.

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 a new mint URL to the wallet configuration, updates the NDKCashuWallet mints list, republishes wallet and mint list events to Nostr, and saves the updated configuration to disk.
    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;
      }
    }
  • Input schema and metadata for the 'add_mint' tool, defining it takes a required 'mintUrl' string parameter.
      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 MCPServer.callTool() that validates input, calls the wallet.addMint() method, and formats the 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:528-598 (registration)
    Tool registration in the ListToolsRequestSchema handler where 'add_mint' is listed among available tools with its schema.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: [
          {
            name: 'get_balance',
            description: 'Get the total wallet balance',
            inputSchema: {
              type: 'object',
              properties: {},
              required: []
            }
          },
          {
            name: 'get_mint_balances', 
            description: 'Get balance breakdown per mint',
            inputSchema: {
              type: 'object',
              properties: {},
              required: []
            }
          },
          {
            name: 'deposit',
            description: 'Create a deposit invoice (bolt11) for the specified amount and mint. Returns the invoice immediately for payment. If no mint is specified, all mints will be tried concurrently and the first successful response will be used.',
            inputSchema: {
              type: 'object',
              properties: {
                amount: { type: 'number', description: 'Amount in satoshis' },
                mintUrl: { type: 'string', description: 'Mint URL to deposit to (optional - all mints tried concurrently if not provided)' }
              },
              required: ['amount']
            }
          },
          {
            name: 'pay',
            description: 'Pay a Lightning invoice',
            inputSchema: {
              type: 'object',
              properties: {
                bolt11: { type: 'string', description: 'Lightning invoice to pay' }
              },
              required: ['bolt11']
            }
          },
          {
            name: 'zap',
            description: 'Send a zap to a user',
            inputSchema: {
              type: 'object',
              properties: {
                recipient: { type: 'string', description: 'User npub or NIP-05 identifier to zap' },
                amount: { type: 'number', description: 'Amount in satoshis' },
                comment: { type: 'string', description: 'Optional comment' }
              },
              required: ['recipient', 'amount']
            }
          },
          {
            name: 'add_mint',
            description: 'Add a mint to the wallet',
            inputSchema: {
              type: 'object',
              properties: {
                mintUrl: { type: 'string', description: 'Mint URL to add' }
              },
              required: ['mintUrl']
            }
          }
        ]
      };
    });
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. 'Add a mint to the wallet' implies a mutation operation, but it lacks details on permissions, side effects, error conditions, or what happens if the mint already exists. This is inadequate for a tool that likely modifies state.

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 no wasted words. It's appropriately sized for a simple tool and front-loads the key action, making it easy to parse quickly.

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 the lack of annotations and output schema, the description is insufficient. It doesn't explain what 'adding a mint' entails behaviorally, what the expected outcome is, or how it relates to sibling tools. For a mutation tool with no structured safety hints, more context is needed.

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?

The input schema has 100% description coverage, with 'mintUrl' clearly documented. The description doesn't add any parameter details beyond what the schema provides, so it meets the baseline for high schema coverage without compensating value.

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 ('Add') and resource ('a mint to the wallet'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'deposit' or 'pay', which might also involve wallet modifications, so it doesn't reach the highest clarity level.

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. It doesn't mention prerequisites, context (e.g., when a mint needs adding), or exclusions, leaving the agent with minimal usage cues.

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

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