Skip to main content
Glama

Search Issues

search_issues

Find Jira issues using JQL queries to filter by assignee, status, labels, parent/epic, or other criteria.

Instructions

Search for issues using JQL (Jira Query Language). Use this to find issues by parent/epic, assignee, status, labels, or any other criteria. Example JQL: "parent=TSSE-206", "assignee=currentuser() AND status="In Progress"", "labels=Dec15-19"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
jqlYesJQL query string (e.g., "parent=EPIC-123", "project=TSSE AND status="To Do"")
maxResultsNoMaximum number of results to return (default: 50, max: 100)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNo
totalNo
issuesNo

Implementation Reference

  • MCP tool handler function for search_issues that validates JQL input, calls the underlying searchIssues helper, limits results, formats output with assignee display names, and handles errors.
    async ({ jql, maxResults }) => {
      try {
        if (!jql || !jql.trim()) {
          throw new Error('jql is required');
        }
    
        const issues = await searchIssues(jql, ['summary', 'status', 'priority', 'assignee', 'updated']);
        
        // Apply maxResults limit (default 50, max 100)
        const limit = Math.min(maxResults || 50, 100);
        const limitedIssues = issues.slice(0, limit);
        
        // Map to include assignee display name
        const mappedIssues = limitedIssues.map(issue => ({
          key: issue.key,
          summary: issue.summary,
          status: issue.status,
          priority: issue.priority,
          assignee: issue.assignee,
          updated: issue.updated,
        }));
    
        const output = { issues: mappedIssues, total: issues.length };
        return {
          content: [{ type: 'text', text: JSON.stringify(output, null, 2) }],
          structuredContent: output,
        };
      } catch (error) {
        const errOutput = formatError(error);
        return {
          content: [{ type: 'text', text: JSON.stringify(errOutput, null, 2) }],
          structuredContent: errOutput,
          isError: true,
        };
      }
    }
  • Input and output schemas using Zod for the search_issues tool, defining JQL query input and structured issues output.
    {
      title: 'Search Issues',
      description: 'Search for issues using JQL (Jira Query Language). Use this to find issues by parent/epic, assignee, status, labels, or any other criteria. Example JQL: "parent=TSSE-206", "assignee=currentuser() AND status=\"In Progress\"", "labels=Dec15-19"',
      inputSchema: {
        jql: z.string().describe('JQL query string (e.g., "parent=EPIC-123", "project=TSSE AND status=\"To Do\"")'),
        maxResults: z.number().optional().describe('Maximum number of results to return (default: 50, max: 100)'),
      },
      outputSchema: {
        issues: z.array(z.object({
          key: z.string(),
          summary: z.string(),
          status: z.string(),
          priority: z.string(),
          assignee: z.string().optional(),
          updated: z.string(),
        })).optional(),
        total: z.number().optional(),
        error: z.object({
          message: z.string(),
          statusCode: z.number().optional(),
          details: z.unknown().optional(),
        }).optional(),
      },
    },
  • src/index.ts:281-342 (registration)
    Full registration of the search_issues tool with MCP server, including name, schema, title, description, and handler function.
    server.registerTool(
      'search_issues',
      {
        title: 'Search Issues',
        description: 'Search for issues using JQL (Jira Query Language). Use this to find issues by parent/epic, assignee, status, labels, or any other criteria. Example JQL: "parent=TSSE-206", "assignee=currentuser() AND status=\"In Progress\"", "labels=Dec15-19"',
        inputSchema: {
          jql: z.string().describe('JQL query string (e.g., "parent=EPIC-123", "project=TSSE AND status=\"To Do\"")'),
          maxResults: z.number().optional().describe('Maximum number of results to return (default: 50, max: 100)'),
        },
        outputSchema: {
          issues: z.array(z.object({
            key: z.string(),
            summary: z.string(),
            status: z.string(),
            priority: z.string(),
            assignee: z.string().optional(),
            updated: z.string(),
          })).optional(),
          total: z.number().optional(),
          error: z.object({
            message: z.string(),
            statusCode: z.number().optional(),
            details: z.unknown().optional(),
          }).optional(),
        },
      },
      async ({ jql, maxResults }) => {
        try {
          if (!jql || !jql.trim()) {
            throw new Error('jql is required');
          }
    
          const issues = await searchIssues(jql, ['summary', 'status', 'priority', 'assignee', 'updated']);
          
          // Apply maxResults limit (default 50, max 100)
          const limit = Math.min(maxResults || 50, 100);
          const limitedIssues = issues.slice(0, limit);
          
          // Map to include assignee display name
          const mappedIssues = limitedIssues.map(issue => ({
            key: issue.key,
            summary: issue.summary,
            status: issue.status,
            priority: issue.priority,
            assignee: issue.assignee,
            updated: issue.updated,
          }));
    
          const output = { issues: mappedIssues, total: issues.length };
          return {
            content: [{ type: 'text', text: JSON.stringify(output, null, 2) }],
            structuredContent: output,
          };
        } catch (error) {
          const errOutput = formatError(error);
          return {
            content: [{ type: 'text', text: JSON.stringify(errOutput, null, 2) }],
            structuredContent: errOutput,
            isError: true,
          };
        }
      }
  • Core helper function implementing the Jira JQL search via the /search/jql API endpoint, handling fields parameter, response parsing, and mapping to simplified JiraIssue format. Called by the tool handler.
    export async function searchIssues(jql: string, fields: string[] = ['summary', 'status', 'priority', 'updated']): Promise<JiraIssue[]> {
      const params = new URLSearchParams({
        jql,
        maxResults: '100',
      });
      // Add fields as separate params (the new API accepts array-style)
      fields.forEach(f => params.append('fields', f));
    
      const response = await jiraFetch<{
        issues: Array<{
          key: string;
          id: string;
          fields: {
            summary: string;
            status: { name: string };
            priority: { name: string };
            updated: string;
            description?: unknown;
            assignee?: { displayName: string; accountId: string };
            reporter?: { displayName: string; accountId: string };
            created?: string;
            comment?: { comments: Array<{ id: string; author: { displayName: string }; body: unknown; created: string; updated: string }> };
          };
        }>;
        isLast?: boolean;
        nextPageToken?: string;
      }>(`/search/jql?${params.toString()}`);
    
      return response.issues.map((issue) => ({
        key: issue.key,
        summary: issue.fields.summary,
        status: issue.fields.status.name,
        priority: issue.fields.priority?.name || 'None',
        updated: issue.fields.updated,
        assignee: issue.fields.assignee?.displayName,
      }));
    }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes the search functionality and provides JQL examples, but lacks details on permissions needed, rate limits, pagination behavior (beyond maxResults in schema), or what happens with invalid queries. It adds value but doesn't fully compensate for the absence of annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is efficiently structured with two sentences: the first states the purpose and usage context, and the second provides concrete JQL examples. Every sentence adds value, and it's front-loaded with essential information, making it highly concise and well-organized.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (search with JQL), no annotations, but a rich input schema (100% coverage) and an output schema (implied by context signals), the description is reasonably complete. It explains the core functionality and usage, though it could benefit from more behavioral context (e.g., error handling) to be fully comprehensive.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters thoroughly. The description adds minimal value beyond the schema by mentioning JQL and giving examples, but doesn't provide additional syntax, format details, or constraints. This meets the baseline of 3 when schema coverage is high.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('Search for issues') and resource ('issues'), and distinguishes it from siblings by specifying it uses JQL (Jira Query Language). It provides concrete examples of search criteria (parent/epic, assignee, status, labels), making the purpose unambiguous and differentiated from tools like 'get_my_issues' or 'get_issue_details'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use this tool ('Search for issues using JQL'), with examples of specific criteria like parent/epic, assignee, status, and labels. However, it doesn't explicitly state when NOT to use it or name alternatives (e.g., 'get_my_issues' for a simpler user-specific query), which prevents a perfect score.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/eh24905-wiz/jira-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server