Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions mcpgateway/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2295,6 +2295,7 @@ async def list_tools(
tags: Optional[str] = None,
team_id: Optional[str] = Query(None, description="Filter by team ID"),
visibility: Optional[str] = Query(None, description="Filter by visibility: private, team, public"),
gateway_id: Optional[str] = Query(None, description="Filter by gateway ID"),
db: Session = Depends(get_db),
apijsonpath: JsonPathModifier = Body(None),
user=Depends(get_current_user_with_permissions),
Expand All @@ -2307,6 +2308,7 @@ async def list_tools(
tags: Comma-separated list of tags to filter by (e.g., "api,data")
team_id: Optional team ID to filter tools by specific team
visibility: Optional visibility filter (private, team, public)
gateway_id: Optional gateway ID to filter tools by specific gateway
db: Database session
apijsonpath: JSON path modifier to filter or transform the response
user: Authenticated user with permissions
Expand Down Expand Up @@ -2334,6 +2336,10 @@ async def list_tools(
# Use existing method for backward compatibility when no team filtering
data, _ = await tool_service.list_tools(db, cursor=cursor, include_inactive=include_inactive, tags=tags_list)

# Apply gateway_id filtering if provided
if gateway_id:
data = [tool for tool in data if str(tool.gateway_id) == gateway_id]

if apijsonpath is None:
return data

Expand Down
Loading