Skip to main content
Glama

set-proxy-config

Configure and manage proxy settings for all cryptocurrency exchanges on the CCXT MCP Server, enabling secure and controlled access to trading platforms. Define proxy URL, credentials, and clear cache for immediate changes.

Instructions

Configure proxy settings for all exchanges

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
clearCacheNoClear exchange cache to apply changes immediately
enabledYesEnable or disable proxy
passwordNoProxy password (optional)
urlYesProxy URL (e.g., http://proxy-server:port)
usernameNoProxy username (optional)

Implementation Reference

  • The handler function that implements the set-proxy-config tool logic by setting environment variables for proxy configuration and optionally clearing the exchange cache.
    }, async ({ enabled, url, username, password, clearCache }) => {
      try {
        // For security and simplicity, we'll use environment variables
        // In a production app, you might want to use a more persistent storage method
        process.env.USE_PROXY = enabled.toString();
        
        if (url) {
          process.env.PROXY_URL = url;
        }
        
        if (username !== undefined) {
          process.env.PROXY_USERNAME = username;
        }
        
        if (password !== undefined) {
          process.env.PROXY_PASSWORD = password;
        }
        
        log(LogLevel.INFO, `Proxy configuration updated. Enabled: ${enabled}`);
        
        // Clear exchange cache if requested
        if (clearCache) {
          clearExchangeCache();
          log(LogLevel.INFO, "Exchange cache cleared to apply new proxy settings");
        }
        
        return {
          content: [{
            type: "text",
            text: JSON.stringify({
              message: "Proxy configuration updated successfully",
              cacheCleared: clearCache,
              note: clearCache 
                ? "Exchange cache was cleared. New proxy settings will be applied immediately."
                : "Changes will only affect newly created exchange instances. Use clear-exchange-cache tool for immediate effect."
            }, null, 2)
          }]
        };
      } catch (error) {
        log(LogLevel.ERROR, `Error updating proxy configuration: ${error instanceof Error ? error.message : String(error)}`);
        return {
          content: [{
            type: "text",
            text: `Error: ${error instanceof Error ? error.message : String(error)}`
          }],
          isError: true
        };
      }
    });
  • Zod input schema defining parameters for the set-proxy-config tool.
    enabled: z.boolean().describe("Enable or disable proxy"),
    url: z.string().describe("Proxy URL (e.g., http://proxy-server:port)"),
    username: z.string().optional().describe("Proxy username (optional)"),
    password: z.string().optional().describe("Proxy password (optional)"),
    clearCache: z.boolean().default(true).describe("Clear exchange cache to apply changes immediately")
  • The server.tool call that registers the set-proxy-config tool with schema and inline handler.
    server.tool("set-proxy-config", "Configure proxy settings for all exchanges", {
      enabled: z.boolean().describe("Enable or disable proxy"),
      url: z.string().describe("Proxy URL (e.g., http://proxy-server:port)"),
      username: z.string().optional().describe("Proxy username (optional)"),
      password: z.string().optional().describe("Proxy password (optional)"),
      clearCache: z.boolean().default(true).describe("Clear exchange cache to apply changes immediately")
    }, async ({ enabled, url, username, password, clearCache }) => {
      try {
        // For security and simplicity, we'll use environment variables
        // In a production app, you might want to use a more persistent storage method
        process.env.USE_PROXY = enabled.toString();
        
        if (url) {
          process.env.PROXY_URL = url;
        }
        
        if (username !== undefined) {
          process.env.PROXY_USERNAME = username;
        }
        
        if (password !== undefined) {
          process.env.PROXY_PASSWORD = password;
        }
        
        log(LogLevel.INFO, `Proxy configuration updated. Enabled: ${enabled}`);
        
        // Clear exchange cache if requested
        if (clearCache) {
          clearExchangeCache();
          log(LogLevel.INFO, "Exchange cache cleared to apply new proxy settings");
        }
        
        return {
          content: [{
            type: "text",
            text: JSON.stringify({
              message: "Proxy configuration updated successfully",
              cacheCleared: clearCache,
              note: clearCache 
                ? "Exchange cache was cleared. New proxy settings will be applied immediately."
                : "Changes will only affect newly created exchange instances. Use clear-exchange-cache tool for immediate effect."
            }, null, 2)
          }]
        };
      } catch (error) {
        log(LogLevel.ERROR, `Error updating proxy configuration: ${error instanceof Error ? error.message : String(error)}`);
        return {
          content: [{
            type: "text",
            text: `Error: ${error instanceof Error ? error.message : String(error)}`
          }],
          isError: true
        };
      }
    });
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states 'Configure proxy settings for all exchanges', implying a system-wide mutation, but fails to mention critical aspects like whether this requires elevated permissions, if changes are reversible, potential side effects on ongoing exchanges, or rate limits. This leaves significant gaps for a tool that modifies global settings.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of configuring system-wide proxy settings, the description is insufficient. With no annotations, no output schema, and a mutation tool that could impact all exchanges, it should address permissions, side effects, or confirmation of changes. The current description leaves too many behavioral questions unanswered for safe and effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, providing clear documentation for all 5 parameters. The description adds no additional parameter semantics beyond what's in the schema, such as explaining relationships between parameters (e.g., username/password only needed when enabled) or format examples beyond the URL example already in the schema. This meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Configure') and resource ('proxy settings for all exchanges'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'get-proxy-config' or 'test-proxy-connection', which would require mentioning this is for setting/updating rather than retrieving or testing.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'get-proxy-config' or 'test-proxy-connection'. It lacks context about prerequisites, such as needing admin permissions or when proxy changes are appropriate, leaving the agent with no usage boundaries.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

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