Skip to main content
Glama

get_pipeline_logs

Retrieve pipeline execution logs or list available steps for debugging Bitbucket CI/CD workflows. Provide repository slug and pipeline UUID to access detailed run information.

Instructions

Get logs for a pipeline run.

If step_uuid is not provided, returns list of steps to choose from. Args: repo_slug: Repository slug pipeline_uuid: Pipeline UUID step_uuid: Step UUID (optional, get from steps list first) Returns: Pipeline logs or list of available steps

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repo_slugYes
pipeline_uuidYes
step_uuidNo

Implementation Reference

  • MCP tool handler for 'get_pipeline_logs'. Lists pipeline steps if no step_uuid provided, otherwise fetches and returns logs for the specific step using the BitbucketClient.
    def get_pipeline_logs( repo_slug: str, pipeline_uuid: str, step_uuid: Optional[str] = None, ) -> dict: """Get logs for a pipeline run. If step_uuid is not provided, returns list of steps to choose from. Args: repo_slug: Repository slug pipeline_uuid: Pipeline UUID step_uuid: Step UUID (optional, get from steps list first) Returns: Pipeline logs or list of available steps """ client = get_client() if not step_uuid: # Return list of steps steps = client.get_pipeline_steps(repo_slug, pipeline_uuid) return { "message": "Provide step_uuid to get logs for a specific step", "steps": [PipelineStep.from_api(s).model_dump() for s in steps], } # Get logs for specific step logs = client.get_pipeline_logs(repo_slug, pipeline_uuid, step_uuid) return { "step_uuid": step_uuid, "logs": logs if logs else "(no logs available)", }
  • BitbucketClient helper method that performs the actual API request to retrieve pipeline step logs.
    def get_pipeline_logs( self, repo_slug: str, pipeline_uuid: str, step_uuid: str, ) -> str: """Get logs for a pipeline step. Args: repo_slug: Repository slug pipeline_uuid: Pipeline UUID step_uuid: Step UUID Returns: Log content as string """ pipeline_uuid = ensure_uuid_braces(pipeline_uuid) step_uuid = ensure_uuid_braces(step_uuid) path = self._repo_path( repo_slug, "pipelines", pipeline_uuid, "steps", step_uuid, "log" ) return self._request_text(path) or ""
  • Pydantic model PipelineStep used for typing and serializing pipeline step information in the tool's output when listing steps.
    class PipelineStep(BaseModel): """Pipeline step info.""" uuid: str name: Optional[str] = None state: Optional[str] = None result: Optional[str] = None @classmethod def from_api(cls, data: dict) -> "PipelineStep": state_data = data.get("state") or {} result_data = state_data.get("result") or {} return cls( uuid=data.get("uuid", ""), name=data.get("name"), state=state_data.get("name"), result=result_data.get("name") if result_data else None, )
  • src/server.py:428-428 (registration)
    MCP tool registration decorator @mcp.tool() applied to the get_pipeline_logs handler function.
    def get_pipeline_logs(

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/JaviMaligno/mcp-server-bitbucket'

If you have feedback or need assistance with the MCP directory API, please join our Discord server