Skip to main content
Glama

trigger_build

Initiate a new build for a Codemagic CI/CD application by specifying the app ID, workflow, and optional parameters like branch, tag, or environment variables.

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 definition for `trigger_build`, which parses arguments and calls the CodemagicClient.
    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 underlying API implementation for `trigger_build` that sends the request to the Codemagic API.
    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)
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It establishes the write-nature of the operation ('Trigger'), but omits critical context: whether the call is asynchronous, what the return value contains (build ID? status?), rate limits, or side effects on build queue state. The mutual exclusivity constraint is the only behavioral detail provided.

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?

Uses a structured docstring format with clear Args section. The opening sentence states purpose immediately. Minor redundancy exists in repeating 'mutually exclusive with X' for both branch and tag parameters, but overall information density is appropriate for the parameter count.

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?

With 6 parameters and a mutation operation, the description adequately covers input parameters but fails to describe the output/return value (critical given no output schema exists). Missing: return payload description, error scenarios (invalid workflow_id, missing permissions), or build lifecycle implications.

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?

Schema description coverage is 0%, requiring the description to compensate fully. The Args section documents all 6 parameters with meaningful semantics, including type hints via example for 'environment' and constraint documentation for branch/tag mutual exclusivity. This effectively compensates for the bare schema.

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

Purpose4/5

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

The description opens with 'Trigger a new build for a Codemagic application,' providing a specific verb (Trigger) and resource (build) with clear scope (Codemagic). While it implies the action differentiates from siblings like cancel_build or get_build, it does not explicitly contrast with them.

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 documents that branch and tag are mutually exclusive, which aids correct invocation. However, it lacks guidance on when to use this tool versus alternatives (e.g., when to trigger vs. cancel), prerequisites (required app setup), or expected workflow patterns.

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