Skip to main content
Glama

add-test-cases

Add test cases as test runs into a qTest Test Execution suite within a test cycle for streamlined execution management.

Instructions

Test Execution — add test cases as test runs into a qTest Test Execution suite (inside a test cycle)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYes
suiteIdYesID of the test execution suite to add runs into
testCasesYesTest cases to add as test runs

Implementation Reference

  • Core handler that executes the tool logic: loops over test cases and POSTs each as a test run to qTest, counting successes.
    export async function addTestCases(args: AddTestCasesArgs): Promise<AddTestCasesResult> {
      const { projectId, suiteId, testCases } = args
      let added = 0
    
      for (const tc of testCases) {
        try {
          await qtestFetch(
            config,
            projectId,
            `/test-runs?parentId=${suiteId}&parentType=test-suite`,
            'POST',
            { name: tc.name, test_case: { id: tc.id } }
          )
          added++
        } catch {
          // continue on individual failure — count only successes
        }
      }
    
      return { added }
    }
  • Input type (AddTestCasesArgs) and output type (AddTestCasesResult) definitions.
    export interface AddTestCasesArgs {
      projectId: string
      suiteId: number
      testCases: Array<{ id: number; name: string }>
    }
    
    export interface AddTestCasesResult {
      added: number
    }
  • src/server.ts:98-118 (registration)
    Registration of the 'add-test-cases' tool on the MCP server with description, inputSchema (Zod), and handler callback.
    server.registerTool(
      'add-test-cases',
      {
        description:
          'Test Execution — add test cases as test runs into a qTest Test Execution suite (inside a test cycle)',
        inputSchema: {
          projectId: z.string(),
          suiteId: z
            .number()
            .int()
            .describe('ID of the test execution suite to add runs into'),
          testCases: z
            .array(z.object({ id: z.number().int(), name: z.string() }))
            .describe('Test cases to add as test runs'),
        },
      },
      async ({ projectId, suiteId, testCases }) => {
        const result = await addTestCases({ projectId, suiteId, testCases })
        return { content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }] }
      }
    )
  • Imports for config and qtestFetch helper used in the handler.
    import { config } from '@/config.js'
Behavior2/5

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

With no annotations, the description has full responsibility to disclose behavior. It only states the basic operation without mentioning side effects, idempotency, error handling, or required permissions. This is insufficient for a mutation tool.

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, concise sentence that effectively communicates the core purpose without unnecessary words.

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?

The tool has three required parameters and performs a mutation. The description does not explain the result of the operation, error scenarios, or integration with sibling tools. Given the lack of annotations and output schema, the description should provide more contextual completeness.

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

Parameters2/5

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

The description does not add any specific information about parameters beyond what the schema already provides. The schema describes suiteId and testCases, but projectId is left undocumented in both. The description fails to clarify the role of projectId or the structure of testCases beyond the schema.

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 action (add), the objects (test cases as test runs), and the target (a qTest Test Execution suite inside a test cycle). It distinguishes this tool from siblings like create-test-cycle or list-test-cases.

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 like create-test-cycle or list-test-cases. It does not specify prerequisites or context.

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/Usman-Ghani123/qtest-mcp-server'

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