list_builds
Retrieve Codemagic builds filtered by app, branch, or tag. Paginate results to browse build history.
Instructions
List Codemagic builds, optionally filtered by app, branch, and/or tag.
Args: app_id: Optional app ID to filter builds. If omitted, returns builds across all apps. branch: Optional branch name to filter builds (e.g. "main"). tag: Optional tag name to filter builds (e.g. "release_v5.57.2"). limit: Number of builds per page (default 10). page: Page number to retrieve, starting from 1 (default 1).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app_id | No | ||
| branch | No | ||
| tag | No | ||
| limit | No | ||
| page | No |
Implementation Reference
- codemagic_mcp/tools/builds.py:10-31 (handler)MCP tool handler for 'list_builds'. Decorated with @mcp.tool(), accepts optional filters (app_id, branch, tag, limit, page) and delegates to CodemagicClient.list_builds().
@mcp.tool() async def list_builds( app_id: str | None = None, branch: str | None = None, tag: str | None = None, limit: int = 10, page: int = 1, ) -> Any: """List Codemagic builds, optionally filtered by app, branch, and/or tag. Args: app_id: Optional app ID to filter builds. If omitted, returns builds across all apps. branch: Optional branch name to filter builds (e.g. "main"). tag: Optional tag name to filter builds (e.g. "release_v5.57.2"). limit: Number of builds per page (default 10). page: Page number to retrieve, starting from 1 (default 1). """ async with CodemagicClient() as client: return await client.list_builds( app_id=app_id, branch=branch, tag=tag, limit=limit, page=page ) - codemagic_mcp/tools/builds.py:11-17 (schema)Input parameters for the list_builds tool: app_id (optional), branch (optional), tag (optional), limit (default 10), page (default 1).
async def list_builds( app_id: str | None = None, branch: str | None = None, tag: str | None = None, limit: int = 10, page: int = 1, ) -> Any: - codemagic_mcp/client.py:106-149 (helper)CodemagicClient.list_builds() - API client method that sends GET /builds with optional query params (appId, branch, tag) and returns paginated build results with id, status, branch, tag, workflowId, workflowName, appId, timestamps.
async def list_builds( self, app_id: str | None = None, branch: str | None = None, tag: str | None = None, limit: int = 10, page: int = 1, ) -> Any: params: dict[str, Any] = {} if app_id is not None: params["appId"] = app_id if branch is not None: params["branch"] = branch if tag is not None: params["tag"] = tag data = await self._get("/builds", params=params) all_builds = data.get("builds", []) total = len(all_builds) start = (page - 1) * limit end = start + limit page_builds = all_builds[start:end] return { "pagination": { "page": page, "limit": limit, "total": total, "totalPages": (total + limit - 1) // limit if total > 0 else 1, }, "builds": [ { "id": b.get("_id"), "status": b.get("status"), "branch": b.get("branch"), "tag": b.get("tag"), "workflowId": b.get("workflowId"), "workflowName": b.get("workflowName"), "appId": b.get("appId"), "createdAt": b.get("createdAt"), "startedAt": b.get("startedAt"), "finishedAt": b.get("finishedAt"), } for b in page_builds ], } - codemagic_mcp/tools/__init__.py:1-13 (registration)Tools registration: register_all_tools() calls builds.register(mcp), which registers the list_builds MCP tool.
from mcp.server.fastmcp import FastMCP from codemagic_mcp.tools import apps, artifacts, builds, caches, variables, webhooks def register_all_tools(mcp: FastMCP) -> None: apps.register(mcp) builds.register(mcp) artifacts.register(mcp) caches.register(mcp) variables.register(mcp) webhooks.register(mcp)