Skip to main content
Glama

list_project_issues

Retrieve Jira issues for a specific project with optional filtering and pagination controls to manage and analyze project tasks effectively.

Instructions

List issues for a project with optional JQL tail filters.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectKeyYesProject key (e.g., PROJ)
jqlTailNoOptional extra JQL, e.g., AND status="In Progress"
startAtNoPagination start index (default 0)
maxResultsNoPage size (1-100, default 50)

Implementation Reference

  • Handler function for the 'list_project_issues' tool. Constructs a JQL query for issues in the specified project (with optional filters), performs a POST to Jira's search API, processes the results, and returns formatted content and structured data.
    async (args: { projectKey: string; jqlTail?: string; startAt?: number; maxResults?: number }) => { const jql = `project=${args.projectKey}${args.jqlTail ? " " + args.jqlTail : ""}`; return await (async () => { try { const body: any = { jql, startAt: args.startAt ?? 0, maxResults: args.maxResults ?? 50, fields: ["key","summary","status","assignee","priority","issuetype","updated"] }; const response = await fetch(`${JIRA_URL}/rest/api/3/search`, { method: "POST", headers: getJiraHeaders(), body: JSON.stringify(body) }); if (!response.ok) { const errorText = await response.text(); return { content: [{ type: "text", text: `Failed to list project issues: ${response.status} ${response.statusText}\n${errorText}` }], isError: true }; } const data = await response.json() as any; const items = (data.issues || []).map((it: any) => ({ key: it.key, summary: it.fields?.summary, status: it.fields?.status?.name, assignee: it.fields?.assignee?.displayName, priority: it.fields?.priority?.name, type: it.fields?.issuetype?.name, updated: it.fields?.updated, url: `${JIRA_URL}/browse/${it.key}` })); return { content: [{ type: "text", text: `Found ${data.total ?? items.length} issues in ${args.projectKey} (showing ${items.length}).` }], structuredContent: { total: data.total ?? items.length, startAt: data.startAt ?? 0, maxResults: data.maxResults ?? items.length, issues: items, projectKey: args.projectKey, raw: data } }; } catch (error) { return { content: [{ type: "text", text: `Error listing issues for ${args.projectKey}: ${error instanceof Error ? error.message : String(error)}` }], isError: true }; } })(); }
  • Input schema definition for the 'list_project_issues' tool, specifying parameters like projectKey, optional JQL tail, and pagination options using Zod validators.
    { title: "List Issues in Project", description: "List issues for a project with optional JQL tail filters.", inputSchema: { projectKey: z.string().describe("Project key (e.g., PROJ)"), jqlTail: z.string().optional().describe("Optional extra JQL, e.g., AND status=\"In Progress\""), startAt: z.number().int().min(0).optional().describe("Pagination start index (default 0)"), maxResults: z.number().int().min(1).max(100).optional().describe("Page size (1-100, default 50)"), },
  • src/server.ts:276-306 (registration)
    Registration of the 'list_project_issues' MCP tool on the server instance using mcp.registerTool, including title, description, input schema, and handler function.
    mcp.registerTool( "list_project_issues", { title: "List Issues in Project", description: "List issues for a project with optional JQL tail filters.", inputSchema: { projectKey: z.string().describe("Project key (e.g., PROJ)"), jqlTail: z.string().optional().describe("Optional extra JQL, e.g., AND status=\"In Progress\""), startAt: z.number().int().min(0).optional().describe("Pagination start index (default 0)"), maxResults: z.number().int().min(1).max(100).optional().describe("Page size (1-100, default 50)"), }, }, async (args: { projectKey: string; jqlTail?: string; startAt?: number; maxResults?: number }) => { const jql = `project=${args.projectKey}${args.jqlTail ? " " + args.jqlTail : ""}`; return await (async () => { try { const body: any = { jql, startAt: args.startAt ?? 0, maxResults: args.maxResults ?? 50, fields: ["key","summary","status","assignee","priority","issuetype","updated"] }; const response = await fetch(`${JIRA_URL}/rest/api/3/search`, { method: "POST", headers: getJiraHeaders(), body: JSON.stringify(body) }); if (!response.ok) { const errorText = await response.text(); return { content: [{ type: "text", text: `Failed to list project issues: ${response.status} ${response.statusText}\n${errorText}` }], isError: true }; } const data = await response.json() as any; const items = (data.issues || []).map((it: any) => ({ key: it.key, summary: it.fields?.summary, status: it.fields?.status?.name, assignee: it.fields?.assignee?.displayName, priority: it.fields?.priority?.name, type: it.fields?.issuetype?.name, updated: it.fields?.updated, url: `${JIRA_URL}/browse/${it.key}` })); return { content: [{ type: "text", text: `Found ${data.total ?? items.length} issues in ${args.projectKey} (showing ${items.length}).` }], structuredContent: { total: data.total ?? items.length, startAt: data.startAt ?? 0, maxResults: data.maxResults ?? items.length, issues: items, projectKey: args.projectKey, raw: data } }; } catch (error) { return { content: [{ type: "text", text: `Error listing issues for ${args.projectKey}: ${error instanceof Error ? error.message : String(error)}` }], isError: true }; } })(); } );

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

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