Skip to main content
Glama

wait_for_suite_run

Monitors a test suite execution in BugBug by polling for completion status, returning detailed run results when finished. Configure timeout and polling intervals to manage wait duration.

Instructions

Waits until suite run finished, returns full suite run data as result

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pollIntervalSecondsNoPolling interval in seconds (default: 10)
runIdYesSuite run UUID to wait for
timeoutMinutesNoMaximum time to wait in minutes (default: 30)

Implementation Reference

  • The handler function implements polling logic to wait for a suite run to finish by repeatedly calling bugbugClient.getSuiteRun until the status is finished or timeout is reached. Returns text content with status or error.
    handler: async ({ runId, timeoutMinutes, pollIntervalSeconds }) => { try { const timeoutMs = timeoutMinutes * 60 * 1000; const pollIntervalMs = pollIntervalSeconds * 1000; let run = await bugbugClient.getSuiteRun(runId); if (isFinishedRunStatus(run.data.status)) { return { content: [ { type: 'text', text: `Suite run ${run.data.id} completed with status: ${run.data.status}`, }, ], }; } const startTime = Date.now(); while (Date.now() - startTime < timeoutMs) { await new Promise(resolve => setTimeout(resolve, pollIntervalMs)); run = await bugbugClient.getSuiteRun(runId); if (isFinishedRunStatus(run.data.status)) { return { content: [ { type: 'text', text: `Suite run ${run.data.id} completed with status: ${run.data.status}`, }, ], }; } } return { content: [ { type: 'text', text: `Suite run ${runId} did not complete within ${timeoutMinutes} minutes`, }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error waiting for suite run: ${error instanceof Error ? error.message : 'Unknown error'}`, }, ], }; } },
  • Input schema using Zod that validates runId (string, required), timeoutMinutes (number, optional default 30), pollIntervalSeconds (number, optional default 10).
    inputSchema: z.object({ runId: z.string().describe('Suite run UUID to wait for'), timeoutMinutes: z.number().optional().default(30).describe('Maximum time to wait in minutes (default: 30)'), pollIntervalSeconds: z.number().optional().default(10).describe('Polling interval in seconds (default: 10)'), }).shape,
  • Registration function that imports all tool modules including advancedTools containing waitForSuiteRunTool, collects them in a record, and registers each with the MCP server using server.registerTool, wrapping the handler.
    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) ); } }

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