cancel_build
Cancel a running build by providing the build ID. Stops an active build process on Codemagic.
Instructions
Cancel a running Codemagic build.
Args: build_id: The build ID to cancel.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| build_id | Yes |
Implementation Reference
- codemagic_mcp/tools/builds.py:76-84 (handler)The MCP tool handler for cancel_build. It is decorated with @mcp.tool(annotations=ToolAnnotations(destructiveHint=True)) and calls client.cancel_build(build_id).
@mcp.tool(annotations=ToolAnnotations(destructiveHint=True)) async def cancel_build(build_id: str) -> Any: """Cancel a running Codemagic build. Args: build_id: The build ID to cancel. """ async with CodemagicClient() as client: return await client.cancel_build(build_id) - codemagic_mcp/client.py:230-231 (helper)CodemagicClient helper method that sends a POST request to /builds/{build_id}/cancel to cancel the build.
async def cancel_build(self, build_id: str) -> Any: return await self._post(f"/builds/{build_id}/cancel") - codemagic_mcp/tools/__init__.py:6-12 (registration)Registration function that calls builds.register(mcp), which registers all build tools including cancel_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) - codemagic_mcp/server.py:43-43 (registration)Top-level call to register_all_tools(mcp) which ultimately registers cancel_build.
register_all_tools(mcp)