Search JIRA Issues
jira_searchSearch JIRA issues using JQL queries to find specific tickets, track progress, and manage project workflows efficiently.
Instructions
Search issues using JQL (JIRA Query Language)
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"jql": "<jql>"
},
"name": "jira_search"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| jql | Yes | JQL query string | |
| startAt | No | Starting index for pagination (default: 0) | |
| maxResults | No | Maximum number of results (default: 50) |
Implementation Reference
- server.js:230-248 (handler)Handler function for jira_search tool that invokes JiraClient.searchIssues and formats the response as 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:221-228 (schema)Input schema for jira_search tool defining parameters jql, startAt, and maxResults using Zod.
{ title: 'Search JIRA Issues', description: 'Search issues using JQL (JIRA Query Language)', 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-249 (registration)Registration of the jira_search tool with McpServer using registerTool method.
// Register jira_search tool server.registerTool( 'jira_search', { title: 'Search JIRA Issues', description: 'Search issues using JQL (JIRA Query Language)', 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)') } }, 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:138-144 (helper)JiraClient.searchIssues method that performs the actual JIRA API search request.
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 }) }); }