Skip to main content
Glama
simplypixi

BugBug MCP Server

by simplypixi

show_run_from_last_24

Display test and suite execution results from the past 24 hours to monitor recent automation runs and track performance trends.

Instructions

Shows tests/suites runs from last 24 hours

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageSizeNoNumber of results per page (default: 50)
runTypeNoType of runs to show - test, suite, or bothboth

Implementation Reference

  • The asynchronous handler function that fetches test and suite runs from the last 24 hours using the BugBug client, filters by type, summarizes them, and returns a formatted text response with summary and list of recent runs.
    handler: async ({ runType = 'both', pageSize = 50 }) => {
      try {
        const now = new Date();
        const yesterday = new Date(now.getTime() - 24 * 60 * 60 * 1000);
        const startedAfter = yesterday.toISOString();
    
        let testRuns: BugBugTestRun[] = [];
        let suiteRuns: BugBugSuiteRun[] = [];
    
        // Fetch test runs if requested
        if (runType === 'test') {
          const testRunsResponse = await bugbugClient.getTestRuns(1, pageSize, '-started', startedAfter);
          if (testRunsResponse.status === 200 && testRunsResponse.data.results) {
            testRuns = testRunsResponse.data.results;
          }
        }
    
        // Fetch suite runs if requested (we'll need to get all recent suite runs and filter)
        if (runType === 'suite') {
          // Note: BugBug API might not have a direct suite runs endpoint with date filtering
          // We'll try to get recent suite runs by checking individual suites
          // This is a limitation that might need API enhancement
          try {
            const suitesResponse = await bugbugClient.getSuites(1, 20, undefined, '-created');
            if (suitesResponse.status === 200 && suitesResponse.data.results) {
              // For each suite, we could check recent runs, but this would be expensive
              // For now, we'll note this limitation
              suiteRuns = [];
            }
          } catch (suiteError) {
            // Suite runs fetching failed, continue with test runs only
          }
        }
    
        // Combine and sort results
        const allRuns = [
          ...testRuns.map((run: BugBugTestRun) => ({ ...run, type: 'test' as const })),
          ...suiteRuns.map((run: BugBugSuiteRun) => ({ ...run, type: 'suite' as const }))
        ].sort((a, b) => new Date(b.started || b.modified || 0).getTime() - new Date(a.started || a.modified || 0).getTime());
    
        if (allRuns.length === 0) {
          return {
            content: [
              {
                type: 'text',
                text: `**No runs found in the last 24 hours**\n\nSearched for: ${runType} runs\nTime range: ${yesterday.toISOString()} to ${now.toISOString()}\n\n*Note: Suite run history might have limited API support.*`,
              },
            ],
          };
        }
    
        const runsList = allRuns.slice(0, pageSize).map((run: (BugBugTestRun | BugBugSuiteRun) & { type: 'test' | 'suite' }) => {
          const startTime = run.started || run.modified || 'N/A';
          const duration = run.duration || 'N/A';
          const status = run.status || 'Unknown';
          const runTypeLabel = run.type === 'test' ? '๐Ÿงช Test' : '๐Ÿ“ฆ Suite';
          const errorInfo = run.errorCode && run.errorCode !== 'None' ? ` - Error: ${run.errorCode}` : '';
          
          return `- **${runTypeLabel}** ${run.name || run.id} - **${status}** (${startTime}) - Duration: ${duration}${errorInfo}`;
        }).join('\n');
    
        const summary = {
          total: allRuns.length,
          completed: allRuns.filter(r => r.status?.toLowerCase() === 'completed').length,
          failed: allRuns.filter(r => r.status?.toLowerCase() === 'failed').length,
          running: allRuns.filter(r => ['running', 'queued'].includes(r.status?.toLowerCase())).length,
        };
    
        return {
          content: [
            {
              type: 'text',
              text: `**Runs from Last 24 Hours** (${runType} runs)\n\n**Summary:**\n- Total: ${summary.total}\n- Completed: ${summary.completed}\n- Failed: ${summary.failed}\n- Running/Queued: ${summary.running}\n\n**Recent Runs:**\n${runsList}\n\n*Showing up to ${pageSize} most recent runs*`,
            },
          ],
        };
    
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: `Error fetching runs from last 24 hours: ${error instanceof Error ? error.message : 'Unknown error'}`,
            },
          ],
        };
      }
    },
  • Zod schema defining the input parameters for the tool: runType (enum: 'test', 'suite', 'both', default 'both') and pageSize (number, default 50).
    inputSchema: z.object({
      runType: z.enum(['test', 'suite', 'both']).optional().default('both').describe('Type of runs to show - test, suite, or both'),
      pageSize: z.number().optional().default(50).describe('Number of results per page (default: 50)'),
    }).shape,
  • The registerAllTools function imports advancedTools (which includes showRunFromLast24Tool) and registers all tools with the MCP server by spreading the tool objects and calling server.registerTool for each in a loop, using the tool's name, description, inputSchema, title, and 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)
        );
      }
    }
Behavior3/5

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

Annotations provide a title but no behavioral hints (readOnly/destructive). The description adds the key constraint 'from last 24 hours' which is valuable behavioral context not in the schema. However, it doesn't mention pagination behavior, rate limits, authentication needs, or what 'shows' actually returns.

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 states exactly what the tool does with zero wasted words. It's appropriately sized and front-loaded with the core functionality.

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 read operation with good schema coverage but no output schema, the description provides the essential time constraint but lacks information about return format, pagination behavior, or error conditions. It's minimally adequate but leaves gaps an agent would need to infer.

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 both parameters well-documented in the schema. The description doesn't add any meaningful parameter semantics beyond what's already in the schema, so it meets the baseline for high schema coverage.

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 'shows' and the resource 'tests/suites runs from last 24 hours', providing specific scope. However, it doesn't explicitly differentiate from sibling tools like 'get_test_runs' or 'get_suite_run' that might have different timeframes or filtering capabilities.

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?

No guidance is provided on when to use this tool versus alternatives. With multiple sibling tools for retrieving runs (e.g., get_test_runs, get_suite_run, get_test_run), the description doesn't indicate why one would choose this time-constrained view over 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