Skip to main content
Glama

get_step_logs

Access raw logs for a specific build step using build ID and step ID. Get step IDs from get_build_logs. Choose file delivery for managed temp file or inline for direct log text.

Instructions

Get the raw logs for a specific build step.

Use get_build_logs first to see all step IDs, then call this to drill into a specific step.

Args: build_id: The Codemagic build ID. step_id: The step ID (from get_build_logs output). delivery: Defaults to "file" to create/update a managed temp file and return artifact metadata. Use "inline" to return log text directly.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
build_idYes
step_idYes
deliveryNofile

Implementation Reference

  • The MCP tool handler for 'get_step_logs'. Decorated with @mcp.tool(), it accepts build_id, step_id, and delivery (inline/file). Delegates to CodemagicClient.get_step_logs or get_step_logs_file.
    @mcp.tool()
    async def get_step_logs(
        build_id: str,
        step_id: str,
        delivery: Literal["inline", "file"] = "file",
    ) -> Any:
        """Get the raw logs for a specific build step.
    
        Use get_build_logs first to see all step IDs, then call this to drill into a specific step.
    
        Args:
            build_id: The Codemagic build ID.
            step_id: The step ID (from get_build_logs output).
            delivery: Defaults to "file" to create/update a managed temp file and return artifact metadata. Use "inline" to return log text directly.
        """
        async with CodemagicClient() as client:
            if delivery == "inline":
                return await client.get_step_logs(build_id, step_id)
            if delivery == "file":
                return await client.get_step_logs_file(build_id, step_id)
            raise ValueError('delivery must be either "inline" or "file"')
  • Client method that makes the HTTP GET request to Codemagic API for step logs (inline delivery). Returns raw response text.
    async def get_step_logs(self, build_id: str, step_id: str) -> str:
        response = await self._client.get(f"/builds/{build_id}/step/{step_id}")
        response.raise_for_status()
        return response.text
  • Client method that fetches the log, writes it to a managed temp file, enforces storage limits, and returns artifact metadata (file delivery).
    async def get_step_logs_file(self, build_id: str, step_id: str) -> dict[str, Any]:
        log_text = await self.get_step_logs(build_id, step_id)
        self.cleanup_step_log_artifacts()
    
        destination = self._build_log_file_path(build_id, step_id)
        self._write_step_log_file(destination, log_text)
        self._enforce_step_log_limits()
        return self._inspect_step_log_artifact(build_id, step_id)
  • Tool registration entry point. Calls builds.register(mcp) which registers get_step_logs as an MCP tool via the @mcp.tool() decorator.
    from mcp.server.fastmcp import FastMCP
    
    from codemagic_mcp.tools import apps, artifacts, builds, caches, variables, webhooks
    
    
    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)
  • Server initialization: creates FastMCP instance and calls register_all_tools(mcp) which registers all tools including get_step_logs.
    mcp = FastMCP(
        name="Codemagic MCP",
        instructions=(
            "Codemagic CI/CD REST API: manage builds, apps, artifacts, caches, variables, and webhooks.\n\n"
            "Destructive ops (delete_app, cancel_build, delete_cache, delete_all_caches, delete_variable, delete_webhook): confirm before executing.\n\n"
            "App ID resolution: (1) use explicit app_id; (2) use CODEMAGIC_DEFAULT_APP_ID if set (exposed as `default_app_id`); "
            "(3) call list_apps — auto-select if one result, else ask user."
        ),
        lifespan=lifespan,
    )
    
    register_all_tools(mcp)
Behavior4/5

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

Despite no annotations, the description explains the delivery parameter behavior: default 'file' creates/manages a temp file and returns artifact metadata, while 'inline' returns text directly. This provides useful behavioral context beyond the schema.

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: a single-sentence purpose, a usage guideline sentence, and a parameter explanation paragraph. No superfluous content, front-loaded with key info.

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

Completeness4/5

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

Given no annotations and no output schema, the description adequately covers purpose, usage, and parameters. It could mention the return format for inline delivery, but overall it provides sufficient context for correct tool invocation.

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?

Schema description coverage is 0%, but the description fully explains each parameter: build_id and step_id are identified, step_id referenced to get_build_logs output, and delivery has clear enum explanation with defaults.

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 verb 'Get' and the resource 'raw logs for a specific build step', distinguishing it from siblings like get_build_logs which lists all step IDs.

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

Usage Guidelines5/5

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

Explicitly instructs to use get_build_logs first to obtain step IDs, then call this tool, providing clear when-to-use and alternative guidance.

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