Skip to main content
Glama

Grant agent service access

stack_grant_agent_access
Destructive

Create 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

NameRequiredDescriptionDefault
scopesYesOAuth-style scope strings (subset of the connection scopes)
intentsNoNamed 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_idYesAgent ID
constraintsNoRaw 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.
alternativesNoSeveral 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_fromNoData-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_idYesService connection ID
governance_approval_idNoApproval id (gvr_*) from the first call, after a human approved it in the dashboard

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Goes far beyond the annotations (readOnlyHint=false, destructiveHint=true): it describes the elicitation confirmation path, the GOVERNANCE_APPROVAL_REQUIRED response shape, approval single-use and 24-hour expiry, payload binding, passport re-verification timing, and the CONTROL_DENIED consequence when a default policy is not edited. That is exactly the behavioral context an agent needs before invoking a destructive write.

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?

Purpose and approval semantics are front-loaded, but the final two sentences are long run-ons that pack policy-default, policy_listed, control_policy, and CONTROL_DENIED behavior into a single clause chain. The content is valuable, yet splitting it into discrete sentences 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?

There is no output schema, and the description compensates by documenting both success-side payload fields (policy_listed with policy_id/revision, control_policy with revision_needed and message) and the error contract (GOVERNANCE_APPROVAL_REQUIRED with approval_id/approval_url, CONTROL_DENIED connection_not_listed). For an 8-parameter destructive governance tool this is complete.

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 the baseline is 3, and the description earns one more by explaining the governance_approval_id retry pattern, that adding a data-flow source requires human approval, and that intent expansion interacts with the returned catalog from stack_list_intents.

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?

Opens with a specific verb and resource: "Create or replace an agent's grant on a service connection." An agent can tell this is a write tool that sets scope/constraint authority on one service connection, distinct from the revoke sibling in the catalog.

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?

Explains the governing conditions well: expansion of scopes, constraints, or data-flow authority requires human approval, pure narrowing applies immediately, and the approval_id path is for the post-approval retry. It does not explicitly name alternatives such as stack_revoke_agent_access for removal, so it stops short of a 5.

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.