Repository navigation
fix(stepfunctions-tool-mcp-server): paginate list_state_machines - #4864
Open
mangeshraut712 wants to merge 3 commits into
Open
mangeshraut712 wants to merge 3 commits into
mangeshraut712 wants to merge 3 commits into
Conversation
Contributor
Author
|
CI is green. Paginates list_state_machines so large accounts are not truncated. Please review and merge when you can. |
mangeshraut712
force-pushed
the
fix/stepfunctions-paginate-list-state-machines
branch
from
October 27, 2026 14:37
55c9cd0 to
a4fa482
Compare
register_state_machines() called list_state_machines() once and never followed nextToken, so accounts with more than 100 state machines had tools silently registered only for the first page. Use the boto3 paginator, matching the pattern lambda-tool-mcp-server already uses for list_functions. Fixes awslabs#2050
mangeshraut712
force-pushed
the
fix/stepfunctions-paginate-list-state-machines
branch
from
October 28, 2026 04:43
805c3a3 to
e79f4fe
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2050
Summary
Changes
register_state_machines()calledsfn_client.list_state_machines()once and never followednextToken. In an account with more than 100 state machines, everything past the first page was dropped with no error, so those state machines never registered as MCP tools.This adds
get_all_state_machines(), which uses the boto3 paginator (get_paginator('list_state_machines')) and concatenatesstateMachinesacross pages.register_state_machines()now calls that helper. The shape matchesget_all_lambda_functions()inlambda-tool-mcp-server.Existing unit tests that mocked
list_state_machinesnow mock the paginator. Addedtest_get_all_state_machines.pyfor single-page, multi-page, and empty results, plustest_register_machines_across_multiple_pagesso tools from both pages are registered.User experience
Before: only the first page (up to 100) of state machines became MCP tools. After: every page is registered.
Checklist
Tests:
uv run pytest -qinsrc/stepfunctions-tool-mcp-server(65 passed, 100% coverage).ruff checkclean on the touched files.Is this a breaking change? (Y/N) N
Acknowledgment
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the project license.