Skip to main content
Glama
@odatano/nightgate-mcp

@odatano/nightgate-mcp

Official
by ODATANO

sponsor_swap

Merges two mirrored shielded-token swap halves without a contract, validates both offers, pays the fee, and submits the transaction as sponsor; retries deduplicate.

Instructions

A swap settles two shielded tokens between two wallets without a contract: each side builds one half (it spends the coin it gives and creates the coin it wants), the two mirrored halves merge into one transaction, and a sponsor pays the fee. This hands the two halves to the sponsor, which checks them, merges them, pays the dust and submits: each half carries an offer and nothing else, gives exactly one token type and wants exactly one other, both on the sponsor's token allow-list and never NIGHT, at most 4 inputs and 2 outputs per half, and the halves mirror each other in types and amounts. A half may be bound or unbound and is passed as offer file text or base64. Off on a server by default (NIGHTGATE_SPONSOR_ALLOW_SWAPS); an agent grant needs sponsorSwap in its allowedActions. Job result { txHash, transactionHash, swap: { gives, wants } }. An offer fills once: if it was taken first by somebody else the job fails. Pass both halves, or halfId alone for an offer this server took (take_swap_offer keeps both halves); with offerId the maker half comes from the board, next to takerHalf or the halfId of the taken offer. The tool also waits for the block (about a minute more) and then carries the instance's signed receipt; if that wait runs out, receipt is null and the same call again fetches it. The tool waits until the job settled (about 1 minute) and returns { status, txHash, transactionHash, result }. failed: next says what to do. If the call was cut off or came back pending, run it again with the same arguments: it picks up the job it started and submits nothing new (the answer says deduplicated). With an idempotencyKey that also holds after a restart of this server. A second, separate call with the same arguments needs a new idempotencyKey.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "sponsor_swap"
  }
}

Input Schema

NameRequiredDescriptionDefault
halfIdNoId of the half this server built for the swap: alone it names a taken offer, next to both halves it ties the job to the half
offerIdNoAn offer on the server's board (list_swap_offers): the server takes the maker half from there; pass takerHalf or the halfId of the taken offer with it
makerHalfNoThe maker's half (the offer): offer file text (swapoffer1...) or base64 of the serialized, proven transaction
takerHalfNoThe taker's half: offer file text (swapoffer1...) or base64 of the serialized, proven transaction
takerSecretNoFor a directed board offer: the secret its poster handed you
idempotencyKeyNoDedupes retries of the SAME two halves

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.20.3
    • addedInput schema / properties / takerSecret
      Added value: +{
      +  "description": "For a directed board offer: the secret its poster handed you",
      +  "maxLength": 256,
      +  "minLength": 1,
      +  "type": "string"
      +}
  2. Addedv0.18.3

TDQS

A4/5.0
Behavior5/5

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

With zero annotations, the description carries the full disclosure burden and does so: it discloses that the feature is off by default, that an offer fills exactly once and fails if someone else took it, that the call blocks ~1 minute for settlement plus an extra wait for the signed receipt (returning receipt=null and refetchable on the same call), and that retries with identical arguments dedupe rather than double-submit. It also lists the sponsor's validation rules (single token type each way, allow-list only, never NIGHT, max 4 inputs / 2 outputs per half, mirrored types and amounts).

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 content is dense and useful but delivered as one long run-on paragraph with several very long sentences and no visual separation between mechanism, constraints, return value, and retry guidance. Some material is near-duplicative (two separate descriptions of the wait and of the returned fields: `{ txHash, transactionHash, swap }` versus `{ status, txHash, transactionHash, result }`), which forces the reader to reconcile them.

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?

With no annotations and no output schema, the description must and largely does cover prerequisites, validation limits, blocking behavior, return shape, failure/next guidance, and retry/idempotency semantics — enough for an agent to call it correctly. The remaining gap is that the exact permitted combinations of halfId/offerId/makerHalf/takerHalf are described across several sentences without a single unambiguous enumeration, leaving some inference about which parameter sets are legal.

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 coverage is 100%, so the schema already defines each of the six parameters, and the baseline is 3. The description does add real meaning beyond it — that halfId alone means "an offer this server took" while next to both halves it merely ties the job to the half, that offerId pulls the maker half from the board, and that idempotencyKey's dedupe survives a server restart but does not cover a deliberate second call. That added routing semantics is modest but genuine, so it sits at the top of the baseline band rather than above it.

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 description names a specific operation (a sponsored, contract-free atomic swap that merges two mirrored halves and has a sponsor pay the fee) and its scope, so it is clearly distinguishable from sponsor_finalized_transaction or build_swap_offer. However, it opens with a mechanism explanation rather than a one-line statement of what the tool does, so the purpose has to be reconstructed from the paragraph.

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 gives concrete invocation routes: pass both halves, or `halfId` alone for an offer this server already took (explicitly cross-referencing take_swap_offer), or `offerId` for a board offer plus takerHalf/halfId, and it points at list_swap_offers for the board. It also states the prerequisites (server flag NIGHTGATE_SPONSOR_ALLOW_SWAPS, sponsorSwap in the grant's allowedActions). There are no explicit exclusions saying when to prefer a sibling instead, which keeps it short of a 5.

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