Skip to main content
Glama

Cooper Email

Set inbox spend policy

cooper_set_spend_policy
Idempotent

Use this to read or set per-inbox send limits. Requires auth. Inputs: inbox_id (omit when this key is limited to one inbox) and optional max_sends_per_day, domain_allow, domain_block, approval_keywords, and approval_amount_cents. Omit every limit field to read the current policy. Returns {object:"spend_policy", inbox_id, max_sends_per_day, domain_allow, domain_block, approval_keywords, approval_amount_cents, updated_at, enabled}. A send past max_sends_per_day is HTTP 429 send_limit_exceeded. A blocked domain is HTTP 403 recipient_domain_blocked. A domain outside a non-empty allow list is HTTP 403 recipient_domain_denied. A keyword or an amount at or above approval_amount_cents stages an owner-approval draft instead of sending, and that needs a verified owner. Null clears a numeric limit. COOPER_SPEND_LIMITS=off disables enforcement. The default is on. Same as GET and PUT /api/v1/inboxes/{id}/spend-policy.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "cooper_set_spend_policy"
  }
}

Input Schema

NameRequiredDescriptionDefault
inbox_idNoInbox id (inb_…), username, or email. Omit it when this key is limited to one inbox.
domain_allowNoRecipient domains that may receive mail. Empty means every domain that is not blocked.
domain_blockNoRecipient domains that cannot receive mail.
approval_keywordsNoCase-insensitive substrings that hold the message for owner approval.
max_sends_per_dayNoMaximum outbound messages per UTC day. Null clears the cap. Integer from 1 to 10000.
approval_amount_centsNoAmounts in the message at or above this many cents are held for owner approval. Null clears it.

Output Schema

NameRequiredDescriptionDefault
objectNospend_policy.
enabledNoFalse when COOPER_SPEND_LIMITS is off.
inbox_idNoInbox id this policy belongs to.
updated_atNoISO-8601 time the policy was saved, or null when it is still the default.
domain_allowNoRecipient domains that may receive mail. Empty means no allow list.
domain_blockNoRecipient domains that cannot receive mail.
approval_keywordsNoSubstrings that hold the message for owner approval.
max_sends_per_dayNoMaximum outbound messages per UTC day, or null when unset.
approval_amount_centsNoAmounts at or above this many cents are held for owner approval, or null.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

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 by disclosing auth requirement, the exact error codes for each rejection path (429 send_limit_exceeded, 403 recipient_domain_blocked, 403 recipient_domain_denied), the owner-approval staging behavior that requires a verified owner, null-clears semantics, and the COOPER_SPEND_LIMITS=off escape hatch. That is precisely the operational context annotations cannot carry.

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-loads purpose, then inputs, then the return shape, then failure modes — a sensible ordering with dense, waste-free sentences. The enumerated return fields are somewhat redundant given an output schema exists, which keeps it from a 5.

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?

Covers everything an agent needs for a six-parameter, dual-mode policy tool: auth, mode selection, field semantics, error mapping, approval side effects, and the feature-flag override. The output schema makes the return-value restatement redundant rather than necessary, so nothing is missing.

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 100%, so baseline is 3, but the description adds cross-parameter meaning: omitting inbox_id when the key is scoped to one inbox, and the fact that a keyword or an amount at/above approval_amount_cents diverts a send into an approval draft rather than sending. The 'null clears a numeric limit' note is largely duplicative of 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?

States a specific verb pair and resource: 'read or set per-inbox send limits', and names the concrete policy fields involved. An agent can distinguish this from the sibling firewall-policy tool without opening either 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?

Gives an explicit mode switch: 'Omit every limit field to read the current policy', which tells the agent how to choose read vs write. It also implies when the write path will fail (limit exceeded, blocked domain, allow-list denial, approval staging) but never names an alternative tool to use instead.

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.