Skip to main content
Glama

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
NameRequiredDescriptionDefault
enabledYes是否启用代理

Implementation Reference

  • 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);
      },
    });
  • The Zod schema defining the input parameters for the toggleProxy tool: a boolean 'enabled' field.
    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