Skip to main content
Glama

get_jira_projects

Retrieve all accessible Jira projects to view and manage their details. Use this tool via the Jira MCP Server to streamline project access and organization through natural language commands.

Instructions

Get all accessible Jira projects

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Primary handler implementing the get_jira_projects MCP tool: paginates through all projects via v3 API, maps to output models.
    async def get_jira_projects(self) -> List[JiraProjectResult]:
        """Get all accessible Jira projects using v3 REST API"""
        logger.info("Starting get_jira_projects...")
        all_projects_data = []
        start_at = 0
        max_results = 50
        page_count = 0
    
        while True:
            page_count += 1
            logger.info(
                f"Pagination loop, page {page_count}: startAt={start_at}, maxResults={max_results}"
            )
    
            try:
                response = await self._v3_api_client.get_projects(
                    start_at=start_at, max_results=max_results
                )
    
                projects = response.get("values", [])
                if not projects:
                    logger.info("No more projects returned. Breaking pagination loop.")
                    break
    
                all_projects_data.extend(projects)
    
                if response.get("isLast", False):
                    logger.info("'isLast' is True. Breaking pagination loop.")
                    break
    
                start_at += len(projects)
    
                # Yield control to the event loop to prevent deadlocks in the MCP framework.
                await asyncio.sleep(0)
    
            except Exception as e:
                logger.error(
                    "Error inside get_jira_projects pagination loop", exc_info=True
                )
                raise
    
        logger.info(
            f"Finished get_jira_projects. Total projects found: {len(all_projects_data)}"
        )
    
        results = []
        for p in all_projects_data:
            results.append(
                JiraProjectResult(
                    key=p.get("key"),
                    name=p.get("name"),
                    id=str(p.get("id")),
                    lead=(p.get("lead") or {}).get("displayName"),
                )
            )
            logger.info(f"Added project {p.get('key')} to results")
        logger.info(f"Returning {len(results)} projects")
        sys.stdout.flush()  # Flush stdout to ensure it's sent to MCP, otherwise hang occurs
        return results
  • Pydantic output model defining project structure returned by the tool.
    class JiraProjectResult(BaseModel):
        key: str
        name: str
        id: str
        lead: Optional[str] = None
  • Registers the tool in MCP server's list_tools() with name, description, and parameterless input schema.
        name=JiraTools.GET_PROJECTS.value,
        description="Get all accessible Jira projects",
        inputSchema={"type": "object", "properties": {}, "required": []},
    ),
    Tool(
  • Dispatches tool calls to the handler in the MCP call_tool() method.
    case JiraTools.GET_PROJECTS.value:
        logger.info("About to AWAIT jira_server.get_jira_projects...")
        result = await jira_server.get_jira_projects()
        logger.info(
            f"COMPLETED await jira_server.get_jira_projects. Result has {len(result)} items."
        )
  • Low-level paginated API call to Jira v3 /project/search endpoint, invoked by the handler.
    async def get_projects(
        self,
        start_at: int = 0,
        max_results: int = 50,
        order_by: Optional[str] = None,
        ids: Optional[list] = None,
        keys: Optional[list] = None,
        query: Optional[str] = None,
        type_key: Optional[str] = None,
        category_id: Optional[int] = None,
        action: Optional[str] = None,
        expand: Optional[str] = None,
    ) -> Dict[str, Any]:
        """
        Get projects paginated using the v3 REST API.
    
        Returns a paginated list of projects visible to the user using the
        /rest/api/3/project/search endpoint.
    
        Args:
            start_at: The index of the first item to return (default: 0)
            max_results: The maximum number of items to return per page (default: 50)
            order_by: Order the results by a field:
                     - category: Order by project category
                     - issueCount: Order by total number of issues
                     - key: Order by project key
                     - lastIssueUpdatedDate: Order by last issue update date
                     - name: Order by project name
                     - owner: Order by project lead
                     - archivedDate: Order by archived date
                     - deletedDate: Order by deleted date
            ids: List of project IDs to return
            keys: List of project keys to return
            query: Filter projects by query string
            type_key: Filter projects by type key
            category_id: Filter projects by category ID
            action: Filter by action permission (view, browse, edit)
            expand: Expand additional project fields in response
    
        Returns:
            Dictionary containing the paginated response with projects and pagination info
    
        Raises:
            ValueError: If the API request fails
        """
        params = {
            "startAt": start_at,
            "maxResults": max_results,
            "orderBy": order_by,
            "id": ids,
            "keys": keys,
            "query": query,
            "typeKey": type_key,
            "categoryId": category_id,
            "action": action,
            "expand": expand,
        }
    
        params = {k: v for k, v in params.items() if v is not None}
    
        endpoint = "/project/search"
        print(
            f"Fetching projects with v3 API endpoint: {endpoint} with params: {params}"
        )
        response_data = await self._make_v3_api_request("GET", endpoint, params=params)
        print(f"Projects API response: {json.dumps(response_data, indent=2)}")
        return response_data
Behavior2/5

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

With no annotations provided, the description carries full burden but only states the basic action. It doesn't disclose behavioral traits such as whether this requires authentication, if it's read-only (implied by 'Get' but not explicit), rate limits, pagination behavior, or what 'accessible' means in terms of permissions. This leaves significant gaps for an agent to understand operational constraints.

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 a single, efficient sentence with zero waste. It front-loads the core purpose ('Get all accessible Jira projects') without unnecessary details. Every word earns its place, making it highly concise and well-structured for quick understanding.

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

Completeness2/5

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

Given the tool's simplicity (0 params, no output schema), the description is minimal but inadequate. It lacks context on what 'accessible' entails, the return format (e.g., list of projects with fields), or any behavioral notes. Without annotations or output schema, the description should compensate more to ensure the agent can use it effectively, but it falls short.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so no parameters need documentation. The description doesn't add param info, but with zero params, the baseline is high. It implicitly confirms no filtering parameters are needed, aligning with the schema. A perfect score is withheld as it could briefly note the lack of parameters for clarity.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get all accessible Jira projects' clearly states the verb ('Get') and resource ('Jira projects'), and specifies scope ('all accessible'). It distinguishes from siblings like 'get_jira_issue' (single issue) and 'get_jira_project_issue_types' (issue types for a project). However, it doesn't explicitly differentiate from 'search_jira_issues' which might also return projects indirectly, keeping it from a perfect score.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives. For example, it doesn't mention whether this should be used for listing projects versus using 'search_jira_issues' with project filters, or if it's for initial discovery before other operations. The description implies usage for retrieving projects but lacks explicit context or exclusions.

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

Related 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/InfinitIQ-Tech/mcp-jira'

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