Skip to content

Add MCP tool for managing rate oracle sources #53

Description

@fengtality

Problem

When users ask to change the rate oracle source (e.g., "change my rate oracle source to hyperliquid"), the agent currently has no dedicated MCP tool and must:

  1. Fetch /openapi.json to discover available endpoints
  2. Trial-and-error multiple HTTP methods and request formats
  3. Make multiple failed API calls before finding the correct approach

This is inefficient and results in:

  • 6+ API calls just to change a simple configuration
  • Multiple 4xx errors (404, 405, 422) before success
  • Unnecessary latency and complexity

Evidence

Server Logs

The logs show the agent's trial-and-error approach:

POST /api/v1/update-client-config HTTP/1.1" 404 Not Found
GET /openapi.json HTTP/1.1" 200 OK
GET /rate-oracle/sources HTTP/1.1" 200 OK
GET /rate-oracle/config HTTP/1.1" 200 OK
POST /rate-oracle/config HTTP/1.1" 405 Method Not Allowed
PUT /rate-oracle/config HTTP/1.1" 422 Unprocessable Entity
PATCH /rate-oracle/config HTTP/1.1" 405 Method Not Allowed
PUT /rate-oracle/config HTTP/1.1" 200 OK  # Finally succeeded

Agent Conversation

The agent had to execute 7 tool calls to complete a simple task:

  • mcp-hummingbot: manage controllers (no rate oracle support)
  • Multiple curl commands trying different endpoints and methods
  • Fetching docs and openapi.json to discover the API structure

Proposed Solution

Add a dedicated MCP tool (or extend existing tool) for rate oracle management with these capabilities:

Tool: manage_rate_oracle (or add to existing tool)

Operations:

  1. list_sources - Get available rate oracle sources
  2. get_config - Get current rate oracle configuration
  3. set_source - Change the rate oracle source

Example Usage:

# List available sources
manage_rate_oracle(operation="list_sources")

# Get current config
manage_rate_oracle(operation="get_config")

# Set source
manage_rate_oracle(operation="set_source", source="hyperliquid")

Benefits

  • Single tool call instead of 6+ API calls
  • No need to fetch openapi.json or trial-and-error
  • Clear interface with proper validation
  • Better user experience with faster response times

Screenshots

Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions