Skip to main content
Glama

jira_check_user_issues

Check if a user belongs to a Jira project and view their assigned issues to manage team workloads and project assignments.

Instructions

Checks if a user is a member of a project and lists their assigned issues

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
jiraHostNoThe Jira host URL (e.g., 'your-domain.atlassian.net')
emailNoEmail address associated with the Jira account
apiTokenNoAPI token for Jira authentication
projectKeyYesThe Jira project key (e.g., 'PROJECT')
userNameYesThe display name of the user to check for in the project

Implementation Reference

  • Main handler function that validates input, authenticates with Jira API, retrieves project roles to check user membership, and if member, fetches and lists their assigned issues in a formatted Markdown response.
    export async function checkUserIssues(args: any) {
        const validatedArgs = await JiraCheckUserIssuesRequestSchema.validate(args);
    
        const jiraHost = validatedArgs.jiraHost || process.env.JIRA_HOST;
        const email = validatedArgs.email || process.env.JIRA_EMAIL;
        const apiToken = validatedArgs.apiToken || process.env.JIRA_API_TOKEN;
        const projectKey = validatedArgs.projectKey;
        const userName = validatedArgs.userName;
    
        if (!jiraHost || !email || !apiToken) {
            throw new Error('Missing required authentication credentials. Please provide jiraHost, email, and apiToken.');
        }
    
        validateCredentials(jiraHost, email, apiToken);
    
        const authHeader = createAuthHeader(email, apiToken);
    
        const rolesResponse = await axios.get(`https://${jiraHost}/rest/api/3/project/${projectKey}/role`, {
            headers: {
                'Authorization': authHeader,
                'Accept': 'application/json',
            },
        });
    
        const projectRoles = rolesResponse.data;
    
        let formattedResponse = `# Checking User "${userName}" in Project "${projectKey}"\n\n`;
    
        const allMembers = new Map<string, {
            displayName: string;
            type: string;
            email: string;
            roles: string[];
        }>();
    
        let userFound = false;
    
        if (Object.keys(projectRoles).length > 0) {
            const roleDetailsPromises: Promise<{
                roleName: string;
                data: ProjectRole;
            }>[] = [];
    
            for (const [roleName, roleUrl] of Object.entries(projectRoles)) {
                if (typeof roleUrl === 'string') {
                    const roleId = roleUrl.split('/').pop();
                    const detailUrl = `https://${jiraHost}/rest/api/3/project/${projectKey}/role/${roleId}`;
    
                    roleDetailsPromises.push(
                        axios.get<ProjectRole>(detailUrl, {
                            headers: {
                                'Authorization': authHeader,
                                'Accept': 'application/json',
                            },
                        }).then(response => ({
                            roleName,
                            data: response.data
                        }))
                    );
                }
            }
    
            const roleDetails = await Promise.all(roleDetailsPromises);
    
            for (const { roleName, data } of roleDetails) {
                if (data.actors && data.actors.length > 0) {
                    data.actors.forEach((actor: RoleActor) => {
                        if (actor.displayName) {
                            if (!allMembers.has(actor.displayName)) {
                                allMembers.set(actor.displayName, {
                                    displayName: actor.displayName,
                                    type: actor.type,
                                    email: actor.emailAddress || 'N/A',
                                    roles: [roleName]
                                });
                            } else {
                                const member = allMembers.get(actor.displayName);
                                if (member) {
                                    member.roles.push(roleName);
                                }
                            }
    
                            if (actor.displayName.toLowerCase() === userName.toLowerCase()) {
                                userFound = true;
                            }
                        }
                    });
                }
            }
    
            formattedResponse += `## Step 1: Checking if user "${userName}" is a member of project "${projectKey}"\n\n`;
    
            if (userFound) {
                const userInfo = allMembers.get(Array.from(allMembers.keys()).find(
                    name => name.toLowerCase() === userName.toLowerCase()
                ) || "");
    
                formattedResponse += `✅ User "${userName}" found in project with the following roles: ${userInfo?.roles.join(', ')}\n\n`;
    
                formattedResponse += `## Step 2: Fetching issues assigned to "${userName}" in project "${projectKey}"\n\n`;
    
                const jql = `project = "${projectKey}" AND assignee = "${userName}" ORDER BY created DESC`;
    
                const response = await axios.get(`https://${jiraHost}/rest/api/3/search`, {
                    params: {
                        jql,
                        maxResults: 50,
                        fields: "summary,status,assignee,created,issuetype,priority",
                    },
                    headers: {
                        'Authorization': authHeader,
                        'Accept': 'application/json',
                    },
                });
    
                const searchResults = response.data;
                const issues = searchResults.issues || [];
    
                if (issues.length > 0) {
                    formattedResponse += "| Issue Key | Summary | Status | Type | Created |\n";
                    formattedResponse += "|-----------|---------|--------|------|--------|\n";
    
                    issues.forEach((issue: any) => {
                        const key = issue.key;
                        const summary = issue.fields.summary || 'No summary';
                        const status = issue.fields.status?.name || 'Unknown';
                        const type = issue.fields.issuetype?.name || 'Unknown';
                        const created = new Date(issue.fields.created).toLocaleDateString();
    
                        formattedResponse += `| ${key} | ${summary} | ${status} | ${type} | ${created} |\n`;
                    });
                } else {
                    formattedResponse += "No issues found assigned to this user in the project.";
                }
            } else {
                formattedResponse += `❌ User "${userName}" is NOT a member of project "${projectKey}". No issues will be fetched.\n\n`;
                formattedResponse += "### Available Project Members:\n\n";
                formattedResponse += "| Name | Roles |\n";
                formattedResponse += "|------|-------|\n";
    
                allMembers.forEach(member => {
                    if (member.type !== "atlassian-user-role-actor" ||
                        (!member.displayName.includes("for Jira") &&
                            !member.displayName.includes("Atlassian"))) {
                        formattedResponse += `| ${member.displayName} | ${member.roles.join(', ')} |\n`;
                    }
                });
            }
        } else {
            formattedResponse += "⚠️ No project roles found. Unable to determine project membership.";
        }
    
        return {
            content: [{ type: "text", text: formattedResponse }],
            isError: false,
        };
    }
  • Yup validation schema extending JiraApiRequestSchema with required projectKey and userName fields, ensuring proper format and presence.
    export const JiraCheckUserIssuesRequestSchema = JiraApiRequestSchema.shape({
        projectKey: yup.string()
            .required("Project key is required")
            .matches(/^[A-Z][A-Z0-9_]+$/, "Invalid project key format. Only uppercase letters, numbers, and underscores are allowed"),
        userName: yup.string()
            .required("Username is required")
            .min(2, "Username must be at least 2 characters long"),
    });
  • Registers the 'jira_check_user_issues' tool in the toolConfigs object, associating it with its schema for validation and handler function for execution in handleCallTool.
    jira_check_user_issues: {
        schema: JiraCheckUserIssuesRequestSchema,
        handler: checkUserIssues
    },
  • Registers the tool description for the MCP listTools handler, providing name, description, and inputSchema for tool discovery.
    {
        name: "jira_check_user_issues",
        description: "Checks if a user is a member of a project and lists their assigned issues",
        inputSchema: {
            type: "object",
            properties: {
                ...getCommonJiraProperties(),
                projectKey: {
                    type: "string",
                    description: "The Jira project key (e.g., 'PROJECT')",
                },
                userName: {
                    type: "string",
                    description: "The display name of the user to check for in the project",
                },
            },
            required: ["projectKey", "userName"],
        },
    },
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 offers minimal behavioral insight. It mentions checking membership and listing issues but doesn't disclose authentication requirements (though schema hints at apiToken), rate limits, error conditions, or what happens if the user isn't a member. For a tool with 5 parameters and no annotation coverage, this is inadequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core functionality. It wastes no words but could be slightly more structured (e.g., separating the two main actions). Every word earns its place.

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 5 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain the return format (e.g., structured list of issues, membership boolean), error handling, or how the two actions (check membership + list issues) relate. For a tool with authentication and data retrieval complexity, more context is needed.

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%, providing good parameter documentation. The description adds no additional parameter semantics beyond what's in the schema—it doesn't explain relationships between parameters (e.g., how email/userName interact) or usage nuances. Baseline 3 is appropriate since the 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 tool's purpose with specific verbs ('checks', 'lists') and resources ('user', 'project', 'assigned issues'). It distinguishes from siblings like 'jira_list_project_members' by focusing on a specific user's membership and issues rather than listing all members. However, it doesn't explicitly differentiate from 'jira_search_issues' which might also find user issues.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when to choose this over 'jira_list_project_members' for membership checking or 'jira_search_issues' for finding user issues. No prerequisites or exclusions are stated.

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

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