Skip to main content
Glama

toggleHttpInterception

Enable or disable HTTP interception to manage network requests, monitor traffic, and control proxy settings using the whistle-mcp server.

Instructions

启用或禁用HTTP拦截

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
enabledYes是否启用HTTP拦截

Implementation Reference

  • src/index.ts:338-348 (registration)
    Registration of the 'toggleHttpInterception' MCP tool using FastMCP's server.addTool method. Includes input schema validation with Zod and a thin execute handler that delegates to WhistleClient.toggleHttpsInterception.
    server.addTool({
      name: "toggleHttpInterception",
      description: "启用或禁用HTTP拦截",
      parameters: z.object({
        enabled: z.boolean().describe("是否启用HTTP拦截"),
      }),
      execute: async (args) => {
        const result = await whistleClient.toggleHttpsInterception(args.enabled);
        return formatResponse(result);
      },
    });
  • Core handler function implementing the HTTP interception toggle logic. Sends a POST request to Whistle's `/cgi-bin/intercept-https-connects` endpoint with the `interceptHttpsConnects` parameter set to '1' (enabled) or '0' (disabled). Called directly by the tool's execute function.
    async toggleHttpsInterception(enabled: boolean): Promise<any> {
      const formData = new URLSearchParams();
      formData.append("clientId", `${Date.now()}-${Math.floor(Math.random() * 100)}`);
      formData.append("interceptHttpsConnects", enabled ? "1" : "0");
    
      const response = await axios.post(
        `${this.baseUrl}/cgi-bin/intercept-https-connects`,
        formData,
        {
          headers: {
            "Content-Type": "application/x-www-form-urlencoded",
          },
        }
      );
      return response.data;
    }
  • Zod schema for input validation: requires a boolean 'enabled' parameter indicating whether to enable or disable HTTP interception.
    parameters: z.object({
      enabled: z.boolean().describe("是否启用HTTP拦截"),
    }),
  • Helper function used by the tool's execute handler to format the response in MCP-compatible structure with JSON-stringified content.
    function formatResponse(data: any) {
      return {
        content: [
          {
            type: "text" as const,
            text: JSON.stringify(data),
          },
        ],
      };
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the toggle action but doesn't explain effects (e.g., what happens when enabled/disabled, permissions required, side effects like network changes, or error conditions). This is inadequate for a tool that likely alters system behavior.

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 in Chinese that directly states the tool's purpose with zero waste. It's appropriately sized and front-loaded, 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 complexity of toggling HTTP interception (a potentially impactful system change), no annotations, and no output schema, the description is incomplete. It lacks details on behavior, outcomes, or error handling, which are crucial for safe and effective use by an AI agent.

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?

Schema description coverage is 100%, with the parameter 'enabled' clearly documented in the schema as a boolean for enabling/disabling HTTP interception. The description doesn't add any meaning beyond this, so it meets the baseline of 3 without compensating or detracting.

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 '启用或禁用HTTP拦截' clearly states the action (toggle) and resource (HTTP interception) in Chinese, which translates to 'Enable or disable HTTP interception.' It's specific about what the tool does but doesn't differentiate from sibling tools like 'toggleHttpsInterception' or 'toggleProxy,' which handle related but distinct functions.

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, context (e.g., when HTTP interception is needed), or exclusions, leaving the agent to infer usage from the tool name alone among many siblings.

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/7gugu/whistle-mcp'

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