deleteValue
Remove specific values from the Whistle MCP Server to manage and streamline proxy configurations effectively. Ensures precise control over Whistle proxy settings.
Instructions
删除值
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | 值名称 |
Implementation Reference
- src/index.ts:263-273 (registration)Registration of the 'deleteValue' MCP tool, including name, description, input schema, and handler function that delegates to WhistleClient.deleteValue and formats the response.server.addTool({ name: "deleteValue", description: "删除值", parameters: z.object({ name: z.string().describe("值名称"), }), execute: async (args) => { const result = await whistleClient.deleteValue(args.name); return formatResponse(result); }, });
- src/index.ts:266-268 (schema)Input schema for deleteValue tool: requires 'name' string parameter.parameters: z.object({ name: z.string().describe("值名称"), }),
- src/index.ts:269-272 (handler)Handler function for deleteValue tool: calls whistleClient.deleteValue with args.name and returns formatted response.execute: async (args) => { const result = await whistleClient.deleteValue(args.name); return formatResponse(result); },
- src/WhistleClient.ts:474-489 (helper)Core implementation of deleteValue: sends POST request to Whistle's /cgi-bin/values/remove endpoint with the value name to delete it.async deleteValue(name: string): Promise<any> { const formData = new URLSearchParams(); formData.append("clientId", `${Date.now()}-0`); formData.append("list[]", name); const response = await axios.post( `${this.baseUrl}/cgi-bin/values/remove`, formData, { headers: { "Content-Type": "application/x-www-form-urlencoded", }, } ); return response.data; }