Skip to main content
Glama

get_polarion_project

Retrieve detailed metadata and configuration settings for a specific Polarion project using its project ID to understand project structure and settings.

Instructions

<purpose>Get detailed information about a specific Polarion project</purpose>

<when_to_use>
- When you need detailed project metadata (description, settings, etc.)
- After using get_polarion_projects() to identify the project_id
- When you need project configuration details
- RARELY needed for most exploration tasks
</when_to_use>

<workflow_position>
OPTIONAL: Use after get_polarion_projects() if project details are needed
USUALLY SKIP: Most tasks should go directly to get_polarion_work_items()
</workflow_position>

<parameters>
- project_id: Exact project ID from get_polarion_projects() results
- fields: "@basic" for essential info, "@all" for complete details
</parameters>

<note>Most users should skip this and go directly to exploring work items</note>

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fieldsNo@basic
project_idYes

Implementation Reference

  • MCP tool handler for get_polarion_project: decorated with @mcp.tool(), validates inputs implicitly via types, calls PolarionClient.get_project(), and returns formatted JSON response.
    @mcp.tool()
    def get_polarion_project(project_id: str, fields: str = "@basic") -> str:
        """
        <purpose>Get detailed information about a specific Polarion project</purpose>
        
        <when_to_use>
        - When you need detailed project metadata (description, settings, etc.)
        - After using get_polarion_projects() to identify the project_id
        - When you need project configuration details
        - RARELY needed for most exploration tasks
        </when_to_use>
        
        <workflow_position>
        OPTIONAL: Use after get_polarion_projects() if project details are needed
        USUALLY SKIP: Most tasks should go directly to get_polarion_work_items()
        </workflow_position>
        
        <parameters>
        - project_id: Exact project ID from get_polarion_projects() results
        - fields: "@basic" for essential info, "@all" for complete details
        </parameters>
        
        <note>Most users should skip this and go directly to exploring work items</note>
        """
        logger.info(f"Fetching project {project_id} from Polarion")
        project = polarion_client.get_project(project_id, fields)
        if project:
            return json.dumps({
                "status": "success",
                "message": f"Successfully fetched project: {project_id}",
                "project": project
            }, indent=2)
        return json.dumps({
            "status": "error",
            "message": f"Failed to fetch project {project_id}. Project may not exist or access is denied."
        }, indent=2)
  • Core helper method in PolarionClient that executes the REST API call to retrieve specific project details from Polarion, handles authentication, errors, and returns project data.
    def get_project(self, project_id: str, fields: str = "@basic") -> Optional[Dict]:
        """Fetch specific project details from Polarion REST API."""
        try:
            self._ensure_token()
            api_url = f"{POLARION_BASE_URL}/rest/v1/projects/{project_id}"
            params = {'fields[projects]': fields}
            response = self.session.get(api_url, params=params, headers=self._headers(), timeout=REQUEST_TIMEOUT_SECONDS)
            if response.status_code == 404:
                logger.warning(f"Project not found: {project_id}")
                return None
            self._handle_api_response(response, f"fetch project {project_id}")
            project_data = response.json()
            logger.info(f"Fetched project: {project_id}")
            return project_data
        except Exception as e:
            logger.error(f"Failed to fetch project {project_id}: {e}")
            return None
  • The @mcp.tool() decorator registers this function as an MCP tool named 'get_polarion_project' based on function name.
    @mcp.tool()
  • Function signature defines input schema: required project_id (str), optional fields (str, default '@basic'), output str (JSON).
    def get_polarion_project(project_id: str, fields: str = "@basic") -> str:

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/Sdunga1/MCP-Polarion'

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