Skip to main content
Glama

get_tests

Retrieve and filter BugBug test automation cases with pagination, search queries, and sorting options to manage test suites effectively.

Instructions

Get list of BugBug tests

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
orderingNoSort order
pageNoPage number for pagination
pageSizeNoNumber of results per page
queryNoSearch query for test names

Implementation Reference

  • Handler function that fetches tests using bugbugClient.getTests, processes the response, and returns formatted markdown list of tests.
    handler: async ({ page, pageSize, query, ordering }) => { try { const response = await bugbugClient.getTests(page, pageSize, query, ordering); if (response.status !== 200) { return { content: [ { type: 'text', text: `Error: ${response.status} ${response.statusText}`, }, ], }; } const { count, page: currentPage, results } = response.data; let testsList = ''; if (results && results.length > 0) { testsList = results.map((test: BugBugTest) => `- **${test.name}** (ID: ${test.id}) - Active: ${test.isActive ? 'Yes' : 'No'}${test.isRecording ? ' [RECORDING]' : ''}` ).join('\n'); } else { testsList = 'No tests found.'; } return { content: [ { type: 'text', text: `**BugBug Tests** (Page ${currentPage || 1}, Total: ${count || 0}):\n\n${testsList}`, }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error fetching tests: ${error instanceof Error ? error.message : 'Unknown error'}`, }, ], }; } }
  • Input schema using Zod for validating parameters: page, pageSize, query, ordering.
    inputSchema: z.object({ page: z.number().optional().describe('Page number for pagination'), pageSize: z.number().optional().describe('Number of results per page'), query: z.string().optional().describe('Search query for test names'), ordering: z.enum(['name', '-name', 'created', '-created', 'last_result', '-last_result']).optional().describe('Sort order'), }).shape,
  • Registration of all tools, including getTestsTool (imported as testsTools), by spreading into a record and registering each 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) ); } }
  • BugBug API client method to retrieve paginated list of tests, called by the tool handler.
    async getTests(page?: number, pageSize?: number, query?: string, ordering?: string): Promise<ApiResponse<PaginatedResponse<BugBugTest>>> { const params = new URLSearchParams(); if (page) params.append('page', page.toString()); if (pageSize) params.append('page_size', pageSize.toString()); if (query) params.append('query', query); if (ordering) params.append('ordering', ordering); const queryString = params.toString() ? `?${params.toString()}` : ''; return this.makeRequest(`/tests/${queryString}`); }

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