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)

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