get_pipeline_variable
Retrieve specific pipeline variable details from Bitbucket, including key, secured status, and value when accessible.
Instructions
Get details about a specific pipeline variable.
Args:
repo_slug: Repository slug
variable_uuid: Variable UUID (from list_pipeline_variables)
Returns:
Variable details including key, secured status, and value (if not secured)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo_slug | Yes | ||
| variable_uuid | Yes |
Implementation Reference
- src/server.py:509-528 (handler)The main MCP tool handler function for 'get_pipeline_variable'. It uses the Bitbucket client to fetch the variable and formats the response using the PipelineVariableSummary model.@mcp.tool() @handle_bitbucket_error @formatted def get_pipeline_variable(repo_slug: str, variable_uuid: str) -> dict: """Get details about a specific pipeline variable. Args: repo_slug: Repository slug variable_uuid: Variable UUID (from list_pipeline_variables) Returns: Variable details including key, secured status, and value (if not secured) """ client = get_client() result = client.get_pipeline_variable(repo_slug, variable_uuid) if not result: return not_found_response("Pipeline variable", variable_uuid) return PipelineVariableSummary.from_api(result).model_dump()
- src/bitbucket_client.py:665-682 (helper)The BitbucketClient helper method that makes the actual API request to retrieve the pipeline variable by UUID.def get_pipeline_variable( self, repo_slug: str, variable_uuid: str ) -> Optional[dict[str, Any]]: """Get a specific pipeline variable. Args: repo_slug: Repository slug variable_uuid: Variable UUID Returns: Variable info or None if not found """ variable_uuid = ensure_uuid_braces(variable_uuid) return self._request( "GET", self._repo_path(repo_slug, "pipelines_config", "variables", variable_uuid), )
- src/models.py:340-356 (schema)Pydantic model used for input/output schema validation and serialization of pipeline variable data in the tool response.class PipelineVariableSummary(BaseModel): """Pipeline variable info.""" uuid: str = "" key: str = "" secured: bool = False value: Optional[str] = None # Only present for non-secured variables @classmethod def from_api(cls, data: dict) -> "PipelineVariableSummary": return cls( uuid=data.get("uuid", ""), key=data.get("key", ""), secured=data.get("secured", False), value=data.get("value"), # Will be None for secured variables )