Skip to main content
Glama

open_test_result

Opens test results in your browser using a test run ID to view detailed reports from QIT MCP Server testing workflows.

Instructions

Open a test result in the default web browser and return the report URL.

⚠️ QIT CLI not detected. QIT CLI not found. Please install it using one of these methods:

  1. Via Composer (recommended): composer require woocommerce/qit-cli --dev

  2. Set QIT_CLI_PATH environment variable: export QIT_CLI_PATH=/path/to/qit

  3. Ensure 'qit' is available in your system PATH

For more information, visit: https://github.com/woocommerce/qit-cli

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
test_run_idYesTest run ID to open in browser

Implementation Reference

  • The handler function that implements the core logic of the 'open_test_result' tool. It runs the QIT CLI 'open' command, extracts the report URL from the output, and returns a formatted text response.
    handler: async (args: { test_run_id: string }) => {
      const cmdArgs = ["open", args.test_run_id];
      const result = await executeQitCommand(cmdArgs);
    
      // The open command outputs to stderr and may exit with code 1 even on success
      // Extract URL from output (either stdout or stderr)
      const output = result.stdout || result.stderr || "";
      const urlMatch = output.match(/https?:\/\/[^\s]+/);
    
      if (urlMatch) {
        return {
          content: `Report opened in browser.\n\nURL: ${urlMatch[0]}`,
          isError: false,
        };
      }
    
      // If we can't find a URL but there's output, return it
      if (output) {
        return {
          content: output,
          isError: false,
        };
      }
    
      return {
        content: "Report opened in browser.",
        isError: false,
      };
    },
  • Zod schema defining the input parameters for the tool: a required string 'test_run_id'.
    inputSchema: z.object({
      test_run_id: z.string().describe("Test run ID to open in browser"),
    }),
  • Registers the 'open_test_result' tool (contained within testResultsTools) by spreading it into the central allTools object used by the MCP server.
    export const allTools = {
      ...authTools,
      ...testExecutionTools,
      ...testResultsTools,
      ...groupsTools,
      ...environmentTools,
      ...packagesTools,
      ...configTools,
      ...utilitiesTools,
    };
  • src/server.ts:25-38 (registration)
    MCP server handler for listing tools, dynamically generates tool list including 'open_test_result' from allTools with JSON schema conversion.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      // Check if QIT CLI is available
      const cliInfo = detectQitCli();
    
      const tools = Object.entries(allTools).map(([_, tool]) => ({
        name: tool.name,
        description: cliInfo
          ? tool.description
          : `${tool.description}\n\n⚠️ QIT CLI not detected. ${getQitCliNotFoundError()}`,
        inputSchema: zodToJsonSchema(tool.inputSchema),
      }));
    
      return { tools };
    });
  • src/server.ts:41-87 (registration)
    MCP server handler for calling tools, retrieves 'open_test_result' from allTools, validates input with its schema, and invokes its handler.
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      const { name, arguments: args } = request.params;
    
      const tool = allTools[name as ToolName];
    
      if (!tool) {
        return {
          content: [
            {
              type: "text",
              text: `Unknown tool: ${name}`,
            },
          ],
          isError: true,
        };
      }
    
      try {
        // Validate input
        const validatedArgs = tool.inputSchema.parse(args);
    
        // Execute tool
        // eslint-disable-next-line @typescript-eslint/no-explicit-any
        const result = await (tool.handler as (args: any) => Promise<{ content: string; isError: boolean }>)(validatedArgs);
    
        return {
          content: [
            {
              type: "text",
              text: result.content,
            },
          ],
          isError: result.isError,
        };
      } catch (error) {
        const message = error instanceof Error ? error.message : String(error);
        return {
          content: [
            {
              type: "text",
              text: `Error: ${message}`,
            },
          ],
          isError: true,
        };
      }
    });
Behavior2/5

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

With no annotations provided, the description carries full burden. It mentions the tool opens a browser and returns a URL, but doesn't disclose important behavioral traits: whether this is a read-only operation, if it modifies any state, what happens if the browser can't be opened, error conditions, or what format the returned URL takes. The QIT CLI warning is about prerequisites, not tool behavior.

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

Conciseness2/5

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

The description is poorly structured with the core purpose buried after a lengthy warning about QIT CLI. The warning occupies 80% of the text but is about prerequisites, not tool behavior. The actual tool description is just one sentence. This is not appropriately front-loaded and contains excessive prerequisite information that doesn't help the agent understand the tool itself.

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?

For a tool with no annotations and no output schema, the description is incomplete. It doesn't explain what the returned URL looks like, what happens if opening fails, or how this differs from simply retrieving test results. The heavy focus on installation prerequisites doesn't compensate for missing behavioral context. Given the complexity of interacting with browsers and test systems, more complete guidance 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 the single parameter 'test_run_id' well-described in the schema. The description adds no additional parameter information beyond what's in the schema. According to scoring rules, with high schema coverage (>80%), the baseline is 3 even with no param info in 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 ('Open a test result') and resource ('in the default web browser'), and specifies the outcome ('return the report URL'). It distinguishes from siblings like 'get_test_result' by emphasizing the browser opening action rather than just retrieving data. However, it doesn't explicitly contrast with all similar siblings like 'get_test_report'.

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 'get_test_result' or 'get_test_report'. It mentions QIT CLI requirements but doesn't explain the specific use case for opening in browser versus other ways of accessing test results. The only contextual information is about prerequisites, not 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/woocommerce/qit-mcp'

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