renameValueGroup
Rename a value group in the Whistle MCP Server by specifying the current group name and the desired new name for efficient proxy management.
Instructions
重命名值分组
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| groupName | Yes | 分组现有名称 | |
| newName | Yes | 分组的新名称 |
Implementation Reference
- src/index.ts:247-261 (registration)Registration of the MCP tool 'renameValueGroup' via server.addTool, defining name, description, input schema (groupName, newName), and execute handler that calls WhistleClient method.server.addTool({ name: "renameValueGroup", description: "重命名值分组", parameters: z.object({ groupName: z.string().describe("分组现有名称"), newName: z.string().describe("分组的新名称"), }), execute: async (args) => { const result = await whistleClient.renameValueGroup( args.groupName, args.newName ); return formatResponse(result); }, });
- src/WhistleClient.ts:450-467 (helper)Helper method in WhistleClient class implementing the rename logic by posting form data (with carriage returns for group names) to the Whistle CGI endpoint /cgi-bin/values/rename.async renameValueGroup(name: string, newName: string): Promise<any> { const formData = new URLSearchParams(); formData.append("clientId", `${Date.now()}-1`); formData.append("name", `\r${name}`); formData.append("newName", `\r${newName}`); const response = await axios.post( `${this.baseUrl}/cgi-bin/values/rename`, formData, { headers: { "Content-Type": "application/x-www-form-urlencoded", }, } ); return response.data; }