Skip to main content
Glama

createValue

Generate and define new values within the Whistle MCP Server to streamline proxy management, enabling efficient rule and group configuration.

Instructions

创建新的值

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes值名称

Implementation Reference

  • src/index.ts:209-219 (registration)
    Registration of the MCP tool 'createValue' using server.addTool.
    server.addTool({ name: "createValue", description: "创建新的值", parameters: z.object({ name: z.string().describe("值名称"), }), execute: async (args) => { const result = await whistleClient.createValue(args.name); return formatResponse(result); }, });
  • Input schema for 'createValue' tool: requires a 'name' string parameter.
    parameters: z.object({ name: z.string().describe("值名称"), }),
  • Handler function for 'createValue' tool that delegates to WhistleClient.createValue and formats the response.
    execute: async (args) => { const result = await whistleClient.createValue(args.name); return formatResponse(result); },
  • Core implementation of createValue in WhistleClient: sends POST request to Whistle's /cgi-bin/values/add endpoint to create a new value.
    async createValue(name: string): Promise<any> { const formData = new URLSearchParams(); formData.append("clientId", `${Date.now()}-1`); formData.append("name", name); const response = await axios.post( `${this.baseUrl}/cgi-bin/values/add`, formData, { headers: { "Content-Type": "application/x-www-form-urlencoded", }, } ); return response.data; }

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