Skip to main content
Glama
YawLabs

@yawlabs/aws-mcp

Official
by YawLabs

aws_assume_role

Destructive

Assume an IAM role and store temporary credentials as a named AWS profile for cross-account access. Run subsequent AWS calls with that profile.

Instructions

Call STS AssumeRole and stash the returned temporary credentials as a named profile in the shared credentials file ($AWS_SHARED_CREDENTIALS_FILE when set, otherwise ~/.aws/credentials; the resolved path is returned as credentialsPath). Subsequent calls to aws_call / aws_whoami / aws_paginate can use profile='mcp-' (or your overridden targetProfile name). The raw secret key / session token are NOT returned to the caller — only the profile name, expiration, and assumed identity. Use for cross-account access: a source profile (your SSO identity) assumes a role in another account. Default timeout is 120s (raise via timeoutMs for slow SAML / credential_process setups on cold start).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
regionNoRegion for the STS call. Defaults to session region / $AWS_REGION.
roleArnYesTarget role ARN, e.g. 'arn:aws:iam::123456789012:role/CrossAccountAdmin'.
timeoutMsNoTimeout in milliseconds for the underlying STS AssumeRole CLI call. Default 120000 (120s) -- gives cold-start SAML / credential_process setups headroom over runAwsCall's 60s default. Raise further for unusually slow IdPs.
externalIdNoExternal ID (only required if the role's trust policy demands it).
sessionNameYesRole session name (shows up in CloudTrail). Alphanumeric + +=,.@- only.
sourceProfileNoProfile to use as the assuming identity. Defaults to session profile / $AWS_PROFILE / 'default'.
targetProfileNoProfile name to write the temp creds under. Default 'mcp-<sessionName>'. Auto-prefixed with 'mcp-' if missing.
durationSecondsNoSession duration in seconds (900-43200). Default 3600.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.5.1
    • addedInput schema / properties / roleArn / pattern
      Added value: +"^arn:aws[a-z-]*:iam::[0-9]{12}:role\\/.+$"
  2. First observedv1.3.2

TDQS

A4.7/5.0
Behavior5/5

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

The description discloses important side effects beyond the annotations: credentials are written to a named profile in the shared credentials file, the resolved file path is returned, raw secrets are intentionally not returned, and there is a 120s default timeout with guidance for slow setups. This meaningfully extends the structured 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 dense but well-organized, with the core operation first, followed by downstream usage, security-relevant behavior, use case, and timeout guidance. Every sentence contributes distinct information and none merely repeats the tool name or annotation title.

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?

Despite having 8 parameters and no output schema, the description provides enough context for an agent to call the tool correctly: what it does, where it writes, what is returned, how to use the resulting profile, when to use it, and how to adapt timeout. The schema covers parameter formats, so no critical operational detail 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 description coverage is 100%, so the baseline is 3. The description adds real value by explaining the targetProfile naming convention ('mcp-<sessionName>', auto-prefix behavior, overrides), how sourceProfile relates to the SSO identity, and the rationale for timeoutMs being higher than runAwsCall's default. It does not add much for region, externalId, or durationSeconds, but the schema already covers those.

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 description opens with a precise action and resource: 'Call STS AssumeRole and stash the returned temporary credentials as a named profile in the shared credentials file.' This clearly distinguishes aws_assume_role from sibling tools like aws_call or aws_session_set, and the annotation title reinforces the same purpose.

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?

The description explicitly states when this tool is appropriate: 'Use for cross-account access: a source profile (your SSO identity) assumes a role in another account.' It also explains how resulting profiles are consumed by sibling tools, but it does not mention when not to use it or name alternative tools for same-account scenarios.

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