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
| Name | Required | Description | Default |
|---|---|---|---|
| enabled | Yes | 是否启用多规则模式 |
Implementation Reference
- src/WhistleClient.ts:726-741 (handler)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); }, });
- src/index.ts:377-379 (schema)Zod schema defining the input parameter 'enabled' as boolean for the tool.parameters: z.object({ enabled: z.boolean().describe("是否启用多规则模式"), }),