Skip to main content
Glama

get_build

Retrieve build details and status from Codemagic, including step summary counts. Optionally include full step list with IDs for log retrieval.

Instructions

Get details and status of a specific Codemagic build.

Always includes a step summary (total, success, failed, skipped counts). Set include_steps=True to also get the full list of steps with their IDs, which can then be used with get_step_logs.

Args: build_id: The Codemagic build ID. include_steps: If True, include full step list with IDs. Default False.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
build_idYes
include_stepsNo

Implementation Reference

  • MCP tool handler for 'get_build'. Annotated with @mcp.tool(), accepts build_id (str) and include_steps (bool, default False), creates a CodemagicClient and delegates to client.get_build().
    @mcp.tool()
    async def get_build(build_id: str, include_steps: bool = False) -> Any:
        """Get details and status of a specific Codemagic build.
    
        Always includes a step summary (total, success, failed, skipped counts).
        Set include_steps=True to also get the full list of steps with their IDs,
        which can then be used with get_step_logs.
    
        Args:
            build_id: The Codemagic build ID.
            include_steps: If True, include full step list with IDs. Default False.
        """
        async with CodemagicClient() as client:
            return await client.get_build(build_id, include_steps=include_steps)
  • The schema/interface for get_build: accepts build_id: str and include_steps: bool = False, returns Any. Docstring describes behavior and parameters.
    @mcp.tool()
    async def get_build(build_id: str, include_steps: bool = False) -> Any:
        """Get details and status of a specific Codemagic build.
    
        Always includes a step summary (total, success, failed, skipped counts).
        Set include_steps=True to also get the full list of steps with their IDs,
        which can then be used with get_step_logs.
    
        Args:
            build_id: The Codemagic build ID.
            include_steps: If True, include full step list with IDs. Default False.
        """
        async with CodemagicClient() as client:
            return await client.get_build(build_id, include_steps=include_steps)
  • Client-side implementation of get_build. Calls GET /builds/{build_id}, parses response to build a structured dict with app info, build details, commit info, pull request info, and step summary (with optional full step list).
    async def get_build(self, build_id: str, include_steps: bool = False) -> Any:
        data = await self._get(f"/builds/{build_id}")
        app = data.get("application", {})
        build = data.get("build", {})
        commit = build.get("commit", {}) or {}
        pr = build.get("pullRequest")
        actions = build.get("buildActions", [])
    
        from collections import Counter
        status_counts = Counter(a.get("status") for a in actions)
        steps: Any = {
            "total": len(actions),
            "success": status_counts.get("success", 0),
            "failed": status_counts.get("failed", 0),
            "skipped": status_counts.get("skipped", 0),
        }
        if include_steps:
            steps["items"] = [
                {
                    "id": a.get("_id"),
                    "name": a.get("name"),
                    "status": a.get("status"),
                }
                for a in actions
            ]
    
        return {
            "appName": app.get("appName"),
            "appId": app.get("_id"),
            "build": {
                "_id": build.get("_id"),
                "index": build.get("index"),
                "status": build.get("status"),
                "branch": build.get("branch"),
                "tag": build.get("tag"),
                "workflow": build.get("fileWorkflowId") or build.get("workflowId"),
                "instanceType": build.get("instanceType"),
                "startedAt": build.get("startedAt"),
                "finishedAt": build.get("finishedAt"),
                "startedBy": build.get("startedBy"),
                "message": build.get("message"),
                "commit": {
                    "author": commit.get("authorName"),
                    "message": commit.get("commitMessage"),
                    "hash": commit.get("hash"),
                },
                "pullRequest": {
                    "number": pr.get("number"),
                    "sourceBranch": pr.get("sourceBranch"),
                    "destinationBranch": pr.get("destinationBranch"),
                    "url": pr.get("url"),
                } if pr else None,
                "steps": steps,
            },
        }
  • Registration chain: register_all_tools() calls builds.register(mcp), which registers the get_build handler (via @mcp.tool() decorator in builds.py).
    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)
  • Entry point: register_all_tools(mcp) is called from server.py to register all tools including get_build.
    register_all_tools(mcp)
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description discloses that the tool always includes a step summary and can optionally return full step lists with IDs. It implies read-only behavior via 'Get details and status', but does not explicitly state it has no side effects. For a read operation without annotations, this is adequate but could be more explicit.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise, front-loading the purpose in the first sentence. It then adds a specific behavioral note on step summary and optional steps, followed by a clean parameter list. Every sentence adds value without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of output schema, the description adequately describes the return value (details, status, step summary, optionally steps). It also contextualizes the steps output by linking to get_step_logs, completing the agent's understanding of how this tool fits into workflows.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With schema description coverage at 0%, the description fully explains both parameters: build_id as the Codemagic build ID and include_steps as a boolean defaulting to false, and details the consequence of setting include_steps to true (full step list with IDs for use with get_step_logs). This adds significant meaning beyond the schema's type and title.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool retrieves details and status of a specific Codemagic build, distinguishing it from sibling tools like list_builds (which lists builds) and cancel_build (which cancels builds). It also mentions the optional inclusion of step details, providing a specific verb and resource.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains when to use include_steps=True (to get step IDs for use with get_step_logs), offering clear guidance on parameter usage. However, it does not explicitly state when to use this tool versus other sibling tools like get_build_logs or trigger_build, leaving some ambiguity.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/AgiMaulana/CodemagicMcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server