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("是否启用多规则模式"),
    }),

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