Skip to main content
Glama

getWhistleStatus

Check the current operational status of the Whistle proxy server. Use this tool to monitor and manage proxy settings, rules, and network requests efficiently.

Instructions

获取whistle服务器的当前状态

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • src/index.ts:316-324 (registration)
    Registration of the 'getWhistleStatus' tool with FastMCP server. Includes schema (empty input parameters), description, and the primary handler function that calls WhistleClient.getStatus() and formats the response.
    server.addTool({ name: "getWhistleStatus", description: "获取whistle服务器的当前状态", parameters: z.object({}), execute: async () => { const status = await whistleClient.getStatus(); return formatResponse(status); }, });
  • Core handler implementation in WhistleClient class. Fetches server status from Whistle's /cgi-bin/init API endpoint, extracts status data (excluding rules and values), and returns it. This is the key logic executed by the tool.
    /** * 获取服务器状态 * @returns Promise with the server status information */ async getStatus(): Promise<any> { const timestamp = Date.now(); const response = await axios.get(`${this.baseUrl}/cgi-bin/init`, { params: { _: timestamp }, headers: { Accept: "application/json, text/javascript, */*; q=0.01", "Cache-Control": "no-cache", Pragma: "no-cache", "X-Requested-With": "XMLHttpRequest", }, }); const { rules, values, ...restData } = response.data; return restData; }
  • Helper function formatResponse used by the tool handler to standardize the MCP response format as a content array containing the JSON-stringified status data.
    function formatResponse(data: any) { return { content: [ { type: "text" as const, text: JSON.stringify(data), }, ], }; }
  • WhistleClient constructor initializes the baseUrl used in getStatus for API calls to the Whistle server.
    constructor(host: string = "localhost", port: number = 8899) { this.baseUrl = `http://${host}:${port}`; }

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