Skip to main content
Glama

Owner: set spending limits for an agent

create_spending_policy

For agent OWNERS. Create spending limits (max per payment, max per day, optional allowed chains, tokens and recipients) and get a policy-locked connection URL to give your agent. Every swap and payment through that URL is checked first and refused if it breaks a rule. Also returns a private admin_key for the spending log and an off switch. Swap Ripper never holds funds.

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": {
      "max_per_payment_usd": "<max_per_payment_usd>",
      "max_per_day_usd": "<max_per_day_usd>"
    },
    "name": "create_spending_policy"
  }
}

Input Schema

NameRequiredDescriptionDefault
labelNoOptional name, e.g. 'research agent'.
allowed_chainsNoOptional list of chains money may move on, e.g. ['base','solana']. Empty = any.
allowed_tokensNoOptional list of tokens the agent may send, e.g. ['USDC']. Empty = any.
expires_in_daysNo1-365, default 365.
max_per_day_usdYesTotal allowed per UTC day, in USD, e.g. 100.
allowed_recipientsNoOptional list of addresses the agent may pay. Empty = any.
max_per_payment_usdYesLargest single payment allowed, in USD, e.g. 20.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4/5.0
Behavior4/5

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

Annotations only declare write, non-idempotent, non-destructive, closed-world; the description adds real value by disclosing the enforcement behavior (every swap and payment checked first and refused on violation), the non-custodial posture ('never holds funds'), and that a private admin_key plus an off switch are returned. It does not address what happens on repeat invocation despite idempotentHint=false — whether a second call creates a second independent policy — which is the one behavioral gap for a mutating tool.

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?

Audience is front-loaded in the first two words, followed by what is created, then the enforcement guarantee, then the returned artifacts and custody disclaimer. Four tight sentences, none redundant.

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?

With no output schema, the description usefully compensates by naming the returned values (connection URL, admin_key, off switch) and their trust levels. For a seven-parameter creation tool the remaining omission is lifecycle behavior on repeat calls and whether policies can be edited versus superseded, which is minor but not negligible.

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 all seven parameters are already documented with examples and 'Empty = any' semantics. The description recaps the same fields (max per payment, max per day, chains, tokens, recipients) without adding format or precedence detail, so it matches rather than exceeds the schema baseline.

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?

States a specific verb and resource ('Create spending limits') and enumerates the dimensions of the limit (max per payment, max per day, optional chains, tokens, recipients), then names the concrete artifact produced: a policy-locked connection URL. The 'For agent OWNERS' opener plus the enforcement sentence separates it from downstream tools like create_swap or pay, which act through that URL rather than create it.

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?

The audience is stated ('For agent OWNERS') and the sequencing is implied ('a policy-locked connection URL to give your agent'), so an agent can infer this is the setup step before payments. However, no sibling is named and there is no explicit when-not guidance (e.g., use set_policy_enabled to pause an existing policy, policy_status to inspect one), leaving the agent to infer the boundary.

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.