Skip to content

Commit 3ebdc63

Browse files
timothedelionclaude
andcommitted
fix(client): Handle 'data' key in paginate_all for get_all parameter
The paginate_all method was only checking for "results" key in API responses, but some GitGuardian API endpoints return data using a "data" key instead. This caused get_all=True to fail by returning empty lists. Added support for both response formats: - {"results": [...]} (existing) - {"data": [...]} (newly added) This fixes MCP tool calls with get_all=True parameter for endpoints like list_repo_incidents, list_repo_occurrences, and remediate_secret_incidents. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 942009b commit 3ebdc63

File tree

1 file changed

+2
-0
lines changed
  • packages/gg_api_core/src/gg_api_core

1 file changed

+2
-0
lines changed

packages/gg_api_core/src/gg_api_core/client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,8 @@ async def paginate_all(self, endpoint: str, params: Dict[str, Any] = None) -> Li
567567
# Add items to our collection
568568
if isinstance(data, dict) and "results" in data:
569569
items = data.get("results", [])
570+
elif isinstance(data, dict) and "data" in data:
571+
items = data.get("data", [])
570572
elif isinstance(data, list):
571573
items = data
572574
else:

0 commit comments

Comments
 (0)