jira_search
Search JIRA issues using JQL queries, with options to paginate results for efficient issue management and analysis.
Instructions
Search issues using JQL (JIRA Query Language)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| jql | Yes | JQL query string | |
| maxResults | No | Maximum number of results (default: 50) | |
| startAt | No | Starting index for pagination (default: 0) |
Implementation Reference
- server.js:230-248 (handler)The execution handler for the jira_search tool. It calls jiraClient.searchIssues and returns the results as JSON-formatted text content.async ({ jql, startAt = 0, maxResults = 50 }) => { logger.info('Searching JIRA issues', { jql, startAt, maxResults }); try { const searchResults = await jiraClient.searchIssues(jql, startAt, maxResults); logger.info('Successfully searched issues', { jql, resultCount: searchResults.issues?.length || 0 }); return { content: [{ type: 'text', text: JSON.stringify(searchResults, null, 2) }] }; } catch (error) { logger.error('Failed to search issues', { jql, error: error.message }); throw error; } }
- server.js:224-228 (schema)Input schema using Zod for validating jql, startAt, and maxResults parameters of the jira_search tool.inputSchema: { jql: z.string().describe('JQL query string'), startAt: z.number().optional().describe('Starting index for pagination (default: 0)'), maxResults: z.number().optional().describe('Maximum number of results (default: 50)') }
- server.js:218-221 (registration)Registration of the jira_search tool using McpServer's registerTool method.// Register jira_search tool server.registerTool( 'jira_search', {
- server.js:138-144 (helper)JiraClient helper method implementing the core JIRA search functionality via API POST request to /rest/api/2/search.async searchIssues(jql, startAt = 0, maxResults = 50) { logger.info('Searching JIRA issues', { jql, startAt, maxResults }); return await this.makeRequest('search', { method: 'POST', body: JSON.stringify({ jql, startAt, maxResults }) }); }