aws_paginate
Retrieve one page from paginated AWS list/describe operations, returning a nextToken for continuation. Helps avoid stdout size limits on large result sets.
Instructions
Fetch one page of a paginated AWS list/describe operation. Identical to aws_call plus maxItems (page size) and startingToken (resume cursor). Returns the parsed response, a nextToken (null when the list is exhausted), and hasMore. Call again with the returned nextToken as startingToken until hasMore is false. Use this instead of aws_call for operations that might exceed the 5 MB stdout cap: list-objects-v2, describe-instances, describe-log-streams, list-roles, etc.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| service | Yes | AWS service in kebab-case: 's3api', 'ec2', 'iam', 'logs', etc. | |
| operation | Yes | Paginated operation: 'list-objects-v2', 'describe-instances', 'list-roles', etc. | |
| params | No | Operation parameters (PascalCase keys) passed via --cli-input-json. | |
| query | No | JMESPath expression to extract fields from each page (--query). The query is wrapped server-side as {NextToken, items: <query>} so pagination still works even when the projection drops NextToken; the handler unwraps `items` before returning. | |
| maxItems | No | Items per page. Default 100. Lower this if hitting the 5 MB output cap. | |
| startingToken | No | Resume cursor from the previous call's `nextToken`. Omit for the first page. | |
| profile | No | Override session profile for this call. | |
| region | No | Override session region for this call. | |
| timeoutMs | No | Timeout in milliseconds. Default 60000. |