tools.aws.base module

Shared AWS session, JSON helpers, and credential resolution for tools/aws/.

tools.aws.base.strip_rm(resp)[source]

Drop the boilerplate ResponseMetadata block from a boto3 response.

Removes the ResponseMetadata key (HTTP status, request id, retry counts) that boto3 attaches to every response, trimming noise before the response is serialized and shown to the model. The dict is mutated in place and returned; non-dict responses pass through unchanged.

Pure local mutation with no I/O. Called by tools/aws/helpers.py (aws_method) on dict responses just before _dumps(); no other internal callers were found.

Parameters:

resp (Any) – A boto3 response, typically a dict but any type is accepted.

Returns:

The same object, with ResponseMetadata removed when it was a dict.

Return type:

Any