Skip to main content
Glama
YawLabs

@yawlabs/aws-mcp

Official
by YawLabs

aws_iam_simulate

Read-onlyIdempotent

Check if an IAM principal can perform given actions on resources before running a risky operation, preventing 403 errors. Uses simulate-principal-policy to return allow or deny decisions.

Instructions

Simulate IAM permissions for a principal: can principal X do actions Y on resources Z? Wraps iam simulate-principal-policy. Returns one entry per (action, resource) pair with decision (allowed / explicitDeny / implicitDeny / unknown -- unknown is the malformed-response fallback when EvalDecision is missing or unrecognised), matchedStatementIds (which IAM statements decided), and missingContextValues (context keys the policy needed but you didn't provide -- common for tag-based policies). IAM paginates large batches: when it truncates, hasMore is true and marker carries the resume cursor -- call again with marker set to get the rest, and treat summary as covering only the page you have. Use this BEFORE a risky operation to avoid a 403; pairs with the post-failure Suggestion you get from aws_call. Requires iam:SimulatePrincipalPolicy on the caller.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
markerNoResume cursor from a previous call's `marker`. Omit for the first page. Forwarded as IAM's Marker; only meaningful when a prior call returned `hasMore: true`.
regionNoOverride session region for this call (IAM is global; affects API endpoint).
actionsYesIAM action names to test, e.g. ['lambda:CreateFunction', 's3:GetObject']. 1-50 entries. Wildcards (e.g. 's3:*') are accepted.
profileNoOverride session profile for this call.
resourcesNoResource ARNs to test against, e.g. ['arn:aws:s3:::my-bucket/*']. Up to 50 entries -- the simulator evaluates actions x resources, and the whole request travels as a single argv entry, so a larger batch dies as an opaque spawn error rather than a result. Split bigger batches across calls. When omitted, AWS applies its own default of ['*'] server-side (best-case 'is this action ever allowed?') -- this tool does not inject a ['*'] itself.
timeoutMsNoTimeout in milliseconds. Default 60000.
principalArnYesARN of the principal whose policies you want to evaluate, e.g. 'arn:aws:iam::123456789012:user/jeff' or 'arn:aws:iam::123456789012:role/my-role'.
contextEntriesNoContext keys for policies that depend on request context -- 'aws:RequestTag/Project' = 'foo', etc. Provide when the policy you're testing references condition keys; the response's `missingContextValues` will tell you which ones it wanted.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv2.1.0
    • addedInput schema / properties / marker
      Added value: +{
      +  "description": "Resume cursor from a previous call's `marker`. Omit for the first page. Forwarded as IAM's Marker; only meaningful when a prior call returned `hasMore: true`.",
      +  "maxLength": 1024,
      +  "minLength": 1,
      +  "type": "string"
      +}
    • changedInput schema / properties / resources / description
      Previous value: -"Resource ARNs to test against, e.g. ['arn:aws:s3:::my-bucket/*']. When omitted, AWS applies its own default of ['*'] server-side (best-case 'is this action ever allowed?') -- this tool does not inject a ['*'] itself."New value: +"Resource ARNs to test against, e.g. ['arn:aws:s3:::my-bucket/*']. Up to 50 entries -- the simulator evaluates actions x resources, and the whole request travels as a single argv entry, so a larger batch dies as an opaque spawn error rather than a result. Split bigger batches across calls. When omitted, AWS applies its own default of ['*'] server-side (best-case 'is this action ever allowed?') -- this tool does not inject a ['*'] itself."
    • addedInput schema / properties / resources / maxItems
      Added value: +50
  2. Changed2 schema fields changedv1.5.1
    • changedInput schema / properties / principalArn / description
      Previous value: -"ARN of the principal whose policies you want to evaluate, e.g. 'arn:aws:iam::123456789012:user/jeff' or 'arn:aws:iam::123:role/my-role'."New value: +"ARN of the principal whose policies you want to evaluate, e.g. 'arn:aws:iam::123456789012:user/jeff' or 'arn:aws:iam::123456789012:role/my-role'."
    • changedInput schema / properties / resources / description
      Previous value: -"Resource ARNs to test against, e.g. ['arn:aws:s3:::my-bucket/*']. Omit to default to ['*'] (best-case 'is this action ever allowed?')."New value: +"Resource ARNs to test against, e.g. ['arn:aws:s3:::my-bucket/*']. When omitted, AWS applies its own default of ['*'] server-side (best-case 'is this action ever allowed?') -- this tool does not inject a ['*'] itself."
  3. First observedv1.3.2

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already mark the tool readOnly/idempotent/non-destructive, and the description adds substantial behavioral context beyond them: the `unknown` fallback for malformed EvalDecision responses, pagination semantics (hasMore/marker with per-page summary scope), the opaque spawn-error failure mode for oversized batches, the server-side ['*'] default that this tool deliberately does not inject, and the iam:SimulatePrincipalPolicy authorization requirement. No contradiction with annotations — the simulation is genuinely read-only.

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

Conciseness5/5

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

The core purpose is front-loaded in the first sentence, and every subsequent sentence earns its place: return semantics, malformed-response fallback, pagination caveat, pre-flight usage, and auth requirement are each stated once with zero redundancy. The length is proportionate to genuine complexity (8 parameters, pagination, edge cases).

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?

With no output schema, the description fully carries the burden of explaining return values — one entry per (action, resource) pair, all four decision values, matchedStatementIds, missingContextValues, hasMore/marker, and per-page summary scoping — and also covers pagination, batch limits, the context-key feedback loop, and the caller permission prerequisite. Nothing an agent needs to call and interpret this tool correctly 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. The description adds real value on top: it explains the actions×resources multiplication and the single-argv spawn-error ceiling for resources, the server-side ['*'] default when resources is omitted, and the missingContextValues feedback loop that tells you which contextEntries to supply. This is above baseline, though the schema already documents most parameters well on its own.

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 opening sentence is precise: 'Simulate IAM permissions for a principal: can principal X do actions Y on resources Z?' — a specific verb, resource, and the exact question the tool answers. Naming the wrapped API (iam simulate-principal-policy) and the tool's role relative to execution tools like aws_call makes its purpose unambiguous.

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 states exactly when to invoke the tool — 'Use this BEFORE a risky operation to avoid a 403' — and describes the pairing with 'the post-failure Suggestion you get from aws_call,' giving clear usage context. It stops short of a 5 because it gives no explicit when-not-to-use guidance or exclusion scenarios, though no sibling tool is a true alternative for simulation.

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