Skip to main content
Glama

Set or remove an AI spending limit

set_ai_spending_limit
DestructiveIdempotent

Sets the most this workspace, or one of its projects, may spend on AI in a day or in a month, and what happens when spending reaches it: pause (new AI work pauses until the day or month starts again, or until the limit is raised; a step already running when the limit is reached finishes, so spending can end slightly over the limit) or tell (the owners are told and nothing stops). The owners are told by email at 80% and at 100% of every limit. Setting a limit replaces the one already there for the same project and period. Send remove true to remove it instead. Only owners and admins can. The limits in force, and what each has spent so far, are in get_usage. Confirm the amount, the period and what happens at the limit with the person before you call.

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": {
      "period": "<period>"
    },
    "name": "set_ai_spending_limit"
  }
}

Input Schema

NameRequiredDescriptionDefault
periodYesWhether the limit is per day or per month (calendar days and months, UTC).
removeNoTrue to remove the limit for this project and period.
at_limitNopause stops new AI work at the limit; tell only tells the owners. Leave it out only when removing.
amount_usdNoThe limit in US dollars, with at most two decimal places (50 or 12.50). Leave it out only when removing.
project_idNoOnly this project (list_projects gives ids). Leave it out for a limit on the whole workspace.
workspace_idNoWorkspace id from whoami; omit when there is one.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Goes well past the annotations (destructive, idempotent, non-read-only) by explaining consequences: pause halts new AI work until the period resets or the limit is raised, an in-flight step finishes so spend can overshoot, tell only notifies owners, owners get email at 80% and 100%, and setting a limit replaces any existing one for the same project and period. It also discloses the required permission level (owners and admins).

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?

Front-loaded with the core action and its two modes, then consequences, then the remove alternative and permissions. It is a dense single paragraph with several parenthetical clauses, but each sentence carries operational information; minor structural improvements (splitting effects from permissions) would help.

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?

For a destructive, no-output-schema mutation tool, the description covers everything an agent needs: side effects, overshoot caveat, notification behavior, permission requirements, replacement semantics, the delete path, and where to read current state.

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 already 100%, so the baseline is 3; the description earns extra by tying parameters together — that remove replaces the set operation, that at_limit and amount_usd are omitted only when removing, and that omitting project_id targets the whole workspace. It reinforces rather than introduces most field meanings.

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?

Opens with a specific verb and resource and defines the exact scope: spend limits for a workspace or one project, per day or per month, plus the at-limit behavior. It is clearly a setter, distinguishable from the sibling get_usage which only reads limits.

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?

Explicitly routes the agent to get_usage for limits currently in force and states that 'remove true' is the way to delete rather than set. It also adds a procedural guard — confirm amount, period and at-limit behavior with the person before calling. No explicit when-not-to-use statement beyond the remove flag, so not a full 5.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources