canonical: https://jentic.com/apis/googleapis.com/toolresults

# Google Cloud Tool Results API

Cloud Tool Results stores and serves the detailed output of Firebase Test Lab runs and other Google developer-tooling executions. Results are organised hierarchically as histories (one per app), executions (one per matrix run), steps (one per device-execution combination), and per-step artefacts including logcat, screenshots, video, performance metrics, and test-case results. The API is the backbone behind the Firebase Test Lab UI in the Google Cloud Console and is what teams call when they need programmatic access to deep test diagnostics.

## For AI agents

Read detailed Firebase Test Lab results - histories, executions, steps, screenshots, videos, performance metrics, and per-test-case outcomes.

## Scope

Does not submit tests, control devices, or build artefacts - use for reading Firebase Test Lab execution results, steps, and artefacts only.

## Capabilities

- Query histories grouped by app package and version
- List executions and individual step results within an execution
- Retrieve per-step performance metrics, screenshots, and video clusters
- Inspect individual test-case outcomes (passed, failed, flaky, skipped)
- Read environment details for each device run (model, OS, locale)
- List test artefacts including logcat, video, and crash dumps for a step

## Use cases

### Failure Triage Dashboard

QA leads build a triage dashboard that pulls failing steps across recent executions, ranks them by frequency, and groups them by device model and OS version. The dashboard polls /toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions for new runs and drills into steps and test-cases to extract failure reasons. Engineers see device-specific patterns (e.g. 'Galaxy S22 + Android 14 fails 80% of the time') without opening the Firebase Console.

Example prompt: List executions for a history, then for each execution iterate steps and call the test-cases endpoint to count failed cases keyed by device model.

### Screenshot Diff for Visual Regressions

Mobile teams capture screenshots from each Test Lab run via Robo crawl or instrumentation, retrieve them through Tool Results, and feed them into a visual-diff pipeline. The screenshot clusters endpoint groups perceptually similar images, making it straightforward to identify new UI states introduced by a release and flag visual regressions.

Example prompt: GET /toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/clusters and download each screenshot URL for diffing.

### Performance Trend Tracking

Performance teams pull per-step performance metrics from each Test Lab execution and chart trends over time. Metrics like CPU usage, memory, and frame timing are exposed under the perfMetricsSummary and perfSampleSeries endpoints. Sudden regressions in startup time or frame drop rate are flagged before the build promotes to production.

Example prompt: GET /toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}/perfMetricsSummary and store the cpu and memory series for trend analysis.

### Agent-Generated Test Failure Report via Jentic

A release agent monitors Test Lab and produces a written summary of any new run. Through Jentic the agent calls Tool Results to list failed steps, fetch logcat, and retrieve representative screenshots, then composes a release note attached to the build. Jentic isolates the OAuth credential across the multi-step retrieval.

Example prompt: Through Jentic, search 'list firebase test lab steps', load the steps endpoint, iterate failing steps and pull thumbnails plus logcat URIs to compose a Markdown summary.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | /toolresults/v1beta3/projects/{projectId}/histories | List histories for a project |
| GET | /toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions | List executions in a history |
| GET | /toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId} | Retrieve a single execution |
| GET | /toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/clusters | List screenshot clusters from an execution |
| GET | /toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/clusters/{clusterId} | Retrieve a single screenshot cluster |

## Key resources

- **History** — Per-app container grouping all executions for an app package
- **Execution** — A single Test Lab matrix run or other tool execution
- **Step** — A single device-execution combination within an execution
- **TestCase** — Individual test-case outcome within a step (passed, failed, flaky)
- **Cluster** — Group of perceptually similar screenshots from a Robo crawl
- **PerfMetrics** — CPU, memory, network, and frame metrics captured during a step

## Why Jentic

- **Setup:** Wiring the Cloud Tool Results API by hand means setting up a Google service account, granting the cloud-platform scope, chaining the history, execution, step, and cluster path parameters, and paging through results yourself. Through Jentic you install once, import the Cloud Tool Results API from the API Directory, store the service-account credential once, and your agent calls it.
- **Permission scoping:** Cloud Tool Results puts the project and history in the URL path (/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions), so a rule can pin your agent to one project: it can read executions, steps, and clusters there and nothing else. The operations here are read-only, so the agent only fetches results and never mutates the test data.
- **Credential handling:** Your Cloud Tool Results service-account credential is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'get firebase test lab results' or 'list test execution steps', and Jentic returns the matching Tool Results v1beta3 operation with its path-template input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Cloud Testing API** — Submits the test matrices whose results Tool Results then exposes
- **Firebase Management API** — Manage the Firebase project that owns the Test Lab results history
- **Google Cloud Storage API** — Underlying object store holding test artefacts referenced by Tool Results

## FAQ

### What authentication does the Cloud Tool Results API use?

OAuth 2.0 with the cloud-platform scope is required for read access. CI integrations typically use service-account credentials that have the testlab.viewer role on the project. Through Jentic, the service-account JSON is held in the encrypted vault and short-lived tokens are minted for each call.

### Can I retrieve screenshots from a Test Lab run with the Cloud Tool Results API?

Yes. Screenshots from Robo crawl runs are exposed as clusters under /toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/clusters. Each cluster groups perceptually similar screenshots and exposes thumbnails plus full-resolution images stored in Cloud Storage.

### What are the rate limits for the Cloud Tool Results API?

Tool Results enforces standard Google Cloud per-project read quotas, generally allowing several hundred reads per minute per project. Polling executions for completion should use the Cloud Testing API state field rather than tight loops over Tool Results endpoints. Back off on 429 responses with exponential delay.

### How do I find failing test cases through Jentic?

Search Jentic for 'list firebase test lab steps', load the steps endpoint, then for each step call the test-cases sub-resource and filter where outcome.summary equals FAILURE. Jentic returns the parsed JSON so the agent can summarise without parsing the URL hierarchy by hand. Get started with Jentic One, the self-hosted execution layer.

### Does the Cloud Tool Results API expose logcat and video?

Yes. Each step has a list of test artefacts (testIssues, outputs) that include logcat, video files, and crash logs as Cloud Storage URIs. The artefacts are served from a project-scoped GCS bucket and require the same project credentials to download.

### Is the Cloud Tool Results API free?

Yes, the API itself is free. Storage of the test artefacts (videos, logs, screenshots) is billed at Cloud Storage rates against the Test Lab results bucket; older results can be deleted via lifecycle rules to manage cost.

### Can I limit what my agent is allowed to do with the Cloud Tool Results API?

Yes. Because Jentic One is self-hosted, you write the rules that decide which operations and credentials your agent may use. The Cloud Tool Results API puts the project and history in the URL path, so you can pin the agent to a single project and let it read only executions, steps, and screenshot clusters there and nothing else. Every operation here is read-only, so the agent can fetch test results but can never mutate or delete the underlying test data.
