Skip to main content
Glama

near_swap

Read-onlyIdempotent

Swap any asset through NEAR Intents — get a deposit address — An executable NEAR Intents swap: a binding quote with a deposit address. Send amountIn of the origin asset there before the deadline; the output goes to recipient, or it is refunded to refundTo. Funds never pass through us. Any asset NEAR Intents routes, across chains. Buying a NEAR token runs near-token-safety first and refuses a STOP token unless force=1. Track with near-swap-status. Required inputs: from, to, amount, recipient, refundTo. Priced $0.01 per call over x402 on Base; send a prepaid x-credit-token header for unlimited calls, or get 1 free call/day per tool. No API key required.

Input Schema

NameRequiredDescriptionDefault
toYesAsset you want
fromYesAsset you pay with
amountYesAmount of the paying asset
refundToYesYour address on the origin chain (refunds)
slippageNoSlippage in bps (optional, default 100)
recipientYesReceiving address on the destination chain
depositTypeNoINTENTS to pay from a NEAR Intents balance (optional)

Output Schema

NameRequiredDescriptionDefault
dataNoThe result payload. Shape is service-specific; every field is documented in the tool description.
serviceNoThe service id that answered.
checkedAtNoISO-8601 timestamp of when the underlying reads were taken.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / depositType
      Added value: +{
      +  "description": "INTENTS to pay from a NEAR Intents balance (optional)",
      +  "type": "string"
      +}
  2. Added

TDQS

A3.8/5.0
Behavior4/5

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

Beyond the annotations it discloses the full lifecycle (send amountIn before the deadline, output to recipient, refund to refundTo), custody posture ("Funds never pass through us"), and operational constraints (x402 payment at $0.01/call on Base, prepaid x-credit-token header, 1 free call/day, no API key). The one caveat is that "executable swap" and "binding quote" sit in mild tension with readOnlyHint=true/idempotentHint=true, though the non-custodial framing and external deposit step make that defensible rather than a direct contradiction.

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

Conciseness3/5

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

The first clause is well front-loaded and immediately actionable, and most sentences do earn their place (deadline, refund path, safety gate, pricing). However, the body is a dense run-on that mixes execution mechanics, token-safety rules, tracking, and billing without structural separation, which makes it harder to scan than its length warrants.

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 complex, cross-chain, paid, non-custodial swap, the description covers the inputs, the execution/refund lifecycle, the safety precondition, the tracking tool, and the payment model, and an output schema exists so return values need no explanation. The remaining gap is selection guidance against the near_swap_quote sibling and any note on the optional slippage/depositType behavior.

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 schema already documents from, to, amount, recipient, refundTo, slippage, and depositType. The description only restates the required set ("Required inputs: from, to, amount, recipient, refundTo") and adds no format, default, or semantics beyond what the schema provides; slippage and depositType are not mentioned at all. Baseline 3 is appropriate when the schema carries the parameter burden.

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

Purpose4/5

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

The lead sentence gives a specific verb and resource — "Swap any asset through NEAR Intents — get a deposit address" — and clarifies the artifact returned is a binding quote plus deposit address. It names two siblings (near-token-safety, near-swap-status) for the safety and tracking steps. It stops short of 5 because it never distinguishes itself from the adjacent near_swap_quote or the other swap tools in the sibling list.

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?

It states clear applicability ("Any asset NEAR Intents routes, across chains"), lists the five required inputs, and gives a conditional rule ("Buying a NEAR token runs near-token-safety first and refuses a STOP token unless force=1"). It also routes the agent to near-swap-status for follow-up. It does not, however, state when to prefer near_swap_quote, base_swap, or swap_route instead.

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.

Resources