Skip to main content
Glama

get_test_case

Retrieve a test case by its ID or key and obtain version details including version number, latest version flag, AI generation indicator, and associated test steps.

Instructions

Get a test case by its internal ID or key (e.g. FS-TC-31950). Returns an array of versions, each with versionNo, isLatestVersion, aiGenerated flag, and any test steps.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesTest case ID or key (e.g. QTP-TC-1)

Implementation Reference

  • src/index.ts:211-216 (registration)
    The 'get_test_case' tool is registered using a local 'tool()' wrapper which internally calls server.registerTool(). The tool's name, description, and input schema are defined here.
    tool(
      "get_test_case",
      "Get a test case by its internal ID or key (e.g. FS-TC-31950). Returns an array of versions, each with versionNo, isLatestVersion, aiGenerated flag, and any test steps.",
      { id: ID.describe("Test case ID or key (e.g. QTP-TC-1)") },
      async ({ id }) => ok(await qtmFetch(`/testcases/${id}`))
    );
  • The input schema for get_test_case accepts a single 'id' parameter, defined as z.union([z.string(), z.number()]), so it accepts either a test case ID (number) or a key string like 'FS-TC-31950'.
    const ID = z.union([z.string(), z.number()]);
  • The handler function makes a GET request to /testcases/{id} using qtmFetch(), then wraps the result with ok() to format it as MCP tool content.
    async ({ id }) => ok(await qtmFetch(`/testcases/${id}`))
  • The 'ok()' helper function wraps JSON data into the MCP tool response format (content array with type: text).
    /** Wrap a successful API response as MCP tool content. */
    function ok(data: unknown) {
      return {
        content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }],
      };
    }
  • The 'tool()' wrapper function handles registration by calling server.registerTool() with the provided name, description, inputSchema, and callback.
    /** Thin wrapper around registerTool for concise, non-deprecated tool registration. */
    const tool = <Shape extends z.ZodRawShape>(
      name: string,
      description: string,
      inputSchema: Shape,
      // eslint-disable-next-line @typescript-eslint/no-explicit-any
      callback: (args: z.infer<z.ZodObject<Shape>>) => Promise<any>
    ) =>
      server.registerTool(
        name,
        { description, inputSchema },
        // eslint-disable-next-line @typescript-eslint/no-explicit-any
        callback as any
      );
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. It describes the return format (array of versions with fields) but omits aspects like permissions, rate limits, or error handling (e.g., what happens if ID not found).

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?

Two sentences with no superfluous words: first states purpose, second lists returned fields. Very concise and front-loaded.

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

Completeness3/5

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

Given no output schema, the description partially compensates by listing return fields (versionNo, isLatestVersion, aiGenerated, test steps). However, it does not explain edge cases (e.g., not found, multiple versions) or pagination, leaving some gaps for a complex environment with many sibling tools.

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 only parameter 'id' is well-described in the input schema (100% coverage). The description adds a slight bit of context (example key format) but does not significantly enhance understanding 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 ('Get a test case') and the resource ('by its internal ID or key'). It includes an example key format (FS-TC-31950) and explicitly distinguishes from sibling tools like search_test_cases by indicating a direct lookup.

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

Usage Guidelines3/5

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

The description implies when to use this tool (when you have an ID or key) but does not explicitly mention when not to use it or suggest alternatives. Siblings like search_test_cases are not referenced for contrast.

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/salehrifai42/qmetrymcp'

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