Skip to main content
Glama

create_usage_limit

Set a cumulative cost or token budget policy with filtering conditions and grouping. Optionally reset weekly or monthly, or apply as a lifetime limit to prevent overspending.

Instructions

Create a cumulative cost or token usage-limit policy with non-empty conditions and grouping. A periodic reset can be weekly, monthly, or omitted for a cumulative lifetime limit.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoOptional policy display name
typeYesBudget type
group_byYesUsage grouping dimensions
conditionsYesPolicy match conditions
credit_limitYesMaximum cumulative usage
workspace_idNoWorkspace UUID scope
periodic_resetNoOptional reset schedule
alert_thresholdNoOptional alert threshold
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. Changed29 schema fields changedv0.11.5
    • addedInput schema / properties / alert_threshold / anyOf
      Added value: +[
      +  {
      +    "minimum": 0,
      +    "type": "number"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / alert_threshold / description
      Previous value: -"Percentage threshold (0-100) at which to send an alert"New value: +"Optional alert threshold"
    • removedInput schema / properties / alert_threshold / type
      Removed value: -"number"
    • changedInput schema / properties / conditions / description
      Previous value: -"Array of conditions that determine which requests this usage 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 / credit_limit / description
      Previous value: -"The maximum allowed usage (cost in dollars or token count)"New value: +"Maximum cumulative usage"
    • removedInput schema / properties / credit_limit / exclusiveMinimum
      Removed value: -0
    • addedInput schema / properties / credit_limit / minimum
      Added value: +0
    • changedInput schema / properties / group_by / description
      Previous value: -"Array of fields to group the usage limit by (e.g., ['virtual_key'], ['api_key', 'user_id'])"New value: +"Usage 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 usage 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 / periodic_reset / anyOf
      Added value: +[
      +  {
      +    "enum": [
      +      "monthly",
      +      "weekly"
      +    ],
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / periodic_reset / description
      Previous value: -"Automatically reset usage counters on this schedule"New value: +"Optional reset schedule"
    • removedInput schema / properties / periodic_reset / enum
      Removed value: -[
      -  "monthly",
      -  "weekly"
      -]
    • removedInput schema / properties / periodic_reset / type
      Removed value: -"string"
    • changedInput schema / properties / type / description
      Previous value: -"What to limit: 'cost' (in dollars) or 'tokens'"New value: +"Budget type"
    • 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.4/5.0
Behavior4/5

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

Annotations already indicate this is a write operation and non-destructive; the description adds value by clarifying that an omitted periodic_reset results in a cumulative lifetime limit. It also communicates the validation constraint that conditions and grouping must be non-empty, which is useful beyond the schema alone.

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 short, front-loaded sentences capture the purpose, key constraints, and reset behavior with no filler. Every clause adds distinct information that an agent needs for correct tool selection and invocation.

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?

Given the rich input schema, output schema, and annotations, the description covers the essential decision-making context. It could be slightly more complete by explicitly contrasting with create_rate_limit, but the current wording is sufficient for an agent to understand the tool's role.

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 the baseline is 3. The description adds meaningful parameter semantics by explaining that periodic_reset can be weekly, monthly, or null for a lifetime cumulative limit, and by associating 'cumulative cost or token' with the type parameter.

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 description clearly states a specific action ('Create'), resource ('cumulative cost or token usage-limit policy'), and key constraints ('with non-empty conditions and grouping'). This distinguishes it from related siblings like create_rate_limit and update_usage_limit by emphasizing cumulative usage budgets.

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

Usage Guidelines4/5

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

The description clearly implies when to use this tool: when creating a cumulative cost/token policy rather than a rate-based limit. It does not explicitly name alternatives or state exclusions, but the 'cumulative' qualifier and reset semantics provide clear contextual guidance.

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