Skip to main content
Glama
KS-GEN-AI

Jira MCP Server

by KS-GEN-AI

execute_jql

Execute JQL queries to search and retrieve Jira issues. Specify query string and result count to filter project data.

Instructions

Execute a JQL query on Jira on the api /rest/api/3/search/jql. Do not use markdown in your query.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
jqlYesJQL query string
number_of_resultsNoNumber of results to return

Implementation Reference

  • src/index.ts:40-59 (registration)
    Registration of the 'execute_jql' tool in the ListTools response, including name, description, and input schema.
    {
      name: 'execute_jql',
      description:
        'Execute a JQL query on Jira on the api /rest/api/3/search/jql. Do not use markdown in your query.',
      inputSchema: {
        type: 'object',
        properties: {
          jql: {
            type: 'string',
            description: 'JQL query string',
          },
          number_of_results: {
            type: 'integer',
            description: 'Number of results to return',
            default: 1,
          },
        },
        required: ['jql'],
      },
    },
  • Input schema for the 'execute_jql' tool defining parameters jql (required string) and number_of_results (optional integer, default 1).
    inputSchema: {
      type: 'object',
      properties: {
        jql: {
          type: 'string',
          description: 'JQL query string',
        },
        number_of_results: {
          type: 'integer',
          description: 'Number of results to return',
          default: 1,
        },
      },
      required: ['jql'],
    },
  • Core handler function that executes the JQL query by making an authenticated GET request to Jira's /rest/api/3/search/jql endpoint with specified parameters.
    async function executeJQL(jql: string, maxResults: number): Promise<any> {
      try {
        const params = {
          jql, // JQL query string
          maxResults, // Adjust as needed
          fields: '*all', // Request all fields
        };
    
        const response = await axios.get(`${JIRA_URL}/rest/api/3/search/jql`, {
          headers: getAuthHeaders().headers,
          params,
        });
    
        return response.data;
      } catch (error: any) {
        //return the error in a json
        return {
          error: error.response.data,
        };
      }
    }
  • MCP CallToolRequestSchema handler case for 'execute_jql': validates input, calls executeJQL, and returns the JSON response as text content.
    case 'execute_jql': {
      const jql = String(request.params.arguments?.jql);
      const number_of_results = Number(
        request.params.arguments?.number_of_results ?? 1,
      );
    
      if (!jql) {
        throw new Error('JQL query is required');
      }
    
      const response = await executeJQL(jql, number_of_results);
    
      // Return the entire data from the response
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(response, null, 2), // Pretty print JSON
          },
        ],
      };
    }
Behavior2/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 mentions the API endpoint ('/rest/api/3/search/jql') and a constraint about markdown, but fails to describe critical behaviors: whether this is a read-only or mutation operation (though 'Execute' suggests read-only), what authentication or permissions are required, rate limits, error handling, or what the response format looks like. For a query tool with zero annotation coverage, this is inadequate.

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

Conciseness4/5

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

The description is concise with two sentences that directly address the tool's function and a key constraint. It's front-loaded with the main purpose, and the second sentence adds necessary technical guidance without fluff. However, it could be slightly more structured by explicitly separating behavioral details from usage instructions.

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

Completeness2/5

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

Given the complexity of executing JQL queries (which can involve syntax, permissions, and result handling), no annotations, and no output schema, the description is incomplete. It lacks information on authentication needs, error cases, response format, and how results are returned (e.g., pagination, fields included). This makes it inadequate for an agent to use the tool effectively without additional context.

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?

The input schema has 100% description coverage, with clear documentation for both parameters ('jql' and 'number_of_results'), including a default value. The description adds no additional parameter semantics beyond what's in the schema—it doesn't explain JQL syntax, result formatting, or constraints on 'number_of_results'. Given the high schema coverage, the baseline score of 3 is appropriate as the schema does the heavy lifting.

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

Purpose4/5

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

The description clearly states the action ('Execute a JQL query') and the target resource ('on Jira'), providing a specific verb+resource combination. However, it doesn't differentiate this tool from sibling tools like 'query_assignable' or 'get_only_ticket_name_and_description', which might also involve querying Jira data. The description is clear about what it does but lacks sibling differentiation.

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

Usage Guidelines2/5

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

The description provides minimal guidance with 'Do not use markdown in your query', which is a technical constraint but doesn't explain when to use this tool versus alternatives. There's no mention of when this tool is appropriate compared to sibling tools like 'query_assignable' or 'get_only_ticket_name_and_description', nor any context about prerequisites or exclusions. This leaves the agent with little guidance on tool selection.

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/KS-GEN-AI/jira-mcp-server'

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