list_projects
Retrieve all accessible Jira projects to browse available project names, keys, and metadata for issue management and project discovery.
Instructions
List all accessible Jira projects
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| maxResults | No | Maximum number of projects to return (default: 50) |
Implementation Reference
- src/handlers/project-handlers.ts:7-36 (handler)The handler function that implements the core logic for the 'list_projects' tool. It extracts maxResults from arguments, fetches projects from the Jira API endpoint '/project', formats the result using JiraFormatters.formatProjects, and handles errors.async handleListProjects(args: any) { try { const { maxResults = 50 } = args || {}; const params = { maxResults, }; const projects = await this.apiClient.get('/project', params); return { content: [ { type: 'text', text: JiraFormatters.formatProjects(projects), }, ], }; } catch (error: any) { return { content: [ { type: 'text', text: JiraFormatters.formatError(error), }, ], isError: true, }; } }
- src/tools/definitions.ts:135-147 (schema)Tool definition including name, description, and input schema (optional maxResults parameter) for the 'list_projects' tool.{ name: 'list_projects', description: 'List all accessible Jira projects', inputSchema: { type: 'object', properties: { maxResults: { type: 'number', description: 'Maximum number of projects to return (default: 50)', }, }, }, },
- src/index.ts:110-111 (registration)Registers and dispatches 'list_projects' tool calls to the ProjectHandlers.handleListProjects method within the MCP server's CallToolRequestSchema handler.case 'list_projects': return this.projectHandlers.handleListProjects(request.params.arguments);