Skip to main content
Glama

get_project

Retrieve detailed information about a specific Bitbucket project using its project key, including name, description, and metadata for project management.

Instructions

Get information about a specific project.

Args:
    project_key: Project key (e.g., "DS", "PROJ")

Returns:
    Project info including name, description, and metadata

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_keyYes

Implementation Reference

  • MCP tool handler function for 'get_project' that fetches project data via BitbucketClient and formats it using ProjectDetail model.
    @mcp.tool()
    @handle_bitbucket_error
    @formatted
    def get_project(project_key: str) -> dict:
        """Get information about a specific project.
    
        Args:
            project_key: Project key (e.g., "DS", "PROJ")
    
        Returns:
            Project info including name, description, and metadata
        """
        client = get_client()
        result = client.get_project(project_key)
        if not result:
            return not_found_response("Project", project_key)
    
        return ProjectDetail.from_api(result).model_dump()
  • BitbucketClient helper method that performs the actual API request to retrieve project details.
    def get_project(self, project_key: str) -> Optional[dict[str, Any]]:
        """Get project information.
    
        Args:
            project_key: Project key (e.g., "DS")
    
        Returns:
            Project info or None if not found
        """
        return self._request(
            "GET",
            f"workspaces/{self.workspace}/projects/{project_key}",
        )
  • Pydantic model defining the output schema and parsing logic for project details in get_project tool.
    class ProjectDetail(BaseModel):
        """Project info for get responses."""
    
        key: str
        name: str
        description: str = ""
        private: bool = True
        created: Optional[str] = None
        updated: Optional[str] = None
    
        @field_validator("created", "updated", mode="before")
        @classmethod
        def truncate_ts(cls, v: Any) -> Optional[str]:
            return truncate_timestamp(v)
    
        @classmethod
        def from_api(cls, data: dict) -> "ProjectDetail":
            return cls(
                key=data.get("key", ""),
                name=data.get("name", ""),
                description=data.get("description", ""),
                private=data.get("is_private", True),
                created=data.get("created_on"),
                updated=data.get("updated_on"),
            )

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