Agent Integration Guide
Integrate AI agents with ContextQA MCP tools — tool call ordering, async execution, debugging, and multi-step workflow orchestration.
Core Workflow Pattern
1. create_test_case(url, task_description, name)
↓ returns test_case_id
2. execute_test_case(test_case_id)
↓ returns execution portal URL + number_of_executions
3. get_execution_status(test_case_id, number_of_executions)
↓ poll every 15-30 seconds until PASSED or FAILED
4. (if PASSED)
→ Report success, retrieve results for evidence
5. (if FAILED)
→ get_test_case_results(execution_id)
→ get_root_cause(execution_id)
→ Decide: fix_and_apply, create_defect_ticket, or update testExample: Simple Test Creation and Execution
Decision Tree: Choosing the Right Tool
Creating Tests
Goal
Tool to Use
Finding Existing Tests
Goal
Tool to Use
Running Tests
Goal
Tool to Use
Analyzing Results
Goal
Tool to Use
Handling Failures
Goal
Tool to Use
Migrating from Other Frameworks
Goal
Tool to Use
Polling for Execution Completion
Multi-Step Orchestration: The Bug Fix Loop
Step 1: Retrieve the Failure Details
Step 2: Get AI Root Cause Analysis
Step 3: Create a Defect Ticket
Step 4: Check for Self-Healing Suggestions
Step 5: Apply the Healing
Step 6: Re-Run to Verify
Deep Telemetry for Debugging
Screenshots per Step
Network Traffic
Browser Console
Playwright Trace
AI Reasoning
Generating Tests Automatically in CI
Migrating an Existing Test Suite
Step 1: Analyze the Repository
Step 2: Migrate
Step 3: Verify
Custom Agents and Knowledge Bases
Creating a Custom Agent
Creating a Knowledge Base
Error Patterns and Recovery
Tool Returns an Empty Result
Execution Stuck in RUNNING State
Authentication Error on Every Call
Test Generation Returns No Steps
Next Steps
Last updated
Was this helpful?
