Skip to main content
Glama

OpenFinance — Easy Trading: Crypto, Stocks, Perps & Prediction Markets

onchain_jupiter_execute

Jupiter Swap v2 — sign and execute a previously-fetched order. Wraps POST https://api.jup.ag/swap/v2/execute. The backend signs the unsigned transaction (from onchain_jupiter_order) with the caller's Privy Solana wallet (sign-only), then forwards to Jupiter which routes and broadcasts the swap. Returns Jupiter's execution result: status ('Success' | 'Failed'), signature, slot, totalInputAmount, totalOutputAmount, swapEvents (per-AMM in/out amounts). Solana wallet must be delegated to the app first — otherwise 412 with delegate-wallet instructions.

⚠️ SAFETY — Solana swaps are irreversible on success. Before calling, show the user a summary from the corresponding onchain_jupiter_order response — input token + amount, output token + estimated amount, route, slippage, fees — and require explicit confirmation. Do not call this tool without per-write user confirmation.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "transaction": "<transaction>",
      "requestId": "<requestId>"
    },
    "name": "onchain_jupiter_execute"
  }
}

Input Schema

NameRequiredDescriptionDefault
requestIdYesrequestId returned by onchain_jupiter_order. Jupiter requires it to tie the execution to the quote.
transactionYesBase64 unsigned transaction returned by onchain_jupiter_order in the `transaction` field. Pass it through unmodified.
lastValidBlockHeightNoOptional block height for nonce validation (use the one from the order response when available).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does: it discloses that swaps are irreversible on success, that the backend signs with the caller's Privy wallet in sign-only mode, that a delegated wallet is required (else 412 with instructions), and that Jupiter broadcasts the transaction. This is exactly the behavioral context an agent needs before a destructive write.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with purpose and endpoint, then flow, then return shape, then the safety block. The safety warning is longer than a single line but every clause is load-bearing for a destructive financial operation, so the length is justified rather than padded.

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?

Despite no output schema, the description enumerates the return fields (status, signature, slot, totalInput/OutputAmount, swapEvents), covers auth prerequisites, error behavior, and required confirmation. Nothing an agent needs to call this correctly is missing.

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 100%, so the schema documents all three parameters; the description still adds value by tying 'transaction' to the order response, explaining requestId as the quote-linking value, and noting lastValidBlockHeight is optional and sourced from the order. It reinforces rather than merely repeats the schema.

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?

States a specific verb+resource ('sign and execute a previously-fetched order') and names the exact upstream tool that produces its input ('from onchain_jupiter_order'), cleanly separating it from the sibling that fetches quotes. The wrapped endpoint is given, so an agent knows precisely what operation this performs.

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?

Explicitly requires that an order was already fetched via onchain_jupiter_order, states the wallet-delegation precondition, and mandates per-write user confirmation before calling. The condition selecting this tool over onchain_jupiter_order is unambiguous.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.