Skip to content

[CHORE]: Remove unused Pydantic schemas in schemas.py (PaginationParams, ObservabilityQueryParams, PerformanceHistoryParams) #3706

@crivetimihai

Description

@crivetimihai

Description

Three schema classes in mcpgateway/schemas.py are defined but never imported or used by any Python code:

Schema Line Hardcoded bound Problem
PaginationParams 7367 le=500 Would silently conflict with PAGINATION_MAX_PAGE_SIZE if anyone used it
ObservabilityQueryParams 7612 le=1000 Dead code
PerformanceHistoryParams 7814 le=1000 Dead code

Why it matters

PaginationParams.per_page has le=500 hardcoded. If any future code uses this schema instead of Query(... le=settings.pagination_max_page_size), it would reintroduce the 422 bug that #3469 fixed — operators who raise PAGINATION_MAX_PAGE_SIZE above 500 would silently hit a validation mismatch.

Suggested fix

Delete these three unused schemas. All existing endpoints define their own Query params inline and reference settings.pagination_max_page_size directly.

Verification

# Confirm no Python imports exist
grep -rn 'PaginationParams\|ObservabilityQueryParams\|PerformanceHistoryParams' mcpgateway/ --include='*.py'
# Should only show the class definitions in schemas.py

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    COULDP3: Nice-to-have features with minimal impact if left out; included if time permitschoreLinting, formatting, dependency hygiene, or project maintenance chores

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions