Skip to main content
Glama

Set control policy

stack_set_control_policy
Destructive

Create or revise a policy, for one agent or, without agent_id, the account's default. definition holds connections (which connections a call may use, with allow, review or deny rules), actions (a stance per action kind), recipients (allowed email addresses, texts and calls: each a list, or "per_mission"), spend (a ceiling per action, counters per day, month or Mission, and concurrency), review (hold above an amount) and surfaces (models, browser, card, wallet, workspace and tools). A section left out places no limit. A policy only narrows what a connection grant already allows: it refuses, holds an action for a person, or limits it, and never opens anything. Controls must be on, else CONTROLS_NOT_ENABLED. A rule that allows a send without naming who receives it fails with UNBOUNDED_SEND_RULE: bind the recipient fields in the rule, or set the rule's recipients to "per_mission" so each Mission names them. Recipients set per job: a connection rule with effect allow set to "per_mission" allows a send only in a Mission that names the recipients exactly (recipients, recipient_pins or reply_to_message when the Mission opens), and only to them. A Mission that does not name them is refused with recipients_not_pinned; a send to someone it did not name is refused with recipient_not_allowed. A delegated Passport carries the same Mission, so these rules apply to it too. The account's own recipients.email, recipients.sms and recipients.call may also be "per_mission": a send, text or call then names the stored message it answers (reply_to_message) and goes only to whoever wrote that message (a reply with reply_all also reaches the original's own To and Cc). One that names no message is refused with recipients_not_pinned, a recipient other than the sender with recipient_not_allowed, and an id that is not one of the account's received messages with NOT_FOUND. Changing a list to "per_mission", or back, is a loosening; setting "per_mission" where there was no rule is a tightening. Operator only. Tightening applies at once. Loosening a policy, and deleting one, needs the person to approve it in their browser, never in the chat: the call fails with GOVERNANCE_APPROVAL_REQUIRED, approval_id and approval_url, the page where they approve that one change, and the same call sent with governance_approval_id after approval applies it. The tool never waits or loops for the approval. An approval is single-use, bound to the exact request, and expires after 24 hours. Returns change (create, tighten, loosen or unchanged) and the policy.

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": {
      "definition": "<definition>"
    },
    "name": "stack_set_control_policy"
  }
}

Input Schema

NameRequiredDescriptionDefault
agent_idNoThe agent (agt_*) whose own policy this is. Omit for the default policy, which applies to every agent account without a policy of its own.
definitionYes
expected_revisionNoThe revision you read. Required to revise a policy; leave out to create one. A stale revision fails with a conflict.
governance_approval_idNoApproval id (gvr_*) from a GOVERNANCE_APPROVAL_REQUIRED response, once the person approved it in their browser

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Beyond the annotations (readOnlyHint=false, destructiveHint=true), it discloses the full mutation profile: tightening is immediate, loosening and deletion require out-of-band browser approval with GOVERNANCE_APPROVAL_REQUIRED, approval_id and approval_url, approvals are single-use, request-bound and expire in 24 hours, and the tool never polls. It also enumerates the specific failure codes (UNBOUNDED_SEND_RULE, recipients_not_pinned, NOT_FOUND, conflict on stale revision).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Every fact is relevant, but it is delivered as one unbroken wall of text with the critical approval mechanics buried near the end and the 'per_mission' rules restated across three overlapping sentences. Front-loading the create-vs-revise and approval split, and grouping sections, would make it far more scannable.

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 high-complexity, nested-schema mutation tool with no output schema, the description covers creation vs revision, scoping, section semantics, the approval handshake, and the return value ('change' plus the policy). An agent has everything needed to call it and to interpret its failure modes.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 75% schema coverage and deeply nested objects, the description still adds meaning the schema cannot: it maps definition to its six sections (connections, actions, recipients, spend, review, surfaces), states that 'a section left out places no limit', and explains the non-obvious 'per_mission' semantics for connection rules and account recipients. It also clarifies that omitting agent_id targets the account default.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening sentence gives a precise verb and resource ('Create or revise a policy') plus the scope switch ('for one agent or, without agent_id, the account's default'). That makes it clearly distinguishable from read-only siblings like stack_get_control_policy or stack_list_control_policies, though no sibling is named to route an agent explicitly.

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?

It supplies strong operating conditions: Controls must be enabled or CONTROLS_NOT_ENABLED fires, the caller must be an operator, tightening applies immediately while loosening needs browser approval, and expected_revision is required to revise. What it lacks is explicit routing to alternatives such as stack_simulate_control_policy for previewing or stack_delete_control_policy for removal.

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.