Skip to main content
Glama

Swap Tokens (Solana)

monei_swap_tokens_solana
Destructive

Swap tokens on Solana automatically: SOL to SPL, SPL to SOL, or SPL to SPL using your Monei wallet, with slippage control.

Instructions

Swaps one token for another on Solana using the user's Monei wallet.

Routing is automatic based on which fields you provide:

  • outputMint provided + no inputMint → SOL to SPL token (e.g. SOL → USDC)

  • inputMint + outputMint both provided → SPL to SPL token (e.g. USDC → USDT)

  • inputMint provided + no outputMint → SPL token to SOL (e.g. USDC → SOL)

Before calling:

  1. Confirm the user has sufficient balance using monei_get_solana_portfolio

  2. Mint addresses for common tokens: USDC = EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v, USDT = Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB

  3. Show the user what they are swapping and get confirmation before executing

Args:

  • amount (number|string): Amount to swap. SOL-to-token: number (e.g. 1). Token-to-SOL: string (e.g. '100'). Token-to-token: number.

  • inputMint (string, optional): Mint address of the SPL token to sell. Omit when selling SOL.

  • outputMint (string, optional): Mint address of the SPL token to buy. Omit when buying SOL.

  • slippageBps (number, optional): Slippage tolerance in basis points. Default 50 (0.5%).

Returns: { "signature": string, // Solana transaction signature "txUrl": string, // Explorer URL to view the transaction "route": string // Human-readable description of what was swapped }

Examples:

  • "Swap 1 SOL for USDC" -> amount: 1, outputMint: USDC mint, no inputMint

  • "Swap 100 USDC for SOL" -> amount: "100", inputMint: USDC mint, no outputMint

  • "Swap 50 USDC for USDT on Solana" -> amount: 50, inputMint: USDC mint, outputMint: USDT mint

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
amountYesAmount to swap. For SOL-to-token use a number (e.g. 1 for 1 SOL). For token-to-SOL use a string (e.g. '100' for 100 USDC). For token-to-token use a number.
inputMintNoMint address of the token to sell. Omit if selling native SOL.
outputMintNoMint address of the token to buy. Omit if buying native SOL.
slippageBpsNoSlippage tolerance in basis points. Default is 50 (0.5%).

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv1.3.1

TDQS

A4.7/5.0
Behavior5/5

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

Even with destructiveHint=true and readOnly=false annotations, the description adds meaningful behavioral context: routing is determined automatically by provided fields, a balance check and user confirmation are expected before execution, and the on-chain result is a signature plus explorer URL. This complements the annotations without contradicting them.

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 well-structured into routing rules, pre-call steps, argument explanations, return format, and examples. The critical routing logic is front-loaded and every section serves a distinct purpose. It is detailed without being rambling, and it fills the gap left by the absence of an output schema.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 4-parameter mutation tool with no output schema, the description is complete. It covers preconditions, parameter combinations, common token addresses, return fields, and realistic examples. An agent has everything needed to invoke the tool correctly and explain the outcome to the user.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is already 100%, so the baseline is 3. The description goes beyond the schema by adding a routing matrix, worked examples, and actual mint addresses for USDC and USDT. This helps an agent select parameter combinations correctly, though the schema itself already carries most of the parameter meaning.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The first sentence states a specific verb ('Swaps'), resource ('one token for another'), and network ('on Solana'), using the user's Monei wallet. The 'Solana' qualifier clearly distinguishes it from the EVM swap sibling, and the accompanying examples reinforce the intent.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives explicit pre-call guidance: check the Solana portfolio for sufficient balance, show the user what is being swapped, and get confirmation before executing. It also explains the three routing scenarios based on inputMint and outputMint presence. It does not explicitly name monei_swap_tokens_evm as the EVM alternative or state when not to use this tool, so it falls just short of a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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/Mr-Money01/mcp-server'

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