Skip to main content
Glama

update_global_rule

Modify plugins and attributes of existing global rules in APISIX-MCP to adjust configurations and enable or disable features as needed.

Instructions

Update specific attributes of an existing global rule

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNoglobal rule ID
pluginsNoplugins configuration

Implementation Reference

  • Implementation of the update_global_rule tool handler. Registers the tool with McpServer and provides an inline async function that makes a PATCH request to the APISIX admin API endpoint `/global_rules/${args.id}` with the provided args.
    server.tool("update_global_rule", "Update specific attributes of an existing global rule", UpdateGlobalRuleSchema.shape, async (args) => { return await makeAdminAPIRequest(`/global_rules/${args.id}`, "PATCH", args); });
  • Zod schema for validating input to the update_global_rule tool, supporting partial updates to the global rule's id and plugins configuration.
    export const UpdateGlobalRuleSchema = createNullablePatchSchema(z.object({ id: z.string().describe("global rule ID"), plugins: PluginSchema, }));
  • Registration of the update_global_rule tool within the setupGlobalRuleTools function, called from src/index.ts.
    server.tool("update_global_rule", "Update specific attributes of an existing global rule", UpdateGlobalRuleSchema.shape, async (args) => { return await makeAdminAPIRequest(`/global_rules/${args.id}`, "PATCH", args); });

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/api7/apisix-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server