Skip to main content
Glama

create_global_rule

Define and deploy global rules in APISIX-MCP to configure plugins and control plugin behavior across the API gateway.

Instructions

Create a global rule

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesglobal rule ID
pluginsYesplugins configuration

Implementation Reference

  • Registers and implements the handler for the 'create_global_rule' MCP tool. The handler sends a PUT request to the Admin API endpoint `/global_rules/{id}` with the provided arguments to create the global rule.
    server.tool("create_global_rule", "Create a global rule", CreateGlobalRuleSchema.shape, async (args) => { return await makeAdminAPIRequest(`/global_rules/${args.id}`, "PUT", args); });
  • Zod schema defining the input structure for the create_global_rule tool: an object with 'id' (string) and 'plugins' (PluginSchema).
    export const CreateGlobalRuleSchema = z.object({ id: z.string().describe("global rule ID"), plugins: PluginSchema, });
  • src/index.ts:28-28 (registration)
    Calls the setupGlobalRuleTools function during server initialization, which registers the create_global_rule tool.
    setupGlobalRuleTools(server);

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