Skip to main content
Glama

Last Price

set_spend_policy

DestructiveIdempotent

Save a spend policy whole: agent_id for one agent, or leave it out for the workspace default every other agent spends under. An omitted field takes its default, so read get_spend_policy first and send every rule you want to keep. An agent's own key cannot change the rules that bind it: use a workspace-wide key. Needs a Last Price credential with routing write scope. Needs a claimed workspace: a sandbox key from self-registration is refused (403) until a person claims the workspace.

Input Schema

NameRequiredDescriptionDefault
presetNoprocurement switches on company buying rules in one step, filling ask_above 500, quotes_required_above 5000 and, with preferred_sellers, block_unknown_sellers for whichever you leave out. Only where get_spend_policy says procurement.available.
agent_idNoThe agent this policy governs. Null or omitted for the workspace default.
currencyNoCurrency of every amount here. Purchases in another are denied, or converted at a recorded rate where get_spend_policy lists rail units. Defaults to USD.
ask_aboveNoPurchases above this wait for a person's approval. Null (the default) for never.
daily_capNoMost all purchases may cost in one UTC day. Null (the default) for no cap.
fair_priceNoWhen verify_price judges a price too high: off (ignore, the default), ask a person, or deny.
hold_secondsNoHow long an allowed purchase's reservation stays open for the purchase to start. Defaults to 900.
allowed_sellersNoOnly these sellers. Null (the default) for any.
blocked_sellersNoNever these sellers. Defaults to none.
max_per_purchaseNoMost one purchase may cost. Null (the default) for no limit.
preferred_sellersNoVendors procurement approved. Another seller waits for a person, or is denied with block_unknown_sellers.
allowed_categoriesNoOnly these categories. Null (the default) for any.
expired_quote_actionNoWhen a check's seller quote has expired: deny it (the default) or ask a person. ask only where get_spend_policy lists quote expiry.
block_unknown_sellersNoDeny any seller not on preferred_sellers. Defaults to false.
quotes_required_aboveNoPurchases above this need quotes from at least two sellers.
allowed_agent_subjectsNoOnly these AgentIDs (the subject in their token) may spend. Null for any verified or unverified agent the other rules allow.
require_verified_agentNoOnly agents that prove who they are with an AgentID token on check_purchase may spend. Only where get_spend_policy says verified agents are available.
category_monthly_budgetsNoMost spent per category in one UTC month, e.g. {"software": 2000}. Checks must then name a category.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / currency / description
      Previous value: -"Currency of every amount here; purchases in another are denied. Defaults to USD."New value: +"Currency of every amount here. Purchases in another are denied, or converted at a recorded rate where get_spend_policy lists rail units. Defaults to USD."
    • addedInput schema / properties / expired_quote_action
      Added value: +{
      +  "description": "When a check's seller quote has expired: deny it (the default) or ask a person. ask only where get_spend_policy lists quote expiry.",
      +  "enum": [
      +    "deny",
      +    "ask"
      +  ],
      +  "type": "string"
      +}
  2. Added

TDQS

A4.4/5.0
Behavior5/5

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

Contradicts nothing and instead explains why destructiveHint=true: an omitted field is reset to its default, so a partial save silently drops rules. Also discloses the write-scope credential requirement and the 403 refusal for unclaimed sandbox keys. This is exactly the context annotations cannot convey.

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?

Front-loaded with the replace-whole-policy semantics before the credential and workspace preconditions. Four dense sentences, each carrying a distinct operational fact, with no restatement of the title or schema.

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?

For an 18-parameter destructive mutation with no annotations beyond hints and no output schema, the description covers replacement semantics, auth, and workspace state well. It never says what the call returns or whether the saved policy is echoed back, a minor gap given no output schema exists.

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 18 well-documented parameters, so the schema carries the semantics and baseline 3 applies. The description adds scoping nuance for agent_id (agent's own key cannot change the rules binding it) but does not describe preset, currency, or budget interaction beyond what the schema already says.

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 ('Save a spend policy whole') plus the exact two scopes: agent_id for one agent, omitted for the workspace default. An agent can distinguish this from get_spend_policy or create_routing_policy without opening the schema.

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 read get_spend_policy first, and warns to send every rule it wants to keep. It states the key-type constraint (workspace-wide key, not the agent's own key) and the claimed-workspace precondition. It stops short of naming alternatives for adjacent policy tools (create_commerce_policy, set_price_guardrails).

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