getAllValues
Retrieve all rule values from the Whistle MCP Server to manage and control local proxy configurations efficiently.
Instructions
获取所有规则的值
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/WhistleClient.ts:334-350 (handler)Core handler function that executes the logic for getting all values from the Whistle server. Makes a GET request to /cgi-bin/init with timestamp param and extracts values.list from the response.async getAllValues(): 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 { data } = response; const { values: { list }, } = data; return list || []; }
- src/index.ts:187-195 (registration)Registers the MCP tool 'getAllValues' with name, description, empty input schema (z.object({})), and execute handler that delegates to whistleClient.getAllValues() and formats the response.server.addTool({ name: "getAllValues", description: "获取所有规则的值", parameters: z.object({}), execute: async () => { const rules = await whistleClient.getAllValues(); return formatResponse(rules); }, });
- src/index.ts:190-190 (schema)Zod schema definition for the tool inputs: empty object since no parameters are required.parameters: z.object({}),