Skip to main content
Glama
simplypixi

BugBug MCP Server

by simplypixi

get_test_run_screenshots

Retrieve visual evidence from automated test executions by providing a test run identifier to capture screenshots for debugging and verification purposes.

Instructions

Get screenshots from a BugBug test run

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
runIdYesTest run UUID

Implementation Reference

  • Full tool definition including the handler function that fetches and lists screenshots from a test run using the bugbugClient. This is the core implementation of the tool logic.
    export const getTestRunScreenshotsTool: Tool = {
      name: 'get_test_run_screenshots',
      title: 'Get screenshots from a BugBug test run',
      description: 'Get screenshots from a BugBug test run',
      inputSchema: z.object({
        runId: z.string().describe('Test run UUID'),
      }).shape,
      handler: async ({ runId }) => {
          try {
    
            const response = await bugbugClient.getTestRunScreenshots(runId);
            
            if (response.status !== 200) {
              return {
                content: [
                  {
                    type: 'text',
                    text: `Error: ${response.status} ${response.statusText}`,
                  },
                ],
              };
            }
    
            const screenshots = response.data;
            
            let screenshotsList = '';
            if (screenshots.stepsRuns && screenshots.stepsRuns.length > 0) {
              screenshotsList = screenshots.stepsRuns.map((step: BugBugStepDetail) => 
                `- **Step ${step.stepId}:** ${step.screenshots?.[0]?.url || 'No screenshot'}`
              ).join('\n');
            } else {
              screenshotsList = 'No screenshots available';
            }
            
            return {
              content: [
                {
                  type: 'text',
                  text: `**Test Run Screenshots (ID: ${screenshots.id}):**\n\n${screenshotsList}`,
                },
              ],
            };
          } catch (error) {
            return {
              content: [
                {
                  type: 'text',
                  text: `Error fetching test run screenshots: ${error instanceof Error ? error.message : 'Unknown error'}`,
                },
              ],
            };
          }
        }
    };
  • Zod input schema for the tool, requiring a runId string.
    inputSchema: z.object({
      runId: z.string().describe('Test run UUID'),
    }).shape,
  • Registers all tools on the MCP server, including those from testRunsTools (which exports getTestRunScreenshotsTool) by iterating over the tools record and calling server.registerTool.
    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 method called by the tool handler to make the API request for test run screenshots.
    async getTestRunScreenshots(id: string): Promise<ApiResponse<BugBugScreenshotResponse>> {
      return this.makeRequest(`/testruns/${id}/screenshots/`);
    }
Behavior3/5

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

The description adds minimal behavioral context beyond what annotations provide. The annotation 'title' essentially repeats the description, offering no additional behavioral insight. The description doesn't specify what format screenshots are returned in, whether there are pagination considerations, or any rate limits - though with annotations covering basic metadata, this earns a baseline score.

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 extremely concise - a single sentence that directly states the tool's purpose without any unnecessary words or elaboration. It's front-loaded with the essential information and wastes no space on redundant details.

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?

For a single-parameter retrieval tool with good schema coverage but no output schema, the description is minimally adequate. It identifies what resource is being retrieved but doesn't describe the return format, potential limitations, or relationships to other tools. The absence of an output schema means the description should ideally provide more context about what 'screenshots' means in practice.

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?

With 100% schema description coverage, the input schema already fully documents the single 'runId' parameter. The description doesn't add any parameter-specific information beyond what's in the schema, so it earns the baseline score of 3 for adequate but not additive parameter documentation.

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 ('Get') and resource ('screenshots from a BugBug test run'), making the purpose immediately understandable. However, it doesn't differentiate this tool from its sibling 'get_suite_run_screenshots' which appears to serve a similar purpose for suite runs rather than test runs.

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 about when to use this tool versus alternatives. With multiple screenshot-related tools in the sibling list (get_suite_run_screenshots) and other test run tools (get_test_run, get_test_run_status), there's no indication of when this specific screenshot retrieval tool is appropriate versus those other options.

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