Skip to main content
Glama
mako10k

Web Proxy MCP Server

by mako10k

proxy_export_config

Export current proxy configuration to a file for backup, sharing, or analysis purposes. Specify file path and optionally include traffic logs.

Instructions

Export current proxy configuration to file

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filepathNoOutput file path
includeTrafficLogNoInclude traffic log in export

Implementation Reference

  • The main handler for the proxy_export_config tool within _handleConfigTool. It validates args via validateToolArgs (called earlier), then calls targetManager.exportToFile with filepath and optional trafficLog from trafficAnalyzer, and returns a formatted success response with export details.
    case 'proxy_export_config':
      const exported = await this.targetManager.exportToFile(
        args.filepath,
        args.includeTrafficLog && this.trafficAnalyzer ? {
          trafficLog: this.trafficAnalyzer.getAllEntries()
        } : undefined
      );
    
      return {
        content: [{
          type: "text",
          text: `📤 Configuration exported to ${exported.filepath}\nTargets: ${exported.targetCount}\nFile size: ${exported.fileSize} bytes`
        }]
      };
  • Tool definition including name, description, and JSON schema for input validation (filepath required, includeTrafficLog optional boolean). Used by validateToolArgs and listTools.
    proxy_export_config: {
      name: "proxy_export_config",
      description: "Export current proxy configuration to file",
      inputSchema: {
        type: "object",
        properties: {
          filepath: {
            type: "string",
            description: "Output file path"
          },
          includeTrafficLog: {
            type: "boolean",
            description: "Include traffic log in export",
            default: false
          }
        }
      }
    },
  • index.js:66-74 (registration)
    MCP server registration of all tools (including proxy_export_config) via ListToolsRequestHandler, exposing name, description, and inputSchema from the imported TOOLS object.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: Object.entries(TOOLS).map(([name, tool]) => ({
          name,
          description: tool.description,
          inputSchema: tool.inputSchema
        }))
      };
    });
  • Core helper function in TargetManager that performs the actual file export: ensures directory exists, constructs JSON with targets and additionalData (e.g., trafficLog), writes file, returns filepath, targetCount, and fileSize.
    async exportToFile(filepath, additionalData = {}) {
      try {
        const fs = await import('fs/promises');
        const path = await import('path');
        
        // Ensure directory exists
        const dir = path.dirname(filepath);
        await fs.mkdir(dir, { recursive: true });
        
        const exportData = {
          version: '1.0',
          exportedAt: new Date().toISOString(),
          targets: Object.fromEntries(this.targets),
          ...additionalData
        };
        
        const content = JSON.stringify(exportData, null, 2);
        await fs.writeFile(filepath, content);
        
        return {
          filepath,
          targetCount: this.targets.size,
          fileSize: content.length
        };
      } catch (error) {
        throw new Error(`Failed to export to file: ${error.message}`);
      }
    }
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 the action ('Export') but lacks details on permissions needed, whether this overwrites existing files, if it's a read-only operation, or what happens on failure. This is a significant gap for a tool that writes to a file system.

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, clear sentence with no wasted words. It's front-loaded with the core action and resource, making it highly efficient and easy to parse.

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 lack of annotations and output schema, the description is incomplete. It doesn't address behavioral aspects like file overwriting, error handling, or what the exported configuration includes beyond traffic logs. For a tool that writes files and has sibling export tools, more context is needed to ensure proper 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 description doesn't add any parameter semantics beyond what the input schema provides. Since schema description coverage is 100%, the baseline score is 3. The description doesn't explain the purpose of 'filepath' or 'includeTrafficLog' in context, such as why one might include traffic logs or file path requirements.

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 ('Export') and resource ('current proxy configuration to file'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'proxy_export_har' or 'proxy_import_config', which would require mentioning what specifically is being exported (configuration vs. HAR format vs. importing).

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 when exporting configuration is appropriate (e.g., for backup, migration, or analysis) or contrast it with related tools like 'proxy_import_config' for restoring or 'proxy_export_har' for different data formats.

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