search_issues
Search Jira issues using JQL queries to find specific tickets by project, status, assignee, or custom criteria. Returns issue keys and titles for quick identification.
Instructions
Search for Jira issues using JQL (Jira Query Language). Returns issue keys and titles. Use get_issue for full details.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| jql | Yes | JQL query string (e.g., "project = PROJ AND status = Open") | |
| maxResults | No | Maximum number of results to return (default: 50) |
Implementation Reference
- src/handlers/search-handlers.ts:7-64 (handler)The main handler function that executes the search_issues tool logic: parses JQL args, calls Jira API /search/jql, formats markdown response with issue keys and summaries.async handleSearchIssues(args: any) { try { const { jql, maxResults = 50 } = args; if (!jql) { throw new Error('jql query is required'); } // Use POST with fields parameter to get key and summary const requestBody = { jql, maxResults, fields: ['summary'], // Only get summary, key is always included }; const result = await this.apiClient.post('/search/jql', requestBody); // Format response with key and title let response = `# Search Results\n\n**JQL**: ${jql}\n\n`; response += `Found ${result.issues.length} issue(s)${result.isLast ? '' : ' (more available)'}\n\n`; if (result.issues && result.issues.length > 0) { result.issues.forEach((issue: any) => { const key = issue.key; const summary = issue.fields?.summary || 'No summary'; response += `- **${key}**: ${summary}\n`; }); response += `\n💡 Use \`get_issue\` with issue key to get full details.`; // Add pagination info if (!result.isLast && result.nextPageToken) { response += `\n\n**More results available** - ${result.issues.length} shown.`; } } else { response += `No issues found matching the query.`; } return { content: [ { type: 'text', text: response, }, ], }; } catch (error: any) { return { content: [ { type: 'text', text: JiraFormatters.formatError(error), }, ], isError: true, }; } }
- src/tools/definitions.ts:118-134 (schema)Input schema and description definition for the search_issues tool, used for validation and listing.name: 'search_issues', description: 'Search for Jira issues using JQL (Jira Query Language). Returns issue keys and titles. Use get_issue for full details.', inputSchema: { type: 'object', properties: { jql: { type: 'string', description: 'JQL query string (e.g., "project = PROJ AND status = Open")', }, maxResults: { type: 'number', description: 'Maximum number of results to return (default: 50)', }, }, required: ['jql'], }, },
- src/index.ts:108-109 (registration)Tool call dispatching/registration in the main MCP server switch statement, routes to SearchHandlers.handleSearchIssues.case 'search_issues': return this.searchHandlers.handleSearchIssues(request.params.arguments);