Skip to main content
Glama

create_usage_limit

Create a cumulative budget for cost or tokens with optional alerts and weekly or monthly resets. Conditions and group_by are required.

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

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

The description adds context beyond annotations: cumulative budget, optional alerts, weekly/monthly resets. Annotations already show it's a write operation (readOnlyHint false) and not destructive, so the description complements without 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 sentences with no wasted words. The first sentence conveys purpose and key features; the second adds usage guidance and an alternative. Info is front-loaded and easy to parse.

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 tool's complexity (9 params, output schema exists), the description covers the core purpose, required fields, and alternative. It omits explicit mention of return value or scoping parameters, but the schema handles those. Slightly better could mention that it creates a usage limit entity with an ID.

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 coverage is 100% with detailed descriptions for each parameter. The description adds little beyond stating that conditions and group_by are required, which is already in the schema. It provides no extra format or examples, so baseline 3 is appropriate.

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. It distinguishes itself from the sibling 'create_rate_limit' by specifying that rate limits are for request throttling, not 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 explicitly says 'use rate limits when you need request throttling,' providing a clear alternative. It also notes that 'conditions and group_by are required,' guiding the agent on mandatory fields. However, it could further clarify scenarios like per-user vs per-key limits.

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