get_suite_run_screenshots
Retrieve screenshots captured during a specific BugBug test suite run to analyze test execution steps and identify issues.
Instructions
Get screenshots from a BugBug suite run
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| runId | Yes | Suite run UUID |
Implementation Reference
- src/tools/suiteRuns.ts:111-168 (handler)The complete tool definition for 'get_suite_run_screenshots', including the handler function that fetches and formats screenshots from a suite run.export const getSuiteRunScreenshotsTool: Tool = { name: 'get_suite_run_screenshots', title: 'Get screenshots from a BugBug suite run', description: 'Get screenshots from a BugBug suite run', inputSchema: z.object({ runId: z.string().describe('Suite run UUID'), }).shape, handler: async ({ runId }) => { try { const response = await bugbugClient.getSuiteRunScreenshots(runId); if (response.status !== 200) { return { content: [ { type: 'text', text: `Error: ${response.status} ${response.statusText}`, }, ], }; } const screenshots = response.data; let screenshotsList = ''; if (screenshots.testsRuns && screenshots.testsRuns.length > 0) { screenshotsList = screenshots.testsRuns.map((testRun: { id: string; name: string; stepsRuns?: BugBugStepDetail[] }) => { const stepScreenshots = testRun.stepsRuns?.map((step: BugBugStepDetail) => ` - Step ${step.stepId}: ${step.screenshots?.[0]?.url || 'No screenshot'}` ).join('\n') || ' No step screenshots'; return ` **Test ${testRun.id}:**\n${stepScreenshots}`; }).join('\n\n'); } else { screenshotsList = 'No screenshots available'; } return { content: [ { type: 'text', text: `**Suite Run Screenshots (ID: ${screenshots.id}):**\n\n${screenshotsList}`, }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error fetching suite run screenshots: ${error instanceof Error ? error.message : 'Unknown error'}`, }, ], }; } } };
- src/tools/index.ts:11-33 (registration)The registerAllTools function registers the get_suite_run_screenshots tool (imported via suiteRunsTools) 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) ); } }
- src/services/bugbugClient.ts:183-185 (helper)Helper method in BugBugApiClient that makes the API request to retrieve screenshots for the given suite run ID.async getSuiteRunScreenshots(id: string): Promise<ApiResponse<BugBugScreenshotResponse>> { return this.makeRequest(`/suiteruns/${id}/screenshots/`); }
- src/tools/suiteRuns.ts:115-117 (schema)Zod input schema for the get_suite_run_screenshots tool, validating the runId parameter.inputSchema: z.object({ runId: z.string().describe('Suite run UUID'), }).shape,