Skip to main content
Glama

create_usage_limit

Creates a cumulative cost or token usage-limit policy with match conditions, grouping dimensions, and optional weekly or monthly reset for scoped budget enforcement.

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.

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>",
      "credit_limit": "<credit_limit>"
    },
    "name": "create_usage_limit"
  }
}

Input 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

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. 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"
  4. Addedv1.0.1
  5. Removed
  6. First observed

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare a non-read-only, non-destructive, non-idempotent, open-world create operation. The description adds real value by constraining conditions and grouping to non-empty and clarifying that omitting periodic_reset yields a lifetime cumulative limit. It does not address the non-idempotent trait (e.g., duplicate policy creation) or any permission/scope prerequisites.

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 short sentences, front-loaded with the action and resource, and the reset semantics follow logically. No filler, though the phrase 'with non-empty conditions and grouping' mostly restates the schema's minItems constraints rather than adding new information.

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

Completeness3/5

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

With nine parameters, an output schema, and full schema coverage, most of the burden is carried by structured fields, so the description does not need to explain return values. Still missing is anything about scope behavior (workspace_id vs organisation_id), duplicate/non-idempotent creation, or how conditions interact with grouping beyond the non-empty constraint.

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%, so the schema already documents type, group_by, conditions, credit_limit, and periodic_reset in detail. The description only adds the semantic interpretation that no periodic_reset means a lifetime cumulative limit, which is a modest addition over the enum-plus-null schema. Baseline 3 applies.

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 states a specific verb and resource ('Create a cumulative cost or token usage-limit policy') and pins down the domain to cumulative spend/tokens, which implicitly separates it from rate-limiting siblings. It does not explicitly name or contrast with create_rate_limit or update_usage_limit, so an agent must infer the boundary.

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?

Usage is implied by the word 'cumulative' and by the note that a periodic reset can be omitted for a lifetime limit, which suggests when this tool is the right one. However, there is no explicit 'use this instead of create_rate_limit' or 'use update_usage_limit to modify' guidance, leaving the choice between siblings to inference.

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