toggleProxy
Enable or disable the Whistle proxy server to manage network requests and configurations directly through AI-driven control with the Whistle MCP Server.
Instructions
启用或禁用whistle代理
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| enabled | Yes | 是否启用代理 |
Implementation Reference
- src/WhistleClient.ts:586-591 (handler)The handler function that implements the toggleProxy tool logic by making an HTTP POST request to Whistle's /cgi-bin/proxy/enable endpoint to enable or disable the proxy.async toggleProxy(enabled: boolean): Promise<any> { const response = await axios.post(`${this.baseUrl}/cgi-bin/proxy/enable`, { enabled, }); return response.data; }
- src/index.ts:326-336 (registration)The registration of the toggleProxy tool in the FastMCP server, including input schema validation using Zod and the execute function that wraps the handler call.server.addTool({ name: "toggleProxy", description: "启用或禁用whistle代理", parameters: z.object({ enabled: z.boolean().describe("是否启用代理"), }), execute: async (args) => { const result = await whistleClient.toggleProxy(args.enabled); return formatResponse(result); }, });
- src/index.ts:329-331 (schema)The Zod schema defining the input parameters for the toggleProxy tool: a boolean 'enabled' field.parameters: z.object({ enabled: z.boolean().describe("是否启用代理"), }),