Skip to main content
Glama
sera-cx

Sera MCP Server

Official
by sera-cx

prepare_swap

Prepares a swap transaction on Sera, returning transaction data to sign and send. Alerts if token allowance is insufficient and approval is needed.

Instructions

Prepare a swap transaction. Returns transaction data that needs to be signed and sent. May return approval_needed if token allowance is insufficient.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
to_tokenYesDestination token address
amount_inYesAmount to swap (human-readable)
directionYesTrade direction
from_tokenYesSource token address
user_addressYesUser's wallet address
market_addressYesMarket contract address
Behavior3/5

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

With no annotations, the description carries the full burden. It discloses that the tool does not send the transaction directly (requires signing/sending) and may return an approval_needed flag. However, it does not describe the return structure, error handling, or whether the tool performs any on-chain reads. This is partial disclosure, leaving gaps about permissions and failure modes.

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 long and front-loaded with the primary purpose. Every word adds value: 'Prepare a swap transaction', 'Returns transaction data that needs to be signed and sent', and 'May return approval_needed...' No filler or repetition.

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

Completeness3/5

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

The tool has 6 required parameters and no output schema. The description explains the main return (transaction data) and a conditional (approval_needed), but lacks details on the structure of the returned data, how to interpret it, and any additional fields. For a preparation tool, this is a moderate level of completeness but insufficient for complex integration without further documentation.

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 extra meaning to the parameters; the schema already provides clear, basic descriptions like 'Destination token address' and 'Source token address'. The tool description focuses on behavior, not parameter semantics.

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 the tool's function: 'Prepare a swap transaction.' It further specifies that it returns transaction data to be signed and sent, distinguishing it from siblings like execute_swap and get_swap_quote. The verb 'prepare' and resource 'swap transaction' are specific and unambiguous.

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: the output is transaction data that must be signed and sent, indicating this is a pre-execution step. It also mentions that approval_needed may be returned if allowance is insufficient, giving a conditional prerequisite. However, it does not explicitly name alternatives or edge cases for when not to use this tool.

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