Skip to main content
Glama

create_usage_limit

Set a cumulative budget for cost or tokens with optional alerts and weekly or monthly resets. Conditions and group_by fields are required to apply the limit.

Instructions

Create a cumulative budget for cost or tokens with optional alerts and weekly or monthly resets. conditions and group_by are required; use rate limits when you need request throttling.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
conditionsYesArray of conditions that determine which requests this usage limit applies to
group_byYesArray of fields to group the usage limit by (e.g., ['virtual_key'], ['api_key', 'user_id'])
typeYesWhat to limit: 'cost' (in dollars) or 'tokens'
credit_limitYesThe maximum allowed usage (cost in dollars or token count)
nameNoOptional name for the usage limit
alert_thresholdNoPercentage threshold (0-100) at which to send an alert
periodic_resetNoAutomatically reset usage counters on this schedule
workspace_idNoWorkspace ID to scope the limit to
organisation_idNoOrganisation ID to scope the limit to

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
Behavior5/5

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

The description discloses that the tool creates a budget, tracks cumulative usage, supports alerts and resets. Annotations indicate it is not read-only, not destructive, and not idempotent, which aligns with the description. No contradiction.

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 succinct sentences: first states purpose and key features, second clarifies requirements and alternatives. Front-loaded with essential information, no wasted words.

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?

Given the tool has 9 parameters and an output schema, the description covers the core functionality, required fields, and when to use an alternative. The output schema handles return values, so completeness is high.

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?

With 100% schema coverage, baseline is 3. The description adds meaning by framing the tool as a 'cumulative budget' and mentions 'optional alerts and weekly or monthly resets', which gives context to parameters like alert_threshold and periodic_reset. This goes beyond the schema.

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 it creates a 'cumulative budget for cost or tokens' with optional alerts and resets, and distinguishes from rate limits by noting to use rate limits for request throttling. This differentiates it from the sibling tool create_rate_limit.

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

Usage Guidelines5/5

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

Explicitly specifies that 'conditions and group_by are required' and advises to 'use rate limits when you need request throttling', providing clear when-to-use and when-not-to-use guidance.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/s-b-e-n-s-o-n/portkey-admin-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server