Skip to main content
Glama
YawLabs

@yawlabs/aws-mcp

Official
by YawLabs

aws_iam_simulate

Read-onlyIdempotent

Simulate IAM permissions for any principal to check if specific actions are allowed on resources, revealing decision, matched statements, and missing context keys—before you attempt risky operations to avoid 403 errors.

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 -- one per action, with resource '*', when resources is omitted -- with decision (allowed / explicitDeny / implicitDeny / unknown -- unknown is the malformed-response fallback when the decision is missing or unrecognised), matchedStatementIds (which IAM statements decided), missingContextValues (context keys the policy needed but you didn't provide -- common for tag-based policies), permissionsBoundaryDecision, and organizationsDecision (whether SCPs allowed the action; AWS reports it per action, so on a multi-resource call a row that is not allowed can carry a deny that came from another resource). SCP statements never appear in matchedStatementIds, and keys only an SCP references are never reported missing -- pass e.g. aws:RequestedRegion in contextEntries yourself. 'allowed' is necessary, not sufficient: resource control policies (RCPs), the target resource's own policy, session policies and VPC endpoint policies are not evaluated. The CLI follows IAM's pagination itself, so hasMore is false unless you resumed with marker. 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 it normally: on a first call the CLI already follows IAM's pagination and returns every page, so `hasMore` is false. Forwarded as IAM's Marker, which switches the CLI to returning that single page.
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'. Must be the IAM user, group or role ARN -- not the STS session ARN aws_whoami reports for SSO / assumed-role sessions ('arn:aws:sts::<account>:assumed-role/<role>/<session>'); get the role's ARN with aws_call iam get-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. Changed2 schema fields changedv2.5.0
    • changedInput schema / properties / marker / description
      Previous value: -"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`."New value: +"Resume cursor from a previous call's `marker`. Omit it normally: on a first call the CLI already follows IAM's pagination and returns every page, so `hasMore` is false. Forwarded as IAM's Marker, which switches the CLI to returning that single page."
    • 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::123456789012: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'. Must be the IAM user, group or role ARN -- not the STS session ARN aws_whoami reports for SSO / assumed-role sessions ('arn:aws:sts::<account>:assumed-role/<role>/<session>'); get the role's ARN with aws_call iam get-role."
  2. 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
  3. 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."
  4. First observedv1.3.2

TDQS

A5/5.0
Behavior5/5

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

Annotations already mark readOnlyHint and idempotentHint, but the description goes far beyond them: it details the exact return fields (decision, matchedStatementIds, missingContextValues, permissionsBoundaryDecision, organizationsDecision), the unknown fallback, the behavior of SCP statements, the fact that 'allowed' is not sufficient, and the authorization requirement (iam:SimulatePrincipalPolicy). No contradiction with annotations.

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 description is long but dense. It is front-loaded with the core purpose, then moves to output shape, limitations, usage guidance, and permission requirements. Every sentence adds unique information; no filler. The structure (purpose → return → caveats → usage → auth) makes it easy for an agent to extract the key facts quickly.

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?

This is a complex tool with no output schema, so the description must carry the full burden of explaining return values, and it does: it names every field and their meaning. It covers pagination, the fallback behavior, the limitations of what is evaluated, and the caller's required permission. An agent has everything needed to call it correctly and interpret results.

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?

Schema coverage is 100%, but the description adds meaning beyond each field's schema definition: for resources it explains the server-side default and the batch-size limit; for principalArn it clarifies why the STS session ARN from aws_whoami won't work and how to get the correct role ARN; for marker it explains the pagination interaction; for contextEntries it links them to missingContextValues. This is substantial added value.

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?

States a specific verb ('Simulate IAM permissions'), a resource (principal, actions, resources), and the wrapped CLI command. The core question 'can principal X do actions Y on resources Z?' gives immediate clarity. It is clearly distinct from siblings like aws_resource_list or aws_call.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly says when to use: 'Use this BEFORE a risky operation to avoid a 403'. It also names a companion tool (aws_call) and explains how it pairs. The limitations section (RCPs, session policies not evaluated) implicitly tells the agent when NOT to trust the result, serving as an exclusion. No other sibling is a direct alternative, so this is complete guidance.

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