Skip to main content
Glama

toggleHttp2

Enable or disable HTTP/2 protocol for Whistle proxy servers using the Whistle MCP Server. Manage HTTP/2 settings directly for optimized network performance.

Instructions

启用或禁用HTTP/2

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
enabledYes是否启用HTTP/2

Implementation Reference

  • Core handler function that toggles HTTP/2 by posting form data to Whistle's /cgi-bin/enable-http2 endpoint.
    async toggleHttp2(enabled: boolean): Promise<any> {
      const formData = new URLSearchParams();
      formData.append("clientId", `${Date.now()}-${Math.floor(Math.random() * 100)}`);
      formData.append("enableHttp2", enabled ? "1" : "0");
    
      const response = await axios.post(
        `${this.baseUrl}/cgi-bin/enable-http2`,
        formData,
        {
          headers: {
            "Content-Type": "application/x-www-form-urlencoded",
          },
        }
      );
      return response.data;
    }
  • src/index.ts:362-372 (registration)
    Registers the MCP tool 'toggleHttp2' with name, description, Zod input schema, and execute handler that calls WhistleClient.toggleHttp2 and formats response.
    server.addTool({
      name: "toggleHttp2",
      description: "启用或禁用HTTP/2",
      parameters: z.object({
        enabled: z.boolean().describe("是否启用HTTP/2"),
      }),
      execute: async (args) => {
        const result = await whistleClient.toggleHttp2(args.enabled);
        return formatResponse(result);
      },
    });
  • Zod schema defining the input parameter 'enabled' as boolean for the toggleHttp2 tool.
    parameters: z.object({
      enabled: z.boolean().describe("是否启用HTTP/2"),
    }),
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 ('enable or disable') but doesn't reveal critical details such as whether this requires specific permissions, if changes are reversible, potential side effects (e.g., on performance or compatibility), or what happens after invocation. For a mutation tool with zero annotation coverage, this is a significant gap.

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 extremely concise—a single phrase in Chinese that directly conveys the tool's function without any wasted words. It's front-loaded and efficiently communicates the core action, earning a high score for brevity and clarity.

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 incomplete. It lacks information on behavioral traits, return values, error handling, or how it integrates with the system (e.g., Whistle proxy context from sibling tools). For a toggle tool that likely affects system behavior, more context is needed.

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 input schema has 100% description coverage, with the single parameter 'enabled' clearly documented as a boolean for enabling/disabling HTTP/2. The description doesn't add any meaning beyond what the schema provides (it just restates the tool's purpose), so it meets the baseline of 3 where 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 ('启用或禁用' meaning 'enable or disable') and the resource ('HTTP/2'), making the purpose immediately understandable. However, it doesn't distinguish this tool from sibling tools like 'toggleHttpInterception' or 'toggleHttpsInterception', which have similar toggle patterns but different targets.

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/2 should be enabled/disabled), or how it relates to sibling tools like 'toggleProxy' or other toggle functions. Usage is implied by the name but not explicitly stated.

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