Skip to main content
Glama

Create a control rule

create_rule
Destructive

Creates a rule with a client-generated UUID. Setting enabled applies it immediately. Read rules again to inspect effective policy. Requires the controls:write scope. Supply idempotency_key and reuse it with identical arguments on retries.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "config": "<config>",
      "id": "<id>",
      "kind": "<kind>",
      "scope": "<scope>"
    },
    "name": "create_rule"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesClient-generated UUID for this new rule.
kindYes
nameNoDisplay name; null clears it.
scopeYesUse org for organization-wide scope; projects requires project_uuids. IDs must belong to the caller's organization. roles (role_names) and members (member_uuids) are only for comply budget rules: a monthly cap on each member's personal-key spend, where a member's own cap wins over their role's.
configYesConfig for the rule kind. Replaces the full config on update. Read existing rules and get_rule_vocabulary before changing it; organization constraints remain in force. Use schema_version=4 for model lists: models and exclude_models name model keys, endpoints and exclude_endpoints name endpoint ids; use 5 only when exclude_models/exclude_endpoints hold "*" wildcards or the rule has except_models/except_endpoints; schema_version=2 remains supported for provider company allowlists. Opper retention_days and upstream handling.max_retention_days are separate controls. Each anyOf branch is one rule type's exact schema without field descriptions, titled by its id; get_rule_vocabulary rule_schemas has each id with descriptions and a validated example. Read the one you need before writing config.
enabledNoWhether the rule is enforced. Omitted on create means false.
schema_versionNoConfig schema version. Omit on create for version 1. Version 2 comply allowlists identify providers by company slug. Use 4 for model lists (models and exclude_models name model keys, endpoints and exclude_endpoints name endpoint ids), and 5 only when exclude_models or exclude_endpoints hold "*" wildcards or the rule has except_models or except_endpoints.
idempotency_keyNoGenerate a unique operation ID (for example UUID) before creation. Reuse it and the exact original arguments after a timeout or uncertain result; never generate a new ID merely to retry. A changed payload or deleted original resource returns 409. Key replays return metadata without the raw secret.
confirm_file_deletionNoDeprecated and ignored: no rule deletes stored files.

Output Schema

NameRequiredDescriptionDefault
dataNo
metaNoEmpty for a single resource. Endpoint-specific context appears here rather than as a sibling of `data`.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and idempotentHint=false, so the safety bar is partly met; the description adds the `controls:write` scope requirement, the immediate effect of enabled, and a concrete retry protocol for idempotency_key. It stops short of describing what a bad scope/config does to live traffic or what the 409 conflict state means operationally.

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

Conciseness4/5

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

Five short sentences, front-loaded with the purpose followed by effect, caution, auth, and retry advice — each sentence carries information. Minor redundancy with the schema descriptions for id and idempotency_key keeps it from a 5.

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

Completeness4/5

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

For a complex 9-parameter tool with nested config branches, an output schema and full annotations, the description covers the essentials: creation, immediate enforcement, auth scope, and retry safety. Config-construction detail is delegated to get_rule_vocabulary inside the schema, which is acceptable given the schema's own guidance.

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 89%, so the schema already documents id, idempotency_key, enabled, schema_version and the config anyOf branches in detail. The description restates only the UUID and idempotency_key points, adding little semantic meaning beyond the structured fields; baseline 3 is appropriate.

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?

States a specific verb and resource ("Creates a rule") plus the notable constraint that the UUID is client-generated, which separates it from the sibling update_rule/delete_rule by implication. It does not explicitly name the non-create alternatives, so an agent infers rather than reads the distinction.

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

Usage Guidelines3/5

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

Gives real usage context: enabled applies immediately, read rules back to inspect effective policy, and reuse idempotency_key with identical arguments on retries. However it offers no explicit exclusion or alternative routing (e.g. use update_rule for changes, get_rule_vocabulary before writing config), so the when-not guidance is missing.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources