Skip to main content
Glama

execute_swap_transaction

Complete a token swap on Solana by signing and executing a transaction from a Jupiter quote, spending real funds irreversibly.

Instructions

🚨 WARNING: THIS WILL EXECUTE A REAL TRADE AND SPEND ACTUAL SOL! 🚨

Sign and execute a swap transaction via Jupiter Ultra API.

This is a PAID operation that executes real trades on the Solana blockchain. Only call this function when you want to actually execute a trade.

This method will:

  1. Sign the provided unsigned transaction with your configured private key

  2. Execute the signed transaction on the Solana blockchain

  3. SPEND REAL SOL/TOKENS - THIS IS NOT REVERSIBLE!

Args: transaction: The base64 encoded UNSIGNED transaction from get_swap_quote request_id: The request ID from the swap quote response

Returns: Dictionary containing: - success: Boolean indicating if the execution was successful - data: Contains 'signature' and transaction details if successful - error: Error message if execution failed

Example: >>> # First get a quote >>> quote = await api.get_swap_quote(input_mint, output_mint, amount) >>> if quote["success"]: ... # Then execute the trade ... result = await api.execute_swap_transaction( ... transaction=quote["data"]["transaction"], ... request_id=quote["data"]["requestId"] ... ) ... if result["success"]: ... print(f"Trade executed! Signature: {result['data']['signature']}")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
request_idYes
transactionYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

With no annotations provided, the description carries the full burden and excels: it warns about irreversible spending, mentions signing with a configured private key, and outlines the execution steps. It also discloses the non-reversible nature and actual cost, going well beyond basic read/write hints.

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?

Although long, the description is efficiently structured with a clear warning, numbered steps, args, returns, and an example. Every section adds critical information and none is redundant or filler, making it appropriate for a high-stakes operation.

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 complex, irreversible transaction tool, the description covers the execution pipeline, prerequisites (quote retrieval), parameter meanings, return format, and an example. It is fully self-contained even without an output schema shown, addressing all necessary context.

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

Parameters5/5

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

The schema provides only type and title, but the description explains 'transaction' is a base64 encoded UNSIGNED transaction from get_swap_quote and 'request_id' is from the swap quote response. This contextualizes both parameters and even includes an example showing exactly how to pass them, compensating fully for zero schema coverage.

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 description clearly states it 'Sign and execute a swap transaction via Jupiter Ultra API' and emphasizes it executes a REAL trade spending actual SOL. This distinguishes it from sibling tools like execute_limit_order while specifying the exact resource (swap transaction) and action (execute).

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

Usage Guidelines5/5

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

It explicitly says 'Only call this function when you want to actually execute a trade' and provides a clear pre-requisite flow via get_swap_quote. The example shows the sequence of obtaining a quote then executing, making when-to-use unmistakable.

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/araa47/jupiter-mcp'

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