Skip to main content
Glama
leorosignoli

JIRA Zephyr MCP Server

by leorosignoli

link_tests_to_issues

Associate test cases with JIRA issues to track testing activities and requirements. Link test case IDs to relevant issue keys for traceability.

Instructions

Associate test cases with JIRA issues

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
testCaseIdYesTest case ID
issueKeysYesJIRA issue keys to link

Implementation Reference

  • The main handler function that implements the link_tests_to_issues tool. It validates input, loops through issue keys, links each test case to issues using ZephyrClient, and returns results with success/failure counts.
    export const linkTestsToIssues = async (input: LinkTestsToIssuesInput) => {
      const validatedInput = linkTestsToIssuesSchema.parse(input);
      
      try {
        const results = [];
        
        for (const issueKey of validatedInput.issueKeys) {
          try {
            await getZephyrClient().linkTestCaseToIssue(validatedInput.testCaseId, issueKey);
            results.push({
              issueKey,
              success: true,
            });
          } catch (error: any) {
            results.push({
              issueKey,
              success: false,
              error: error.response?.data?.message || error.message,
            });
          }
        }
        
        return {
          success: true,
          data: {
            testCaseId: validatedInput.testCaseId,
            linkResults: results,
            successCount: results.filter(r => r.success).length,
            failureCount: results.filter(r => !r.success).length,
          },
        };
      } catch (error: any) {
        return {
          success: false,
          error: error.response?.data?.message || error.message,
        };
      }
    };
  • Zod schema defining the input structure for the link_tests_to_issues tool: testCaseId (required string) and issueKeys (array of strings, at least one).
    export const linkTestsToIssuesSchema = z.object({
      testCaseId: z.string().min(1, 'Test case ID is required'),
      issueKeys: z.array(z.string().min(1)).min(1, 'At least one issue key is required'),
    });
  • src/index.ts:159-170 (registration)
    Registration of the link_tests_to_issues tool in the MCP server's TOOLS array, including name, description, and input schema for the protocol.
    {
      name: 'link_tests_to_issues',
      description: 'Associate test cases with JIRA issues',
      inputSchema: {
        type: 'object',
        properties: {
          testCaseId: { type: 'string', description: 'Test case ID' },
          issueKeys: { type: 'array', items: { type: 'string' }, description: 'JIRA issue keys to link' },
        },
        required: ['testCaseId', 'issueKeys'],
      },
    },
  • src/index.ts:413-423 (registration)
    Dispatcher case in the MCP server's CallToolRequest handler that validates input using the schema and calls the linkTestsToIssues handler function.
    case 'link_tests_to_issues': {
      const validatedArgs = validateInput<LinkTestsToIssuesInput>(linkTestsToIssuesSchema, args, 'link_tests_to_issues');
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(await linkTestsToIssues(validatedArgs), null, 2),
          },
        ],
      };
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool 'associates' test cases with issues, implying a mutation operation, but doesn't specify whether this creates new links, overwrites existing ones, requires permissions, or has side effects (e.g., updating JIRA issue status). For a mutation tool with zero annotation coverage, this leaves critical behavioral traits unclear.

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 a single, direct sentence with zero wasted words. It front-loads the core purpose efficiently, making it easy to parse. Every word earns its place by conveying essential information without redundancy or fluff.

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 tool's complexity (a mutation operation linking two systems), lack of annotations, and no output schema, the description is incomplete. It doesn't cover behavioral aspects like permissions, side effects, or return values, leaving gaps that could hinder an agent's ability to use it correctly. For a tool with this context, more detail is needed.

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%, with clear parameter descriptions in the input schema. The description adds no additional meaning beyond what the schema provides (e.g., format examples, constraints, or usage context for parameters). According to the rules, with high schema coverage, the baseline is 3 even without param info in the description.

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 ('Associate') and resources ('test cases with JIRA issues'), making the purpose immediately understandable. It distinguishes itself from siblings like 'create_test_case' or 'read_jira_issue' by focusing on linking existing entities. However, it doesn't specify the directionality or nature of the association (e.g., bidirectional linking, adding tests to issues), which prevents a perfect score.

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 no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., existing test cases and JIRA issues), exclusions, or how it differs from sibling tools like 'execute_test' or 'generate_test_report'. Without context, an agent might misuse it or overlook related operations.

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/leorosignoli/jira-zephyr-mcp'

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