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);
    });
Behavior2/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 states the tool updates attributes but doesn't describe what happens if the ID doesn't exist, whether changes are reversible, permission requirements, rate limits, or response format. For a mutation tool with zero annotation coverage, this leaves critical behavioral traits unspecified.

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 a single, efficient sentence that front-loads the core action ('update') and resource ('global rule'). There is zero waste—every word contributes to the purpose without redundancy or unnecessary elaboration.

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 of updating a global rule with no annotations and no output schema, the description is incomplete. It lacks details on behavioral traits, error handling, and what constitutes a 'global rule' versus other resources. For a mutation tool in a server with many siblings, more context is needed to ensure proper usage.

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%, with clear descriptions for both parameters ('id' and 'plugins'). The description adds no additional meaning beyond the schema, such as explaining what a 'global rule' is or how 'plugins configuration' works in context. Baseline 3 is appropriate since the schema does the heavy lifting, but no extra value is provided.

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

Purpose4/5

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

The description clearly states the action ('update') and resource ('existing global rule'), specifying it modifies 'specific attributes'. It distinguishes from 'create_global_rule' by focusing on updates rather than creation. However, it doesn't explicitly differentiate from other update tools like 'update_route' or 'update_service' in terms of what a 'global rule' entails.

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

Usage Guidelines2/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 prerequisites (e.g., needing an existing rule ID), exclusions, or compare it to sibling tools like 'create_global_rule' or 'delete_resource'. Usage is implied only by the verb 'update', with no explicit context or alternatives stated.

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