Dispatch autonomous testing agent
wopee_dispatch_agentDispatches an autonomous AI agent to execute a test case in a real browser, capturing screenshots and reporting pass or fail with detailed findings.
Instructions
Execute a specific test case by dispatching an autonomous AI agent. The agent opens a real browser, navigates the web app, follows the test case steps, captures screenshots at each step, and reports pass/fail with detailed findings. Prerequisite: test cases must exist in the suite — generate them first with wopee_generate_artifact (type USER_STORIES_WITH_TEST_CASES). Do NOT use this to analyze or crawl an app — use wopee_dispatch_analysis for that. Side effects: creates execution records and screenshots on the Wopee.io platform. Rate limit: 10 seconds between dispatches per project; concurrent calls auto-retry with exponential backoff. On success, returns executed test case results. On failure (invalid suite/test case ID), returns an error message. Use wopee_fetch_executed_test_cases afterward to get full results.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| suiteUuid | Yes | UUID of the suite to dispatch the agent for | |
| analysisIdentifier | Yes | Analysis identifier of the suite to dispatch the agent for | |
| testCases | Yes | Chosen test cases to dispatch the agent for |
Implementation Reference
- The main tool handler that dispatches an autonomous AI agent to execute test cases. Takes suite UUID, analysis identifier, and selected test cases, creates the input payload via factory, runs the GraphQL mutation with retry logic, and returns the executed test case results.
export const wopeeDispatchAgent = { name: ToolName.WOPEE_DISPATCH_AGENT, config: { title: "Dispatch autonomous testing agent", description: "Execute a specific test case by dispatching an autonomous AI agent. The agent opens a real browser, navigates the web app, follows the test case steps, captures screenshots at each step, and reports pass/fail with detailed findings. Prerequisite: test cases must exist in the suite — generate them first with wopee_generate_artifact (type USER_STORIES_WITH_TEST_CASES). Do NOT use this to analyze or crawl an app — use wopee_dispatch_analysis for that. Side effects: creates execution records and screenshots on the Wopee.io platform. Rate limit: 10 seconds between dispatches per project; concurrent calls auto-retry with exponential backoff. On success, returns executed test case results. On failure (invalid suite/test case ID), returns an error message. Use wopee_fetch_executed_test_cases afterward to get full results.", inputSchema: WopeeDispatchAgentInputSchema.shape, }, handler: async (input: WopeeDispatchAgentInput) => { try { const dispatchAgentInput = createDispatchAgentInput(input); const parsedInput = DispatchAgentInputSchema.parse(dispatchAgentInput); const result = await withRetry(() => requestClient<{ dispatchAgent: ExecutedTestCase[] }>(DispatchAgent, { input: parsedInput, }), ); if (!result?.dispatchAgent?.length) return { content: [ { type: "text" as const, text: "Failed to dispatch agent: no dispatch result returned", }, ], }; return { content: [ { type: "text" as const, text: JSON.stringify(result.dispatchAgent, null, 2), }, ], }; } catch (error) { return _parseError(error); } }, }; - Zod validation schemas for the tool. WopeeDispatchAgentInputSchema defines the user-facing input (suiteUuid, analysisIdentifier, testCases). DispatchAgentInputSchema is the internal input that includes projectUuid injected by the factory. SelectedTestCasesSchema validates each test case entry (testCaseId + userStoryId).
export const WopeeDispatchAgentInputSchema = z.object({ suiteUuid: z .string({ description: "UUID of the suite to dispatch the agent for" }) .min(1, "Suite UUID is required"), analysisIdentifier: z .string({ description: "Analysis identifier of the suite to dispatch the agent for", }) .min(1, "Analysis identifier is required"), testCases: z.array(SelectedTestCasesSchema, { description: "Chosen test cases to dispatch the agent for", }), }); export const DispatchAgentInputSchema = z.object({ projectUuid: z.string().min(1, "Project UUID is required"), suiteUuid: z.string().min(1, "Suite UUID is required"), analysisIdentifier: z.string().min(1, "Analysis identifier is required"), testCases: z.array(SelectedTestCasesSchema), }); export type DispatchAgentInput = z.infer<typeof DispatchAgentInputSchema>; export type WopeeDispatchAgentInput = z.infer< typeof WopeeDispatchAgentInputSchema >; - Factory/helper function that takes the user-facing WopeeDispatchAgentInput and enriches it with the project UUID from configuration, producing a DispatchAgentInput ready for the GraphQL mutation.
export const createDispatchAgentInput = ( input: WopeeDispatchAgentInput ): DispatchAgentInput => { const { WOPEE_PROJECT_UUID } = getConfig(); if (!WOPEE_PROJECT_UUID) throw new Error("WOPEE_PROJECT_UUID is not set"); return { projectUuid: WOPEE_PROJECT_UUID, suiteUuid: input.suiteUuid, analysisIdentifier: input.analysisIdentifier, testCases: input.testCases, }; }; - src/tools/index.ts:4-28 (registration)Tool registration: imports wopeeDispatchAgent from its subdirectory and exports it as part of the TOOLS array that registers all available MCP tools.
import { wopeeDispatchAgent } from "./wopee_dispatch_agent/index.js"; import { wopeeDispatchAnalysis } from "./wopee_dispatch_analysis/index.js"; import { wopeeCreateBlankSuite } from "./wopee_create_blank_suite/index.js"; import { wopeeFetchAnalysisSuites } from "./wopee_fetch_analysis_suites/index.js"; import { wopeeFetchExecutedTestCases } from "./wopee_fetch_executed_test_cases/index.js"; import { wopeeSendChatMessage } from "./wopee_send_chat_message/index.js"; import { wopeeReadChatHistory } from "./wopee_read_chat_history/index.js"; import { wopeeCreateGithubIssue } from "./wopee_create_github_issue/index.js"; export const TOOLS = [ wopeeCreateBlankSuite, wopeeFetchAnalysisSuites, wopeeFetchExecutedTestCases, wopeeDispatchAnalysis, wopeeDispatchAgent, wopeeFetchArtifact, wopeeUpdateArtifact, wopeeGenerateArtifact, wopeeSendChatMessage, wopeeReadChatHistory, wopeeCreateGithubIssue, ]; - src/tools/shared/types.ts:7-8 (registration)Enum registration: the tool name 'wopee_dispatch_agent' is defined in the ToolName enum, which is used by the handler to identify itself.
WOPEE_DISPATCH_AGENT = "wopee_dispatch_agent",