Skip to content

Vestige MCP: get_v4_swap_data_transactions returns 422 due to missing fields in POST body #3

@temptemp3

Description

@temptemp3

Summary

The vestige_get_v4_swap_data_transactions tool sends args.swap_data as the POST body to /swap/v4/transactions, but the Vestige API requires additional top-level fields (asset_in_price, asset_out_price, asset_images) that are present in the quote response but not forwarded.

Steps to Reproduce

  1. Call vestige_get_best_v4_swap_data for any pair (e.g., FINITE->aVOI)
  2. Pass the result to vestige_get_v4_swap_data_transactions
  3. Tool returns 422 Unprocessable Entity

Root Cause

In swaps.ts, the handler sends only args.swap_data as the POST body. The Vestige API validates that asset_in_price, asset_out_price, and asset_images are present at the top level. These fields exist in the quote response but the tool expects the caller to include them in swap_data.

Additional Note

Even when calling the API directly with all required fields, the /swap/v4/transactions endpoint returns null (HTTP 200) for all swap pairs tested (including simple ALGO->USDC). This may be a Vestige API-side issue.

Suggested Fix

Pass the full quote response object (including prices and asset_images) as the POST body, or merge sender/slippage into the swap data before posting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions