Skip to main content
Glama

toggleMultiRuleMode

Activate or deactivate multi-rule mode in Whistle MCP Server to manage multiple proxy rules simultaneously, enhancing control over network request configurations.

Instructions

启用或禁用多规则模式

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
enabledYes是否启用多规则模式

Implementation Reference

  • Core handler function that toggles the multi-rule mode in Whistle by posting form data to the allow-multiple-choice endpoint.
    async toggleMultiRuleMode(enabled: boolean): Promise<any> {
      const formData = new URLSearchParams();
      formData.append("clientId", `${Date.now()}-${Math.floor(Math.random() * 100)}`);
      formData.append("allowMultipleChoice", enabled ? "1" : "0");
    
      const response = await axios.post(
        `${this.baseUrl}/cgi-bin/rules/allow-multiple-choice`,
        formData,
        {
          headers: {
            "Content-Type": "application/x-www-form-urlencoded",
          },
        }
      );
      return response.data;
    }
  • src/index.ts:374-384 (registration)
    Registers the toggleMultiRuleMode tool with the FastMCP server, defining its name, description, input schema, and execute handler that delegates to WhistleClient.
    server.addTool({
      name: "toggleMultiRuleMode",
      description: "启用或禁用多规则模式",
      parameters: z.object({
        enabled: z.boolean().describe("是否启用多规则模式"),
      }),
      execute: async (args) => {
        const result = await whistleClient.toggleMultiRuleMode(args.enabled);
        return formatResponse(result);
      },
    });
  • Zod schema defining the input parameter 'enabled' as boolean for the tool.
    parameters: z.object({
      enabled: z.boolean().describe("是否启用多规则模式"),
    }),
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. It states the action ('启用或禁用' - enable/disable) but lacks details on behavioral traits like permissions needed, side effects (e.g., impact on other rules or system state), rate limits, or what happens on success/failure. 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 a single, efficient sentence in Chinese ('启用或禁用多规则模式') that directly conveys the tool's purpose with zero waste. It's appropriately sized and front-loaded, making it easy to understand at a glance.

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 with no annotations and no output schema), the description is incomplete. It lacks information on what multi-rule mode entails, how it interacts with other tools (e.g., 'getRules' or 'setAllRulesState'), and what the expected outcome or return values are. This makes it inadequate 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?

The input schema has 100% description coverage, with the parameter 'enabled' documented as '是否启用多规则模式' (whether to enable multi-rule mode). The description doesn't add any meaning beyond this, as it only restates the tool's purpose without elaborating on parameter usage or constraints. Baseline 3 is appropriate when schema coverage is high.

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 '启用或禁用多规则模式' (Enable or disable multi-rule mode) clearly states the verb ('启用或禁用' - enable/disable) and the resource ('多规则模式' - multi-rule mode). It's specific about what the tool does, though it doesn't explicitly distinguish from sibling tools like 'setAllRulesState' or 'toggleHttpInterception' that also toggle states.

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, or exclusions, such as when multi-rule mode is applicable compared to other toggle tools like 'toggleHttpInterception' or state-setting tools like 'setAllRulesState'.

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