Grant agent service access
stack_grant_agent_accessCreate or replace an agent's grant on a service connection. A new grant, or any expansion of scopes, constraints or data-flow authority, requires human approval. When human approval is required and the chat client supports MCP elicitation, the person is asked to confirm the exact change in the client; the change is applied only after they approve, and a rejection changes nothing. Otherwise it returns GOVERNANCE_APPROVAL_REQUIRED with approval_id and approval_url, the page for that one approval, and the same payload sent with governance_approval_id after approval applies the change. An approval is single-use, bound to the exact payload, and expires after 24 hours. Pure narrowing applies immediately. Active Passports are checked against the current grant on their next STACK verification. With controls on and a policy of the agent's own that lists connections, the same approval also lists the service in that policy and the response carries policy_listed (policy_id, revision). When the policy in force is the account's default, which governs other agents too, it is not edited: the grant is made but the connection is not callable until a revision of that policy lists it, the response carries control_policy (policy_id, policy_revision, revision_needed, message), and a call on the connection is refused with CONTROL_DENIED reason connection_not_listed until a person adds it, a loosening they approve in their browser. The named-intent catalog is returned by stack_list_intents.
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": {
"agent_id": "<agent_id>",
"service_connection_id": "<service_connection_id>",
"scopes": "<scopes>"
},
"name": "stack_grant_agent_access"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scopes | Yes | OAuth-style scope strings (subset of the connection scopes) | |
| intents | No | Named intents that expand to constraints server-side. Each is { name, params }. E.g. { name: "slack.post_to_channel", params: { channel: ["C0123","C0456"] } }. Combined with `constraints` by concatenation: every one must hold, so use `alternatives` for rules that each allow their own calls. | |
| agent_id | Yes | Agent ID | |
| constraints | No | Raw parameter-level constraints. Each is { path, op, value }. path e.g. "body.channel", "url.pathname", "method". op one of eq|not_eq|in|not_in|matches|starts_with|lt|lte|gt|gte|exists|not_exists. A choice of rules can also be given here as { path: "any_of", op: "any_of", value: [[constraint, ...], ...] } (a call must meet every constraint of at least one group); use `alternatives` for that. At most 8 such choices to a grant. See stack_list_intents for a higher-level alternative. | |
| alternatives | No | Several rules on this connection, any one of which allows a call: for example a read rule and a post rule. Each is { intents?, constraints? } and holds in full when it is used. The `intents` and `constraints` above apply to every rule. A call that fits none is refused. | |
| allow_data_from | No | Data-flow baseline: the sources whose content may flow INTO this one. Each entry is an exact service name, or one connection of a service written service@<connection id>. Content read through one connection of a service needs such an entry before it may go out through another connection of the same service. Omit or pass [] for no cross-service flow. Pass ["*"] alone to cover every service currently granted to the agent; Passport issuance resolves it to exact names and never signs the wildcard. Adding a source to an existing grant requires human approval. | |
| service_connection_id | Yes | Service connection ID | |
| governance_approval_id | No | Approval id (gvr_*) from the first call, after a human approved it in the dashboard |