Skip to main content
Glama
mako10k

Web Proxy MCP Server

by mako10k

proxy_import_config

Import proxy configuration from a file to set up or update your Web Proxy MCP Server settings for automated traffic monitoring and analysis.

Instructions

Import proxy configuration from file

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filepathYesPath to configuration file
mergeNoMerge with existing config or replace

Implementation Reference

  • Core handler function that reads the configuration file, optionally clears existing targets if merge=false, parses and imports targets using importTargets method, and returns import results.
    async importFromFile(filepath, merge = false) {
      try {
        const fs = await import('fs/promises');
        const data = await fs.readFile(filepath, 'utf-8');
        
        if (!merge) {
          this.targets.clear();
        }
        
        const imported = this.importTargets(data);
        return { imported, merge };
      } catch (error) {
        throw new Error(`Failed to import from file: ${error.message}`);
      }
    }
  • Tool schema defining input parameters: filepath (required string) and optional merge boolean.
    proxy_import_config: {
      name: "proxy_import_config",
      description: "Import proxy configuration from file",
      inputSchema: {
        type: "object",
        properties: {
          filepath: {
            type: "string",
            description: "Path to configuration file"
          },
          merge: {
            type: "boolean",
            description: "Merge with existing config or replace",
            default: false
          }
        },
        required: ["filepath"]
      }
    },
  • ToolHandlers dispatch case for proxy_import_config: validates args, calls targetManager.importFromFile, formats and returns success message with stats.
    case 'proxy_import_config':
      const imported = await this.targetManager.importFromFile(
        args.filepath,
        args.merge
      );
      
      return {
        content: [{
          type: "text",
          text: `📥 Configuration imported from ${args.filepath}\nTargets imported: ${imported.imported}\nTotal targets: ${this.targetManager.getStats().total}`
        }]
      };
  • Helper method called by importFromFile: parses JSON, iterates over targets, adds each via addTarget, counts imported.
    importTargets(jsonData) {
      try {
        const data = JSON.parse(jsonData);
        let imported = 0;
    
        if (data.targets && typeof data.targets === 'object') {
          for (const [domain, config] of Object.entries(data.targets)) {
            this.addTarget(domain, config);
            imported++;
          }
        }
    
        return imported;
      } catch (error) {
        throw new Error(`Failed to import targets: ${error.message}`);
      }
    }
  • Main ToolHandlers.handleTool method: validates input using schema from tool-definitions, routes 'proxy_import_config' (contains 'config') to _handleConfigTool which contains the specific case.
    async handleTool(name, args = {}) {
      // Validate arguments
      const validation = validateToolArgs(name, args);
      if (!validation.valid) {
        return {
          error: validation.error,
          isError: true
        };
      }
    
      try {
        // Route to appropriate handler
        if (name.startsWith('proxy_target_') || name.includes('_target')) {
          return await this._handleTargetTool(name, args);
        } else if (name.startsWith('proxy_server_') || name.includes('_server')) {
          return await this._handleServerTool(name, args);
        } else if (name.startsWith('ssl_')) {
          return await this._handleSSLTool(name, args);
        } else if (name.includes('setup') || name.includes('pac')) {
          return await this._handleSetupTool(name, args);
        } else if (name.includes('traffic') || name.includes('har')) {
          return await this._handleTrafficTool(name, args);
        } else if (name.includes('config')) {
          return await this._handleConfigTool(name, args);
        } else if (name.includes('analyze') || name.includes('metrics')) {
          return await this._handleAnalysisTool(name, args);
        }
    
        return {
          error: `Unknown tool: ${name}`,
          isError: true
        };
      } catch (error) {
        return {
          error: error.message,
          isError: true,
          stack: error.stack
        };
      }
    }
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It implies a write operation ('Import') but doesn't disclose critical details like required permissions, whether it overwrites or merges by default (though the schema hints at this), error handling, or impact on server state. This is inadequate for a mutation tool with zero annotation coverage.

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 with zero wasted words. It's front-loaded with the core action and resource, making it easy 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 tool's complexity (a mutation operation with no annotations and no output schema), the description is insufficient. It lacks details on behavioral traits, error conditions, or output expectations, leaving significant gaps for an agent to operate safely and effectively.

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%, with clear documentation for both parameters (filepath and merge). The description adds no additional meaning beyond the schema, such as file format specifics or merge behavior implications. Baseline 3 is appropriate since the schema does the heavy lifting.

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 ('Import') and resource ('proxy configuration from file'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like proxy_export_config, which handles the opposite operation, so it doesn't reach the highest score.

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. It doesn't mention prerequisites (e.g., file format, server status), exclusions, or relationships with siblings like proxy_export_config or proxy_update_target, leaving the agent to infer usage context.

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

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/mako10k/mcp-web-proxy'

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