list_projects
Retrieve all Jira projects to view available workspaces and their details for project management and tracking.
Instructions
List all the projects on Jira on the api /rest/api/3/project. Do not use markdown in your query.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| number_of_results | No | Number of results to return |
Implementation Reference
- src/index.ts:537-555 (handler)The main handler function 'listProjects' that fetches the list of projects from Jira API /rest/api/3/project using axios, with optional maxResults parameter.async function listProjects(number_of_results: number): Promise<any> { try { const params = { maxResults: number_of_results, // Adjust as needed }; const response = await axios.get(`${JIRA_URL}/rest/api/3/project`, { headers: getAuthHeaders().headers, params, }); return response.data; } catch (error: any) { //return the error in a json return { error: error.response.data, }; } }
- src/index.ts:126-139 (schema)The input schema definition for the 'list_projects' tool, including name, description, and inputSchema with number_of_results.name: 'list_projects', description: 'List all the projects on Jira on the api /rest/api/3/project. Do not use markdown in your query.', inputSchema: { type: 'object', properties: { number_of_results: { type: 'integer', description: 'Number of results to return', default: 1, }, }, }, },
- src/index.ts:803-818 (registration)The registration/dispatch case in the CallToolRequestSchema handler that calls the listProjects function and returns the JSON response as text content.case 'list_projects': { const number_of_results = Number( request.params.arguments?.number_of_results ?? 1, ); const response = await listProjects(number_of_results); return { content: [ { type: 'text', text: JSON.stringify(response, null, 2), }, ], }; }