Skip to main content
Glama

get_projects

Retrieve accessible Jira projects by providing user email and resource ID to manage project visibility and permissions.

Instructions

Get the projects the user has access to

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
userEmailYesThe email of the user accessing the projects.
resourceIdYesThe id of the resource being used to call to get the projects.

Implementation Reference

  • The main handler function that implements the 'get_projects' tool. It retrieves cached user data, creates an API instance for Jira, calls the project search endpoint, and returns the list of projects with id, key, and name fields.
    export function getProjectsTool(server: McpServer) {
        server.tool(
            'get_projects',
            'Get the projects the user has access to',
            {
                userEmail: z.string().email().describe("The email of the user accessing the projects."),
                resourceId: z.string().describe("The id of the resource being used to call to get the projects."),
            },
            async ({userEmail, resourceId}) => {
    
                const cacheData = await getUpdatedCachedData(userEmail);
    
                if(!cacheData) {
                    return {
                        isError: true,
                        content: [
                            {
                                type: "text",
                                text: `Please try again after user confirmed that he authorized the app to access the Jira data.`,
                            },
                        ],
                    };
                }
    
                const api = getApiInstance(`https://api.atlassian.com/ex/jira/${resourceId}`, cacheData.accessToken);
    
                const response = await api.get('/rest/api/3/project/search');
    
                if (response.status !== Constants.OK) {
                    logger.error('Error fetching projects:', response.statusText, response.data, userEmail);
                    return {
                        isError: true,
                        content: [
                            {
                                type: "text",
                                text: `Error getting projects: ${response.statusText}`,
                            },
                        ],
                    };
                }
    
                const data = response.data.values.map((val: any) => ({
                    id: val.id,
                    key: val.key,
                    name: val.name,
                }))
    
                logger.info('Fetched projects:', data);
    
                return {
                    content: [
                        {
                            type: "text",
                            text: JSON.stringify(data),
                        },
                    ],
                };
            }
        );
    }
  • Zod schema defining the input parameters for the get_projects tool: userEmail (required, must be valid email format) and resourceId (required string).
    {
        userEmail: z.string().email().describe("The email of the user accessing the projects."),
        resourceId: z.string().describe("The id of the resource being used to call to get the projects."),
    },
  • Registration function that calls getProjectsTool(server) to register the 'get_projects' tool with the MCP server instance.
    export function registerTools(server: McpServer) {
        createIssueTool(server);
        getProjectsTool(server);
        getAccessibleResourcesTool(server);
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states a read operation ('Get') but doesn't disclose behavioral traits such as permissions needed, pagination, rate limits, or what 'access' entails. This leaves significant gaps for a tool with required parameters.

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's appropriately sized and front-loaded, clearly stating the tool's purpose without unnecessary details.

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 no annotations, no output schema, and a read operation with required parameters, the description is incomplete. It lacks details on behavior, output format, and usage context, making it inadequate for an agent to fully understand how to invoke this tool correctly.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema documents both parameters fully. The description doesn't add meaning beyond the schema, as it doesn't explain why both 'userEmail' and 'resourceId' are required or how they relate to 'access'. Baseline 3 is appropriate when schema does the heavy lifting.

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 clearly states the verb 'Get' and the resource 'projects', specifying scope with 'the user has access to'. It distinguishes from 'create_issue' (write vs read) but doesn't explicitly differentiate from 'get_accessible_resources' (projects vs resources).

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 on when to use this tool versus alternatives like 'get_accessible_resources' is provided. The description implies usage for retrieving projects but doesn't mention prerequisites, constraints, or comparison with sibling tools.

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

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/razvancanuci/jira-issue-mcp-server'

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