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);
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It only states 'Create a global rule,' which implies a write operation but doesn't cover permissions, side effects, error conditions, or response format. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with just three words, front-loading the key action ('Create'). There's no wasted language or unnecessary elaboration, making it efficient for quick scanning, though this conciseness comes at the cost of detail.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (a mutation tool with nested parameters and no output schema) and lack of annotations, the description is incomplete. It doesn't explain what a global rule does, how it interacts with the system, or what happens after creation. For a tool that likely affects system behavior, more context is needed to guide the agent effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters (id and plugins). The description adds no meaning beyond the schema—it doesn't explain what a 'global rule ID' is used for or how plugins configuration works. With high schema coverage, the baseline score of 3 is appropriate, as the description doesn't compensate but doesn't need to heavily.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose2/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Create a global rule' is a tautology that restates the tool name without adding specificity. It doesn't explain what a 'global rule' is, what it governs, or how it differs from other rule types. While it includes the verb 'create,' it lacks detail about the resource being created, making it only slightly better than a pure restatement.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'update_global_rule' or explain prerequisites, such as whether a rule ID must be unique. There's no context about appropriate scenarios or exclusions, leaving the agent with no usage direction.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

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