Skip to main content
Glama

create_rate_limit

Create rate-limit policies for requests or tokens with conditions, grouping, and targets for LLMs or MCP tools. Define reset intervals and limits to control usage.

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.

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": {
      "conditions": "<conditions>",
      "group_by": "<group_by>",
      "type": "<type>",
      "unit": "<unit>",
      "value": "<value>"
    },
    "name": "create_rate_limit"
  }
}

Input 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

NameRequiredDescriptionDefault
okYesCall succeeded
dataNoSuccess payload
errorNoFailure details

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv0.16.5
    • changedOutput schema / properties / data / description
      Previous value: -"Structured success payload when ok is true"New value: +"Success payload"
    • changedOutput schema / properties / error / description
      Previous value: -"Structured error payload when ok is false"New value: +"Failure details"
    • changedOutput schema / properties / error / properties / details / description
      Previous value: -"Optional structured error details"New value: +"Extra error details"
    • changedOutput schema / properties / error / properties / message / description
      Previous value: -"Human-readable error message"New value: +"Error message"
    • changedOutput schema / properties / ok / description
      Previous value: -"Whether the tool call succeeded and returned structured data"New value: +"Call succeeded"
  2. Changed2 schema fields changedv1.0.9
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  3. 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"
  4. Addedv1.0.1
  5. Removed
  6. First observed

TDQS

A3.7/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, destructiveHint=false, idempotentHint=false and openWorldHint=true, so the mutation profile is known. The description adds value by stating that conditions and group_by must be non-empty, warning the agent about validation failures, but it says nothing about duplicate-policy behavior, idempotency implications, or scoping conflicts.

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?

Two compact sentences, with the core action front-loaded and the validation constraint second. Dense but every clause carries information; no filler.

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

Completeness5/5

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

An output schema exists, so return values need no explanation, and the schema fully documents the nine parameters. The description covers creation intent, hard validation rules, and target-specific key semantics — enough for an agent to call this correctly.

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 coverage is 100%, so baseline would be 3, but the description goes beyond the schema by mapping target values to required key families (model/provider for llm, mcp_server/mcp_tool for mcp_tools), which the schema only implies via a flat key list. It leaves the workspace_id/organisation_id scoping and value/unit interaction unexplained.

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: "Create a request or token rate-limit policy," and clarifies the two counter types the policy can govern. It does not distinguish itself from near-siblings such as create_usage_limit or update_rate_limit, so an agent must infer the boundary from names alone.

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?

Provides conditional guidance tied to the target enum (llm uses model/provider keys; mcp_tools uses MCP server and tool keys), which helps the agent pick correct keys. It gives no when-to-use vs. when-not guidance relative to create_usage_limit or update_rate_limit, and no prerequisites or ordering advice.

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