Skip to main content
Glama

test-proxy-connection

Verify proxy connectivity for a specified cryptocurrency exchange by inputting its ID, ensuring proper integration with the CCXT MCP Server.

Instructions

Test the proxy connection with a specified exchange

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
exchangeYesExchange ID to test connection with (e.g., binance)

Implementation Reference

  • The core handler function that implements the logic for testing the proxy connection. It checks if proxy is enabled via environment variable, retrieves proxy config, and returns validation results or error messages.
    }, async ({ exchange }) => { try { const useProxy = process.env.USE_PROXY === 'true'; if (!useProxy) { return { content: [{ type: "text", text: JSON.stringify({ success: false, message: "Proxy is not enabled. Enable it first with set-proxy-config" }, null, 2) }] }; } const proxyConfig = getProxyConfig(); if (!proxyConfig) { return { content: [{ type: "text", text: JSON.stringify({ success: false, message: "Proxy is enabled but not properly configured" }, null, 2) }] }; } // Since we can't create a standalone test here without potentially affecting // the exchange cache, we'll just return the current configuration return { content: [{ type: "text", text: JSON.stringify({ message: "Proxy configuration looks valid", proxyUrl: proxyConfig.url, note: "To test actual connectivity, try fetching data from an exchange using one of the other tools" }, null, 2) }] }; } catch (error) { log(LogLevel.ERROR, `Error testing proxy: ${error instanceof Error ? error.message : String(error)}`); return { content: [{ type: "text", text: `Error: ${error instanceof Error ? error.message : String(error)}` }], isError: true }; } });
  • Zod schema defining the input parameter 'exchange' as a required string.
    exchange: z.string().describe("Exchange ID to test connection with (e.g., binance)"),
  • Registration of the 'test-proxy-connection' tool using server.tool(), including name, description, schema, and inline handler function.
    server.tool("test-proxy-connection", "Test the proxy connection with a specified exchange", { exchange: z.string().describe("Exchange ID to test connection with (e.g., binance)"), }, async ({ exchange }) => { try { const useProxy = process.env.USE_PROXY === 'true'; if (!useProxy) { return { content: [{ type: "text", text: JSON.stringify({ success: false, message: "Proxy is not enabled. Enable it first with set-proxy-config" }, null, 2) }] }; } const proxyConfig = getProxyConfig(); if (!proxyConfig) { return { content: [{ type: "text", text: JSON.stringify({ success: false, message: "Proxy is enabled but not properly configured" }, null, 2) }] }; } // Since we can't create a standalone test here without potentially affecting // the exchange cache, we'll just return the current configuration return { content: [{ type: "text", text: JSON.stringify({ message: "Proxy configuration looks valid", proxyUrl: proxyConfig.url, note: "To test actual connectivity, try fetching data from an exchange using one of the other tools" }, null, 2) }] }; } catch (error) { log(LogLevel.ERROR, `Error testing proxy: ${error instanceof Error ? error.message : String(error)}`); return { content: [{ type: "text", text: `Error: ${error instanceof Error ? error.message : String(error)}` }], isError: true }; } });

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/doggybee/mcp-server-ccxt'

If you have feedback or need assistance with the MCP directory API, please join our Discord server