Skip to main content
Glama
sera-cx

Sera MCP Server

Official
by sera-cx

execute_swap

Execute a token swap on Sera: get a quote, approve tokens if needed, sign and submit the transaction.

Instructions

Execute a swap transaction. Gets a quote, handles token approval if needed (sends on-chain approve tx for non-permit tokens like USDT), signs the EIP-712 intent, and submits. Requires WALLET_PRIVATE_KEY.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
amountYesAmount to swap (in token units, e.g., '100' for 100 tokens)
to_tokenYesAddress of token to buy
from_tokenYesAddress of token to sell
Behavior4/5

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

With no annotations, the description carries the full transparency burden. It discloses important side effects such as sending an on-chain approve transaction for non-permit tokens, signing an EIP-712 intent, and submitting the transaction, plus the private key requirement. This gives a clear picture of the tool's behavior, though it does not mention gas costs or transaction confirmation behavior.

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 two sentences, front-loaded with the core action, and each sentence adds essential information about the flow and requirements. There is no fluff or redundant content.

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

Completeness4/5

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

For a transaction-executing tool with side effects and no output schema, the description covers the main steps (approval, signing, submission), prerequisites, and the internal quote step. However, it does not clarify the relationship to prepare_swap or describe the return value, so it is not fully complete.

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?

Schema description coverage is 100%, so the baseline is 3. The description does not add any parameter-specific details beyond what the schema already provides; it only references tokens and amount generically. Thus, it meets but does not exceed the baseline.

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 'Execute a swap transaction' and outlines the full flow including quote retrieval, approval handling, EIP-712 signing, and submission. This distinguishes it from siblings like get_swap_quote and prepare_swap, which are not full execution tools.

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 provides clear context by indicating the tool handles the entire swap process internally, including getting a quote, so users know they don't need to call get_swap_quote separately. It also states a key prerequisite: 'Requires WALLET_PRIVATE_KEY.' However, it does not explicitly mention when to prefer this over prepare_swap or when to avoid it, so it lacks explicit exclusions.

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/sera-cx/sera-mcp-v2'

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