Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions src/mcp/tools/apptesting/devices.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { z } from "zod";
import { tool } from "../../tool";
import { google } from "googleapis";
import { toContent } from "../../util";
import { getAccessToken } from "../../../apiv2";

export const get_devices = tool(
"apptesting",
{
name: "get_devices",
description:
"Get available devices that can be used for automated tests using the app testing agent",
inputSchema: z.object({
type: z.enum(["ANDROID"]).describe("The type of device"),
}),
},
async ({ type }) => {
const testing = google.testing("v1");
return toContent(
await testing.testEnvironmentCatalog.get({
oauth_token: await getAccessToken(),
environmentType: type,
}),
);
},
);
3 changes: 2 additions & 1 deletion src/mcp/tools/apptesting/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { ServerTool } from "../../tool";
import { get_devices } from "./devices";
import { check_test, run_tests } from "./tests";

export const apptestingTools: ServerTool[] = [run_tests, check_test];
export const apptestingTools: ServerTool[] = [run_tests, check_test, get_devices];
Loading