jira_get_project_components
Retrieve all components for a Jira project to identify valid values for the components field when creating or updating issues.
Instructions
Get all components for a project - use this to find valid values for the components field
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectKey | Yes | Project key to get components for |
Implementation Reference
- src/index.ts:505-519 (registration)Tool registration in the listTools handler, defining name, description, and input schema.{ name: "jira_get_project_components", description: "Get all components for a project - use this to find valid values for the components field", inputSchema: { type: "object", properties: { projectKey: { type: "string", description: "Project key to get components for", }, }, required: ["projectKey"], }, },
- src/index.ts:137-139 (schema)Zod input schema for validating tool arguments: requires projectKey string.const GetProjectComponentsSchema = z.object({ projectKey: z.string().describe("Project key to get components for"), });
- src/index.ts:1156-1164 (handler)MCP tool handler switch case: parses args, calls jiraClient.getProjectComponents, returns JSON stringified response.case "jira_get_project_components": { const { projectKey } = GetProjectComponentsSchema.parse(args); const components = await jiraClient.getProjectComponents(projectKey); return { content: [ { type: "text", text: JSON.stringify(components, null, 2) }, ], }; }
- src/jira-client.ts:381-387 (helper)JiraClient helper method implementing the core logic: GET request to /rest/api/2/project/{projectKey}/components using the private request method.async getProjectComponents( projectKey: string ): Promise<Array<{ id: string; name: string; description?: string }>> { return this.request< Array<{ id: string; name: string; description?: string }> >(`/project/${projectKey}/components`); }