Skip to content

fix: register gateway MCP tools for agents#72

Open
aaurix wants to merge 2 commits into
hummingbot:mainfrom
AnalyThothAI:fix/register-gateway-mcp-tools
Open

fix: register gateway MCP tools for agents#72
aaurix wants to merge 2 commits into
hummingbot:mainfrom
AnalyThothAI:fix/register-gateway-mcp-tools

Conversation

@aaurix
Copy link
Copy Markdown

@aaurix aaurix commented Apr 25, 2026

Summary

This PR registers the missing Gateway MCP tools that Condor agents already reference and that the official Condor MCP Tools documentation lists under Gateway (DEX Trading):

  • manage_gateway_container() for Gateway Docker lifecycle operations
  • manage_gateway_config() for Gateway chains, networks, tokens, connectors, pools, and wallets
  • manage_gateway_swaps() for DEX swap quote, execution, search, and status operations
  • manage_gateway_clmm() for CLMM liquidity position management

Problem

Condor's agent-facing documentation and internal agent safety logic expect Gateway MCP tools to be available, but the Hummingbot MCP server did not expose the complete Gateway tool surface.

Specifically:

  • The official docs list manage_gateway_swaps(), manage_gateway_clmm(), and manage_gateway_container() in the Gateway tool group.
  • CONDOR.md, agent confirmation logic, and risk checks reference manage_gateway_clmm for LP position actions.
  • The initial Gateway wrappers for container/config had a formatter contract mismatch: the server wrapper passed extra arguments to formatter functions that accept only the result dictionary.

The result is that agents can be instructed to use Gateway tools that are not registered in the MCP server, and Gateway container/config calls can fail at formatting time even after the API call succeeds.

Solution

This PR:

  • Adds GatewayCLMMManageRequest for CLMM position operations.
  • Implements manage_gateway_clmm() using the existing hummingbot-api-client Gateway CLMM router methods:
    • open_position
    • close_position
    • collect_fees
    • get_positions_owned
    • search_positions
  • Registers manage_gateway_clmm() in mcp_servers/hummingbot_api/server.py.
  • Registers the existing Gateway container/config/swap implementations as MCP tools.
  • Fixes Gateway container/config formatter calls to match the existing formatter signatures.
  • Adds a CLMM result formatter for position management actions.
  • Adds manage_gateway_clmm to the agent MCP preload hint.
  • Adds focused tests covering Gateway tool registration, formatter contracts, and CLMM decimal argument conversion.

Testing

Ran locally:

uv run pytest
python -m py_compile mcp_servers/hummingbot_api/server.py mcp_servers/hummingbot_api/schemas.py mcp_servers/hummingbot_api/tools/gateway.py mcp_servers/hummingbot_api/tools/gateway_swap.py mcp_servers/hummingbot_api/tools/gateway_clmm.py mcp_servers/hummingbot_api/formatters/gateway.py handlers/agents/_shared.py tests/conftest.py tests/test_hummingbot_mcp_gateway_tools.py
git diff --check

Results:

  • uv run pytest: 4 passed
  • py_compile: passed
  • git diff --check: passed

Notes

The branch is based on the latest origin/main at commit 2105d27 and is focused on MCP Gateway tool registration and contract fixes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant