Skip to main content
🚀 See how 20+ AI Agents can make your QA faster and smarter. Join 10k+ QAs at global leadership summit! Register Now
No Result Found
Connect & Get help from fellow developers on our Discord community. Ask the CommunityAsk the Community

Retrieve error logs from Test Reporting & Analytics with the MCP server

Use natural language prompts in your AI assistant to instantly fetch error logs from Automate and App Automate sessions for test reporting and analytics.

Use the BrowserStack MCP server to retrieve error logs from your Automate and App Automate sessions directly from your coding assistant (such as GitHub Copilot, Claude, or Cursor). Skip the dashboard and get detailed failure logs for your test sessions with simple prompts.

To use the Test Reporting & Analytics features with the MCP server, ensure your BrowserStack account has the necessary licenses for TRA. Contact BrowserStack support to enable a license for your account.

Streamline test reporting and analytics from your IDE

Use the following tools to streamline test reporting and analytics from your IDE—all through natural language prompts:

1. Retrieve error logs (getFailureLogs)

Use the getFailureLogs tool to retrieve various types of error logs from Automate and App Automate sessions. This tool helps you quickly access logs for debugging and reporting. Prompt Example: Get the error logs from the session ID: “", Build ID: "" of App Automate Test session. ![Screenshot showing the MCP server prompt for retrieving error logs and the corresponding tool invocation in the IDE](/docs/static/img/browserstack-mcp-server/tra-img.webp)

2. Find build ID (getBuildId)

Use the getBuildId tool to find the BrowserStack build ID from a project and build name. This is useful for connecting with insights or RCA tools. Prompt Example: Get the build ID for project Checkout Flow and build release-2025-11-01.

3. Fetch build insights (fetchBuildInsights)

Use the fetchBuildInsights tool to pull BrowserStack Observability (O11y) insights for a build, including unique failures, always-failing tests, flakiness, automation stability, and Quality Gate results. Prompt Example: Fetch build insights for build ID ob_bld_8129 and summarize top risks.

4. Fetch RCA (fetchRCA)

Use the fetchRCA tool to get AI Root Cause Analysis (RCA) for BrowserStack Automate or App Automate sessions, with suggested fixes. Copilot can apply these fixes to help debug failed tests faster. Prompt Example: Fetch RCA for Automate session sess_1a2b3c and generate a PR with the suggested fix.

Tool reference

The following tools are available for retrieving error logs and performing Test Reporting & Analytics:

For a complete list of supported browsers & mobile devices, refer to the BrowserStack TRA supported devices & browsers page.

Example Prompt Description Input Parameters Invoked Tool
Get the error logs from the session ID: “sample-session-id”, Build ID: “sample-build-id” of App Automate Test session. Retrieves various types of error logs from Automate and App Automate sessions for debugging and reporting. • Session ID
• Session Type (Automate or App Automate)
• Build ID (for App Automate)
getFailureLogs
Get the build ID for project Checkout Flow and build release-2025-11-01. Finds the BrowserStack build ID from project + build name. Use this to connect with insights or RCA tools. • Project name
• Build name
getBuildId
Fetch build insights for build ID ob_bld_8129 and summarize top risks. Pulls BrowserStack Observability (O11y) insights for a build: unique failures, always‑failing tests, flakiness, automation stability, Quality Gate result, etc. • Build ID fetchBuildInsights
Fetch RCA for Automate session sess_1a2b3c and generate a PR with the suggested fix. Gets AI Root Cause Analysis (RCA) for BrowserStack Automate or App Automate sessions, with suggested fixes. Copilot can apply these fixes. • Session ID
• Session Type (Automate or App Automate)
fetchRCA
List failed test IDs for build auto_bld_6641. Lists test IDs from a BrowserStack Automate build. You can filter by status (e.g., failed). • Build ID
• Status filter (optional)
listTestIds
Set up App Automate SDK for Java + Appium; run on Pixel 7 (Android 14) and iPhone 15 (iOS 17). Sets up App Automate SDK integration for Appium tests (multiple languages). Not for Espresso/XCUITest bundles. • Language
• Framework
• Device name(s)
• Platform version(s)
setupBrowserStackAppAutomateTests
Run Espresso tests from /tests/checkout.zip on Galaxy S21 and Pixel 6 (Android 12). App: /apps/beta-release.apk under project Checkout Flow. Runs pre‑built native suites—Espresso (Android) or XCUITest (iOS)—by uploading app + tests. Not for Appium/SDK setups. • App path
• Test suite path
• Device name(s)
• Platform version
• Project (optional)
runAppTestsOnBrowserStack

Need help?

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback!

Talk to an Expert
Download Copy Check Circle