removeValueFromGroup
Remove a specified value from a group within the Whistle MCP Server to streamline proxy management and maintain organized rule configurations.
Instructions
将值移出分组
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| valueName | Yes | 值名称 |
Implementation Reference
- src/WhistleClient.ts:542-560 (handler)The main handler function in WhistleClient that implements the logic to remove a value from its group by moving it to the top level (first value position) using Whistle's /cgi-bin/values/move-to API endpoint.async moveValueOutOfGroup(name: string): Promise<any> { const values = await this.getAllValues(); const firstValueName = values[0].name; const formData = new URLSearchParams(); formData.append("clientId", `${Date.now()}-1`); formData.append("from", name); formData.append("to", firstValueName); formData.append("group", "false"); const response = await axios.post( `${this.baseUrl}/cgi-bin/values/move-to`, formData, { headers: { "Content-Type": "application/x-www-form-urlencoded", }, } ); return response.data; }
- src/index.ts:303-313 (registration)Registers the MCP tool 'removeValueFromGroup' with schema (parameters) and execute handler that delegates to WhistleClient.moveValueOutOfGroup.server.addTool({ name: "removeValueFromGroup", description: "将值移出分组", parameters: z.object({ valueName: z.string().describe("值名称"), }), execute: async (args) => { const result = await whistleClient.moveValueOutOfGroup(args.valueName); return formatResponse(result); }, });
- src/index.ts:306-308 (schema)Zod schema defining the input parameter 'valueName' for the tool.parameters: z.object({ valueName: z.string().describe("值名称"), }),