Skip to main content
mpp_close_session settles your active MPP payment channel on the Stellar network. It broadcasts the final channel state as a single on-chain transaction, pays the recipient the total amount committed across all mpp_fetch calls, and refunds any unused portion of your original budget back to your wallet. This tool takes no parameters — it operates on the currently active session.

Parameters

mpp_close_session takes no parameters.

Response

Success

Success response
{
  "status": "ok",
  "data": {
    "tx_hash": "9d3e1a7f...4c88",
    "channel_id": "ch_4f8a2b1e",
    "amount_paid_usdc": 0.013,
    "amount_refunded_usdc": 0.987,
    "session_state": "closed"
  }
}
status
string
Always "ok" when the session is settled successfully.
data.tx_hash
string
The Stellar transaction hash for the on-chain settlement.
data.channel_id
string
The ID of the channel that was closed.
data.amount_paid_usdc
number
The total USDC paid to the recipient, equal to the sum of all mpp_fetch commitments in the session.
data.amount_refunded_usdc
number
The USDC returned to your wallet from the unused portion of the original budget.
data.session_state
string
Will be "closed" after successful settlement.

Error — no active session

No active session
{
  "status": "error",
  "reason": "No active MPP session to close."
}

Error — settlement failure

Settlement failure
{
  "status": "error",
  "reason": "On-chain settlement failed: transaction rejected by Stellar network"
}

Best practice

Always close your MPP session explicitly when you are finished making requests. While sessions may eventually expire, calling mpp_close_session immediately frees up your locked budget and returns unused funds to your spendable balance without delay.

Example

Tool call
{
  "tool": "mpp_close_session",
  "input": {}
}
Response
{
  "status": "ok",
  "data": {
    "tx_hash": "9d3e1a7fc4b2...4c88",
    "channel_id": "ch_4f8a2b1e",
    "amount_paid_usdc": 0.013,
    "amount_refunded_usdc": 0.987,
    "session_state": "closed"
  }
}
After closing a session, you can immediately open a new one with mpp_open_session if you need to make more MPP-gated requests.