list_projects
Retrieve and filter Jira projects to manage workflows, track progress, and organize tasks with customizable parameters for results and details.
Instructions
List projects from Jira
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| maxResults | No | The maximum number of results to return, (max: 100) | |
| query | No | A query string used to filter the returned projects. The query string cannot be used with the startAt and maxResults parameters. | |
| expand | No | Use this parameter to include additional information in the response. This parameter accepts a comma-separated list. Expand options include: `description`, `lead`, `issueTypes`, `url`, `projectKeys`, `permissions`, `insight`. Comma separated list of options. |
Implementation Reference
- src/tools/list_projects.ts:37-52 (handler)The main handler function for the 'list_projects' tool. It constructs a Jira API URL for listing projects, adds optional query parameters (maxResults, query, expand), fetches the data using $jiraJson, and returns the result wrapped in ok/err.export async function listProjects(input: ListProjectsInput) { const url = new URL(`/rest/api/2/project`, env.JIRA_BASE_URL); if (input.maxResults) url.searchParams.set("maxResults", input.maxResults.toString()); if (input.query) url.searchParams.set("query", input.query); if (input.expand) url.searchParams.set("expand", input.expand); const json = await $jiraJson(url.toString()); if (json.isErr()) return err(json.error); return ok(json.value); }
- src/tools/list_projects.ts:10-27 (schema)Zod schema defining the input parameters for the list_projects tool: optional maxResults (number), query (string), and expand (string).export const listProjectsInputSchema = z.object({ maxResults: z .number() .optional() .describe("The maximum number of results to return, (max: 100)"), query: z .string() .optional() .describe( "A query string used to filter the returned projects. The query string cannot be used with the startAt and maxResults parameters.", ), expand: z .string() .optional() .describe( "Use this parameter to include additional information in the response. This parameter accepts a comma-separated list. Expand options include: `description`, `lead`, `issueTypes`, `url`, `projectKeys`, `permissions`, `insight`. Comma separated list of options.", ), });
- src/tools/list_projects.ts:29-33 (registration)Tool registration object defining the name, description, and input schema for the 'list_projects' tool.export const LIST_PROJECTS_TOOL: Tool = { name: "list_projects", description: "List projects from Jira", inputSchema: zodToJsonSchema(listProjectsInputSchema) as Tool["inputSchema"], };
- src/app.ts:39-48 (registration)Central registration of all tools in the MCP server, including LIST_PROJECTS_TOOL, provided via listTools endpoint.export const tools = [ // list LIST_PROJECTS_TOOL, LIST_BOARDS_TOOL, LIST_SPRINTS_FROM_BOARD_TOOL, LIST_ISSUES_FROM_SPRINT_TOOL, // create CREATE_ISSUE_TOOL, ] satisfies Tool[];