list_projects
Retrieve and filter accessible OpenProject projects with pagination controls to manage project visibility and organization.
Instructions
List all accessible projects with optional filtering and pagination.
Args:
filters: Optional JSON filter string
page: Page number (default: 1)
page_size: Items per page (default: 20)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filters | No | ||
| page | No | ||
| page_size | No |
Implementation Reference
- Core implementation of the list_projects tool handler. Fetches paginated list of projects from OpenProject API with optional filters using OpenProjectClient.async def list_projects( filters: str | None = None, page: int = 1, page_size: int = 20 ) -> dict[str, Any]: """List all accessible projects with optional filtering and pagination. Args: filters: Optional JSON filter string (e.g., '[{"active":{"operator":"=","values":["t"]}}]') page: Page number (default: 1) page_size: Items per page (default: 20) Returns: Paginated collection of projects with metadata """ client = OpenProjectClient() try: params: dict[str, Any] = { "pageSize": page_size, "offset": (page - 1) * page_size, } if filters: params["filters"] = filters result = await client.get("projects", params=params) return result finally: await client.close()
- src/openproject_mcp/server.py:271-286 (registration)Registration of the list_projects tool using @mcp.tool() decorator in the main server, delegating to the projects module's implementation.@mcp.tool() async def list_projects( filters: str | None = None, page: int = 1, page_size: int = 20 ): """List all accessible projects with optional filtering and pagination. Args: filters: Optional JSON filter string page: Page number (default: 1) page_size: Items per page (default: 20) """ return await projects.list_projects( filters=filters, page=page, page_size=page_size, )