Skip to main content
Glama
simplypixi

BugBug MCP Server

by simplypixi

get_test_run

Retrieve detailed results for a specific BugBug test run using its unique identifier to analyze test execution outcomes and performance metrics.

Instructions

Get detailed results of a BugBug test run

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
runIdYesTest run UUID

Implementation Reference

  • The complete tool definition for 'get_test_run', including the handler function that fetches test run details via bugbugClient, generates a summary using createTestRunSummary, handles errors, and returns a content array with text summary and screenshot images.
    export const getTestRunTool: Tool = {
      name: 'get_test_run',
      title: 'Get detailed results of a BugBug test run',
      description: 'Get detailed results of a BugBug test run',
      inputSchema: z.object({
        runId: z.string().describe('Test run UUID'),
      }).shape,
      handler: async ({ runId }) => {
          try {
    
            const response = await bugbugClient.getTestRun(runId);
            
            if (response.status !== 200) {
              return {
                content: [
                  {
                    type: 'text',
                    text: `Error: ${response.status} ${response.statusText}`,
                  },
                ],
              };
            }
    
            const runDetails = await bugbugClient.getTestRun(runId);
            const summary: CallToolResult['content'] = [
              {
                type: 'text',
                text: createTestRunSummary(runDetails.data),
              },
            ];
            const screenshotMessages: CallToolResult['content'] = runDetails.data.screenshots?.map(screenshot => ({
              type: 'image',
              data: screenshot,
              mimeType: 'image/png',
            })) || [];
    
            return {
              content: [...summary, ...screenshotMessages],
            };
          } catch (error) {
            return {
              content: [
                {
                  type: 'text',
                  text: `Error fetching test run: ${error instanceof Error ? error.message : 'Unknown error'}`,
                },
              ],
            };
          }
        },
    };
  • Zod input schema defining the required 'runId' parameter for the tool.
    inputSchema: z.object({
      runId: z.string().describe('Test run UUID'),
    }).shape,
  • The registerAllTools function imports and registers all tools, including 'get_test_run' from testRuns.ts, with the MCP server.
    export function registerAllTools(server: McpServer): void {
      const tools: Record<string, Tool> = {
        ...configTools,
        ...testsTools,
        ...testRunsTools,
        ...suitesTools,
        ...suiteRunsTools,
        ...profilesTools,
        ...advancedTools,
      };
    
      for (const t in tools) {
        server.registerTool(
          tools[t].name,
          {
            description: tools[t].description,
            inputSchema: tools[t].inputSchema,
            annotations: { title: tools[t].title },
          },
          (args: unknown) => tools[t].handler(args as unknown)
        );
      }
    }
  • The bugbugClient.getTestRun method that makes the API request to retrieve test run data.
    async getTestRun(id: string): Promise<ApiResponse<BugBugTestRun>> {
      return this.makeRequest(`/testruns/${id}/`);
    }
  • The createTestRunSummary helper function used to format the test run summary text.
    export const createTestRunSummary = (run: BugBugTestRun) => {
      const failedStepRun = run.stepsRuns?.find(stepRun => ['failed', 'error'].includes(stepRun.status));
    
      const createErrorDetails = () => `
        ${run.errorCode ? `During run "${run.errorCode}" error occured while running step "${failedStepRun?.name}"` : ''};
        ${run.errorMessage ? `Extra error data: ${run.errorMessage}` : ''};
      `;
    
      return `
        Test run "${run.name}" has finished with status "${run.status}".
        ${createErrorDetails()}
    
        <meta>
          <id>${run.id}</id>
          <name>${run.name}</name>
          <status>${run.status}</status>
          <started>${run.started}</started>
          <finished>${run.finished}</finished>
          <duration>${run.duration}</duration>
          <url>${run.webappUrl}</url>
        </meta>
    
        <variables>
          ${run.variables?.map(variable => `<variable>${variable.key}=${variable.value}</variable>`).join('\n')}
        </variables>
    
        <steps>
          ${run.details?.map(step => `
            <step>
              <id>${step.id}</id>
              <name>${step.name}</name>
Behavior3/5

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

Annotations provide a title that matches the description but no behavioral hints (e.g., readOnlyHint, destructiveHint). The description doesn't add behavioral context beyond stating it 'gets' results—it doesn't mention permissions, rate limits, or what 'detailed results' entail (e.g., logs, metrics). With no annotations, the description carries the burden but offers minimal behavioral insight, scoring average.

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, efficient sentence that directly states the tool's purpose without unnecessary words. It's front-loaded with the core action and resource, making it easy to parse quickly, which is ideal for conciseness.

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 the tool has one parameter with full schema coverage and no output schema, the description is minimally adequate. It specifies the resource but lacks details on output format or behavior, which could be important for a 'detailed results' tool. With no annotations to fill gaps, it's complete enough for basic use but leaves room for improvement in 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 'runId' clearly documented as a 'Test run UUID'. The description adds no parameter semantics beyond this, as it doesn't explain format, sourcing, or constraints. Given high schema coverage, the baseline score of 3 is appropriate, as the description doesn't compensate but doesn't need to heavily.

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 verb 'Get' and the resource 'detailed results of a BugBug test run', making the purpose understandable. However, it doesn't explicitly differentiate this tool from sibling tools like 'get_test_run_status' or 'get_test_run_screenshots', which appear to retrieve different aspects of test runs, so it doesn't reach the highest clarity level.

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. With siblings like 'get_test_run_status' (likely for status only) and 'get_test_run_screenshots' (likely for screenshots only), there's no indication that this tool retrieves comprehensive results, leaving the agent to infer usage from tool names alone.

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/simplypixi/bugbug-mcp-server'

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