update_consumer_group
Modify a consumer group by updating its ID, labels, plugins, or description. Simplify configuration adjustments via the APISIX-MCP server interface.
Instructions
Update specific attributes of an existing consumer group
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| consumerGroup | No | consumer group configuration object | |
| id | No | consumer group ID |
Implementation Reference
- src/tools/consumer-group.ts:15-22 (registration)Registers the update_consumer_group tool using server.tool(), including the tool name, description, input schema, and inline handler function that sends a PATCH request to the admin API.server.tool( "update_consumer_group", "Update specific attributes of an existing consumer group", UpdateConsumerGroupSchema.shape, async (args) => { return await makeAdminAPIRequest(`/consumer_groups/${args.id}`, "PATCH", args.consumerGroup); } );
- src/tools/consumer-group.ts:19-21 (handler)The handler function that executes the tool logic: constructs the API endpoint `/consumer_groups/${args.id}` and sends a PATCH request with the consumerGroup partial data using makeAdminAPIRequest.async (args) => { return await makeAdminAPIRequest(`/consumer_groups/${args.id}`, "PATCH", args.consumerGroup); }
- src/schemas/consumer-group.ts:17-20 (schema)Zod schema defining the input for the tool: required id (string) and optional partial consumerGroup configuration.export const UpdateConsumerGroupSchema = createNullablePatchSchema(z.object({ id: z.string().describe("consumer group ID"), consumerGroup: ConsumerGroupSchema.partial(), }));
- src/index.ts:29-29 (registration)Top-level call to setupConsumerGroupTools on the MCP server, which registers the consumer group tools including update_consumer_group.setupConsumerGroupTools(server);
- src/schemas/consumer-group.ts:5-15 (schema)Base schema for consumer group configuration, used partially in UpdateConsumerGroupSchema.export const ConsumerGroupSchema = z .object({ labels: z .record(z.string(), z.string()) .optional() .describe("consumer group labels"), plugins: PluginSchema.optional().describe("consumer group plugins"), desc: z.string().optional().describe("consumer group description"), }) .passthrough() .describe("consumer group configuration object");