get_profiles
Retrieve a paginated list of test run profiles from the BugBug test automation platform to manage and execute automated testing configurations.
Instructions
Get list of BugBug run profiles
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Page number for pagination | |
| pageSize | No | Number of results per page |
Implementation Reference
- src/tools/profiles.ts:7-60 (handler)Full tool definition including handler function that executes the get_profiles tool logic by calling the BugBug API client and formatting the paginated list of profiles.export const getProfilesTool: Tool = { name: 'get_profiles', title: 'Get list of BugBug run profiles', description: 'Get list of BugBug run profiles', inputSchema: z.object({ page: z.number().optional().describe('Page number for pagination'), pageSize: z.number().optional().describe('Number of results per page'), }).shape, handler: async ({ page, pageSize }) => { try { const response = await bugbugClient.getProfiles(page, pageSize); if (response.status !== 200) { return { content: [ { type: 'text', text: `Error: ${response.status} ${response.statusText}`, }, ], }; } const { count, page: currentPage, results } = response.data; let profilesList = ''; if (results && results.length > 0) { profilesList = results.map((profile: BugBugProfile) => `- **${profile.name}** (ID: ${profile.id})${profile.isDefault ? ' [DEFAULT]' : ''}` ).join('\n'); } else { profilesList = 'No profiles found.'; } return { content: [ { type: 'text', text: `**BugBug Run Profiles** (Page ${currentPage || 1}, Total: ${count || 0}):\n\n${profilesList}`, }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error fetching profiles: ${error instanceof Error ? error.message : 'Unknown error'}`, }, ], }; } } };
- src/tools/profiles.ts:11-14 (schema)Zod input schema defining optional pagination parameters for the get_profiles tool.inputSchema: z.object({ page: z.number().optional().describe('Page number for pagination'), pageSize: z.number().optional().describe('Number of results per page'), }).shape,
- src/tools/index.ts:11-33 (registration)Registration function that imports and registers all tools, including get_profiles from profiles.ts, 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:141-148 (helper)BugBug API client method that makes the HTTP request to fetch paginated profiles, used by the tool handler.async getProfiles(page?: number, pageSize?: number): Promise<ApiResponse<PaginatedResponse<BugBugProfile>>> { const params = new URLSearchParams(); if (page) params.append('page', page.toString()); if (pageSize) params.append('page_size', pageSize.toString()); const query = params.toString() ? `?${params.toString()}` : ''; return this.makeRequest(`/profiles/${query}`); }