Skip to main content
Glama

aws_query

Executes a single AWS API call across selected accounts or an organization's accounts, auto-paginates, and returns merged results.

Instructions

Run one AWS API call across every account a selector resolves to.

``service``/``operation``/``params`` follow the AWS CLI and botocore shape,
e.g. ``service="ec2"``, ``operation="DescribeInstances"``,
``params={"Filters": [{"Name": "instance-state-name", "Values": ["stopped"]}]}``.
Paginated operations are followed to completion automatically, so results
are complete rather than a silent first page. If a result is truncated,
raise ``max_items`` to collect more from each account.

``region`` is always required and never defaulted. Account selectors decide
which accounts are touched; with none given, every account in the active org
is targeted, subject to the configured blast-radius cap. The model never
picks which IAM role to assume, and neither does the caller: the role comes only
from the ``[portals.<org>.environments.*]`` rules in your TOML config.

Any operation the assumed role may perform is dispatched - reads, writes,
deletes, secret reads, all of it - with AWS IAM as the sole authorization
boundary. Nothing is refused locally; if the role lacks permission, AWS
returns AccessDenied and that is what comes back.

Operations that delete, terminate or detach something (``Delete*``,
``Terminate*``, ``Remove*``, ``Detach*`` and similar) first ask the user to
confirm, listing the accounts and parameters. If they decline, or the client
cannot ask, nothing runs. Do not retry a declined call.

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": {
      "service": "<service>",
      "operation": "<operation>",
      "region": "<region>"
    },
    "name": "aws_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
orgNo
orgsNo
paramsNo
regionYes
serviceYes
max_itemsNo
operationYes
account_idNo
account_idsNo
environmentNo
account_nameNo
max_accountsNo
account_namesNo
name_containsNo
exclude_account_idsNo
exclude_account_namesNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.4.0
    • removedInput schema / properties / role
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "title": "Role"
      -}
  2. First observedv0.1.0

TDQS

A4.3/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so unusually well: automatic pagination to completion, truncation signalled by the need to raise max_items, region never defaulted, the caller cannot choose the IAM role (it comes from TOML config), AWS IAM is the sole authorization boundary with nothing refused locally, and destructive verb patterns trigger a confirmation prompt with an explicit no-retry rule.

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?

Four short paragraphs, front-loaded with the core action and followed by parameter shape, fan-out/authz semantics, then the safety gate. A few clauses are redundant (the model/caller role sentence restates the same point twice), but there is no filler.

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 a high-complexity, 16-parameter cross-account dispatcher this covers the hard parts an agent must know before calling: authz model, fan-out default, pagination, and destructive confirmation. An output schema exists so return values need no explanation; the remaining gap is the unexplained selector parameters and how they combine.

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 description coverage is 0% across 16 parameters, so the description must compensate. It explains service/operation/params shape with a concrete botocore example, region, max_items and the aggregate behavior of the account-selector family, but leaves org/orgs, environment, name_contains, max_accounts and the exclude_* parameters entirely undefined, including no mention of how singular vs plural variants interact.

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?

The first sentence names a specific verb (run one AWS API call), the mechanism (service/operation/params) and the scope (every account a selector resolves to). That scope statement alone distinguishes it from siblings like search_accounts, list_roles or explain_role_selection, which do not execute arbitrary API calls.

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 gives concrete conditions: with no account selectors, every account in the active org is targeted subject to a blast-radius cap, and destructive operations require user confirmation with no retry after decline. However, it never names alternatives or exclusions (e.g. 'use search_accounts to resolve IDs first', 'use explain_role_selection to see which role will be used'), so routing guidance is implied rather than explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.