Skip to main content
Glama

create_rate_limit

Create request or token rate-limit policies with match conditions and grouping to enforce usage caps on LLM or MCP-tool targets.

Instructions

Create a request or token rate-limit policy. Conditions and grouping must be non-empty; target llm uses model/provider keys, while target mcp_tools uses MCP server and tool keys.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoOptional policy display name
typeYesCounter type
unitYesCounter reset interval
valueYesMaximum requests or tokens
targetNoLLM or MCP-tool enforcement target
group_byYesCounter grouping dimensions
conditionsYesPolicy match conditions
workspace_idNoWorkspace UUID scope
organisation_idNoOrganisation UUID scope

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYesWhether the tool call succeeded and returned structured data
dataNoStructured success payload when ok is true
errorNoStructured error payload when ok is false

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed25 schema fields changedv0.11.5
    • changedInput schema / properties / conditions / description
      Previous value: -"Array of conditions that determine which requests this rate limit applies to"New value: +"Policy match conditions"
    • addedInput schema / properties / conditions / items / properties / excludes
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "items": {
      +        "type": "string"
      +      },
      +      "minItems": 1,
      +      "type": "array"
      +    }
      +  ],
      +  "description": "Values to exclude"
      +}
    • removedInput schema / properties / conditions / items / properties / field
      Removed value: -{
      -  "description": "The field to match on (e.g., 'virtual_key', 'api_key', 'user_id', 'metadata.key')",
      -  "type": "string"
      -}
    • addedInput schema / properties / conditions / items / properties / key
      Added value: +{
      +  "description": "Match key such as api_key, virtual_key, provider, config, prompt, model, endpoint_type, mcp_server, mcp_tool, workspace_id, or metadata.*",
      +  "minLength": 1,
      +  "type": "string"
      +}
    • removedInput schema / properties / conditions / items / properties / operator
      Removed value: -{
      -  "description": "The comparison operator (e.g., 'is', 'contains', 'is_not')",
      -  "type": "string"
      -}
    • addedInput schema / properties / conditions / items / properties / value / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "items": {
      +      "type": "string"
      +    },
      +    "minItems": 1,
      +    "type": "array"
      +  }
      +]
    • changedInput schema / properties / conditions / items / properties / value / description
      Previous value: -"The value to match against"New value: +"One value or several OR-matched values; use * for wildcard matching"
    • removedInput schema / properties / conditions / items / properties / value / type
      Removed value: -"string"
    • changedInput schema / properties / conditions / items / required
      Previous value: -[
      -  "field",
      -  "operator",
      -  "value"
      -]New value: +[
      +  "key",
      +  "value"
      +]
    • addedInput schema / properties / conditions / minItems
      Added value: +1
    • changedInput schema / properties / group_by / description
      Previous value: -"Array of fields to group the rate limit by (e.g., ['virtual_key'], ['api_key', 'user_id'])"New value: +"Counter grouping dimensions"
    • addedInput schema / properties / group_by / items / properties
      Added value: +{
      +  "key": {
      +    "description": "Counter grouping key such as api_key, workspace_id, virtual_key, provider, config, prompt, model, mcp_server, mcp_tool, or metadata.*",
      +    "minLength": 1,
      +    "type": "string"
      +  }
      +}
    • addedInput schema / properties / group_by / items / required
      Added value: +[
      +  "key"
      +]
    • changedInput schema / properties / group_by / items / type
      Previous value: -"string"New value: +"object"
    • addedInput schema / properties / group_by / minItems
      Added value: +1
    • changedInput schema / properties / name / description
      Previous value: -"Optional name for the rate limit"New value: +"Optional policy display name"
    • changedInput schema / properties / organisation_id / description
      Previous value: -"Organisation ID to scope the limit to"New value: +"Organisation UUID scope"
    • addedInput schema / properties / target
      Added value: +{
      +  "description": "LLM or MCP-tool enforcement target",
      +  "enum": [
      +    "llm",
      +    "mcp_tools"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / type / description
      Previous value: -"What to rate limit: 'requests' or 'tokens'"New value: +"Counter type"
    • changedInput schema / properties / unit / description
      Previous value: -"Time unit: 'rpm' (per minute), 'rph' (per hour), or 'rpd' (per day)"New value: +"Counter reset interval"
    • changedInput schema / properties / unit / enum
      Previous value: -[
      -  "rpm",
      -  "rph",
      -  "rpd"
      -]New value: +[
      +  "rpm",
      +  "rph",
      +  "rpd",
      +  "rpw"
      +]
    • changedInput schema / properties / value / description
      Previous value: -"The maximum allowed value per unit (e.g., 100 rpm)"New value: +"Maximum requests or tokens"
    • removedInput schema / properties / value / exclusiveMinimum
      Removed value: -0
    • addedInput schema / properties / value / minimum
      Added value: +0
    • changedInput schema / properties / workspace_id / description
      Previous value: -"Workspace ID to scope the limit to"New value: +"Workspace UUID scope"
  2. Addedv1.0.1
  3. Removed
  4. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already establish a write, non-idempotent, non-destructive profile, and the description agrees with that. It adds value beyond the annotations by disclosing a validation constraint (non-empty conditions/grouping will otherwise fail) and the target-dependent key scoping behavior. It does not disclose duplicate-policy behavior, but idempotentHint=false already signals that risk.

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?

Two sentences totaling roughly 35 words: the core purpose comes first, and the two critical constraints follow immediately. No filler, no repetition of schema content, and every clause carries meaning.

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 9-parameter create tool with an output schema present, the two constraints most likely to cause a failed call — non-empty conditions/grouping and target-appropriate keys — are both captured. The only minor gap is that the description never guides when to choose 'requests' versus 'tokens', though the schema's type and value descriptions cover their meaning. Nothing essential for a correct first call is missing.

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

Parameters4/5

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

Schema description coverage is 100%, so the baseline is 3. The description earns a 4 by adding the cross-parameter insight that the choice of target (llm vs mcp_tools) dictates which keys are valid in conditions and group_by — a relationship no individual schema field description states.

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

Purpose5/5

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

The first sentence names a specific verb ('Create') and resource ('request or token rate-limit policy'), which cleanly differentiates this from siblings update_rate_limit, delete_rate_limit, get_rate_limit, and the similarly-named create_usage_limit. The requests-vs-tokens distinction is front-loaded so an agent immediately understands it creates counter-based rate-limit policies, not spend caps.

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?

The description provides operational context — conditions and grouping must be non-empty, and target llm versus target mcp_tools determines which keys apply — but it never names an alternative or a when-not condition. An agent must infer when to prefer create_rate_limit over create_usage_limit or update_rate_limit from the create_ verb and resource name alone.

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

Deploy Server

Other Tools