Skip to main content
Glama

trigger_build

Trigger a build for your Codemagic app by specifying application ID, workflow, branch or tag, with optional environment variables and instance type.

Instructions

Trigger a new build for a Codemagic application.

Args: app_id: The Codemagic application ID. workflow_id: The workflow ID to run. branch: Git branch to build (mutually exclusive with tag). tag: Git tag to build (mutually exclusive with branch). environment: Optional environment variables to override, e.g. {"variables": {"KEY": "value"}}. instance_type: Optional machine instance type to use for the build.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
app_idYes
workflow_idYes
branchNo
tagNo
environmentNo
instance_typeNo

Implementation Reference

  • The MCP tool handler function for 'trigger_build'. This is the actual tool function registered with the MCP server. It accepts app_id, workflow_id, branch, tag, environment, and instance_type, and delegates to CodemagicClient.trigger_build().
    @mcp.tool()
    async def trigger_build(
        app_id: str,
        workflow_id: str,
        branch: str | None = None,
        tag: str | None = None,
        environment: dict[str, Any] | None = None,
        instance_type: str | None = None,
    ) -> Any:
        """Trigger a new build for a Codemagic application.
    
        Args:
            app_id: The Codemagic application ID.
            workflow_id: The workflow ID to run.
            branch: Git branch to build (mutually exclusive with tag).
            tag: Git tag to build (mutually exclusive with branch).
            environment: Optional environment variables to override, e.g. {"variables": {"KEY": "value"}}.
            instance_type: Optional machine instance type to use for the build.
        """
        async with CodemagicClient() as client:
            return await client.trigger_build(
                app_id=app_id,
                workflow_id=workflow_id,
                branch=branch,
                tag=tag,
                environment=environment,
                instance_type=instance_type,
            )
  • The CodemagicClient.trigger_build() method that builds the API payload and sends a POST request to /builds. This is the core helper that executes the HTTP call.
    async def trigger_build(
        self,
        app_id: str,
        workflow_id: str,
        branch: str | None = None,
        tag: str | None = None,
        environment: dict[str, Any] | None = None,
        instance_type: str | None = None,
    ) -> Any:
        payload: dict[str, Any] = {
            "appId": app_id,
            "workflowId": workflow_id,
        }
        if branch is not None:
            payload["branch"] = branch
        if tag is not None:
            payload["tag"] = tag
        if environment is not None:
            payload["environment"] = environment
        if instance_type is not None:
            payload["instanceType"] = instance_type
        return await self._post("/builds", json=payload)
  • The register() function in builds.py that, when called, registers all build-related MCP tools (including trigger_build) via the @mcp.tool() decorator.
    def register(mcp: FastMCP) -> None:
  • The register_all_tools() function that calls builds.register(mcp) to trigger registration of all build tools including trigger_build.
    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)
Behavior2/5

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

With no annotations, the description must fully disclose behavior. It mentions mutual exclusivity and optionality but omits key details: what the tool returns, effect on existing builds, rate limits, or authorization requirements. The agent lacks behavioral context for safe invocation.

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

Conciseness4/5

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

The description is efficient: a one-line summary followed by a structured parameter list. It avoids redundancy and is easy to scan. Minor length could be trimmed, but overall well-structured.

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

Completeness3/5

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

Given the tool's complexity (6 parameters, no output schema, no annotations), the description covers parameters well but lacks information on return values, side effects, prerequisites, and how it fits with sibling tools like cancel_build. More completeness would be needed for agent confidence.

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

Parameters4/5

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

The schema has 0% description coverage, so the description must compensate. It provides useful semantics for each parameter: explains mutual exclusivity of branch/tag, format of environment, and optional parameters. This adds significant value beyond the schema's bare names and types.

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 states 'Trigger a new build for a Codemagic application,' clearly identifying the verb (trigger), resource (build), and context (Codemagic application). This distinguishes it from sibling tools like cancel_build and list_builds.

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

Usage Guidelines3/5

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

The description does not provide explicit guidance on when to use this tool versus alternatives. While it implies usage for initiating builds, it lacks when-not-to-use scenarios or mentions of related tools (e.g., cancel_build). The mutual exclusivity of branch and tag is noted in the args, but no broader usage context.

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