API Reference

Complete reference for all InSite tools across multiple functional categories. All tools follow the MCP (Model Context Protocol) specification for seamless integration.

Page Control

Core page navigation, browser history management, and lifecycle control (6 tools)

load_page

Navigate to a URL and wait for page load completion with configurable wait conditions.

Parameters

  • url (string, required) - Target URL to navigate to
  • waitUntil (string, optional) - Wait condition: "load", "domcontentloaded", "networkidle", "commit" (default: "domcontentloaded")

Example

{
  "name": "load_page",
  "arguments": {
    "url": "https://example.com",
    "waitUntil": "networkidle"
  }
}

Response

{
  "success": true,
  "data": {
    "url": "https://example.com",
    "title": "Example Domain",
    "loadTime": 1250
  }
}

go_back

Navigate backward in browser history with timeout control.

Parameters

  • timeout (number, optional) - Timeout in milliseconds (default: 30000)
  • waitUntil (string, optional) - Wait condition (default: "load")

Example

{
  "name": "go_back",
  "arguments": {
    "timeout": 10000
  }
}

go_forward

Navigate forward in browser history with timeout control.

Parameters

  • timeout (number, optional) - Timeout in milliseconds (default: 30000)
  • waitUntil (string, optional) - Wait condition (default: "load")

reload_page

Reload the current page with optional cache control and wait conditions.

Parameters

  • ignoreCache (boolean, optional) - Hard refresh ignoring cache (default: false)
  • timeout (number, optional) - Timeout in milliseconds (default: 30000)
  • waitUntil (string, optional) - Wait condition (default: "load")

get_current_url

Retrieve the current page URL including any fragments or query parameters.

Parameters

None

Response

{
  "success": true,
  "data": {
    "url": "https://example.com/page?param=value#section"
  }
}

close_browser

Close the browser instance and cleanup all associated resources.

Parameters

None

Notes

Always call this tool when finished to prevent memory leaks in long-running processes.

Element Interaction

User interaction simulation and element manipulation capabilities (5 tools)

click_element

Click elements using CSS selectors with timeout and actionability checks.

Parameters

  • selector (string, required) - CSS selector for target element
  • timeout (number, optional) - Operation timeout in milliseconds (default: 30000)

Example

{
  "name": "click_element",
  "arguments": {
    "selector": "button#submit",
    "timeout": 10000
  }
}

Use Cases

Form submissions, navigation buttons, modal triggers, dropdown selections

type_text

Type text into input elements with realistic timing and optional clearing.

Parameters

  • selector (string, required) - CSS selector for input element
  • text (string, required) - Text to type
  • delay (number, optional) - Keystroke delay in milliseconds (default: 0)
  • clear (boolean, optional) - Clear existing text first (default: true)
  • timeout (number, optional) - Operation timeout (default: 30000)

Example

{
  "name": "type_text",
  "arguments": {
    "selector": "input[name='username']",
    "text": "john.doe@example.com",
    "delay": 50,
    "clear": true
  }
}

hover_element

Trigger hover effects on elements for dropdown menus and interactive components.

Parameters

  • selector (string, required) - CSS selector for target element
  • timeout (number, optional) - Operation timeout (default: 30000)
  • force (boolean, optional) - Bypass actionability checks (default: false)

Use Cases

Dropdown menu activation, tooltip display, hover state testing

scroll_page

Scroll the page or specific elements in any direction with pixel precision.

Parameters

  • direction (string, optional) - "up", "down", "left", "right" (default: "down")
  • amount (number, optional) - Scroll distance in pixels (default: 500)
  • selector (string, optional) - Element selector to scroll (defaults to page)

Example

{
  "name": "scroll_page",
  "arguments": {
    "direction": "down",
    "amount": 1000,
    "selector": ".scrollable-container"
  }
}

press_key

Press keyboard keys and key combinations with optional element focus.

Parameters

  • key (string, required) - Key to press (e.g., "Enter", "Tab", "Control+a")
  • selector (string, optional) - Element to focus before key press
  • timeout (number, optional) - Operation timeout (default: 30000)

Example

{
  "name": "press_key",
  "arguments": {
    "key": "Control+a",
    "selector": "textarea#content"
  }
}

Supported Keys

Enter, Tab, Escape, ArrowUp/Down/Left/Right, Space, Control+[key], Alt+[key], Shift+[key]

Content Extraction

DOM analysis, page content extraction, and visual capture capabilities (4 tools)

get_dom

Extract page DOM structure and content with optional CSS selector filtering.

Parameters

  • selector (string, optional) - CSS selector to filter DOM content

Example

{
  "name": "get_dom",
  "arguments": {
    "selector": ".main-content"
  }
}

Response

{
  "success": true,
  "data": {
    "html": "<div class='main-content'>...</div>",
    "elementCount": 42
  }
}

get_page_title

Retrieve the current page title from the document head.

Parameters

None

Response

{
  "success": true,
  "data": {
    "title": "Example Page - My Website"
  }
}

screenshot

Capture page screenshots with quality control and full-page support.

Parameters

  • fullPage (boolean, optional) - Capture full scrollable page (default: true)
  • quality (number, optional) - JPEG quality 0-100 (PNG ignores this)

Example

{
  "name": "screenshot",
  "arguments": {
    "fullPage": true,
    "quality": 90
  }
}

Response

{
  "success": true,
  "data": {
    "screenshot": "base64-encoded-image-data",
    "format": "png",
    "width": 1920,
    "height": 1080
  }
}

get_viewport_info

Get current viewport dimensions and device pixel ratio information.

Parameters

None

Response

{
  "success": true,
  "data": {
    "width": 1280,
    "height": 720,
    "devicePixelRatio": 2.0
  }
}

JavaScript Execution

JavaScript code execution and dynamic analysis capabilities (3 tools)

evaluate_js

Execute JavaScript code in the page context with return value capture.

Parameters

  • code (string, required) - JavaScript code to execute
  • timeout (number, optional) - Execution timeout in milliseconds (default: 30000)

Example

{
  "name": "evaluate_js",
  "arguments": {
    "code": "document.querySelectorAll('a').length"
  }
}

Response

{
  "success": true,
  "data": {
    "result": 25,
    "type": "number"
  }
}

evaluate_js_on_element

Execute JavaScript code on a specific element with element context.

Parameters

  • selector (string, required) - CSS selector for target element
  • code (string, required) - JavaScript code to execute (element available as "element" variable)
  • timeout (number, optional) - Execution timeout (default: 30000)

Example

{
  "name": "evaluate_js_on_element",
  "arguments": {
    "selector": "button#submit",
    "code": "element.disabled = false; return element.textContent;"
  }
}

get_element_info

Get comprehensive information about elements using JavaScript inspection.

Parameters

  • selector (string, required) - CSS selector for target element
  • timeout (number, optional) - Operation timeout (default: 30000)

Response

{
  "success": true,
  "data": {
    "tagName": "BUTTON",
    "id": "submit",
    "className": "btn btn-primary",
    "textContent": "Submit Form",
    "attributes": { "type": "submit", "disabled": "false" },
    "boundingBox": { "x": 100, "y": 200, "width": 80, "height": 32 }
  }
}

Synchronization

Wait conditions and timing control for dynamic content and navigation (2 tools)

wait_for_element

Wait for elements to reach specific states before proceeding with automation.

Parameters

  • selector (string, required) - CSS selector for target element
  • state (string, optional) - "visible", "hidden", "attached", "detached" (default: "visible")
  • timeout (number, optional) - Wait timeout in milliseconds (default: 30000)

Example

{
  "name": "wait_for_element",
  "arguments": {
    "selector": ".loading-spinner",
    "state": "hidden",
    "timeout": 10000
  }
}

Use Cases

Waiting for dynamic content to load, modal animations to complete, AJAX responses

wait_for_navigation

Wait for page navigation completion with configurable wait conditions.

Parameters

  • url (string, optional) - URL pattern to wait for
  • timeout (number, optional) - Wait timeout (default: 30000)
  • waitUntil (string, optional) - Wait condition (default: "load")

Example

{
  "name": "wait_for_navigation",
  "arguments": {
    "url": "**/dashboard",
    "waitUntil": "networkidle"
  }
}

Console & Network

Browser console monitoring and network request tracking capabilities (4 tools)

get_console_logs

Retrieve browser console messages with level filtering and pagination.

Parameters

  • level (string, optional) - Filter by level: "log", "info", "warn", "error", "debug"
  • limit (number, optional) - Maximum number of logs to return (default: 100)

Example

{
  "name": "get_console_logs",
  "arguments": {
    "level": "error",
    "limit": 50
  }
}

Response

{
  "success": true,
  "data": {
    "logs": [
      {
        "level": "error",
        "message": "TypeError: Cannot read property 'value' of null",
        "timestamp": "2025-08-01T10:30:00.000Z",
        "url": "https://example.com/script.js",
        "lineNumber": 42
      }
    ],
    "totalCount": 3
  }
}

clear_console_logs

Clear stored console logs to start fresh monitoring.

Parameters

None

get_network_logs

Retrieve network request logs with comprehensive filtering options.

Parameters

  • method (string, optional) - Filter by HTTP method: "GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS", "HEAD"
  • status (number, optional) - Filter by status code
  • url_pattern (string, optional) - Filter by URL pattern (regex)
  • limit (number, optional) - Maximum number of requests to return (default: 100)

Example

{
  "name": "get_network_logs",
  "arguments": {
    "method": "POST",
    "status": 404,
    "url_pattern": ".*api.*"
  }
}

Response

{
  "success": true,
  "data": {
    "requests": [
      {
        "method": "POST",
        "url": "https://api.example.com/users",
        "status": 404,
        "statusText": "Not Found",
        "responseTime": 250,
        "requestHeaders": { "Content-Type": "application/json" },
        "responseHeaders": { "Content-Length": "25" }
      }
    ],
    "totalCount": 1
  }
}

clear_network_logs

Clear stored network request logs for fresh monitoring sessions.

Parameters

None

Browser Configuration

Browser settings and environment configuration tools (3 tools)

set_viewport_size

Configure browser viewport dimensions for responsive testing.

Parameters

  • width (number, required) - Viewport width in pixels (100-4096)
  • height (number, required) - Viewport height in pixels (100-4096)

Example

{
  "name": "set_viewport_size",
  "arguments": {
    "width": 1920,
    "height": 1080
  }
}

set_user_agent

Set custom user agent string for browser identity simulation.

Parameters

  • userAgent (string, required) - User agent string to set

Example

{
  "name": "set_user_agent",
  "arguments": {
    "userAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 14_6 like Mac OS X) AppleWebKit/605.1.15"
  }
}

set_geolocation

Configure geolocation coordinates for location-based testing.

Parameters

  • latitude (number, required) - Latitude coordinate (-90 to 90)
  • longitude (number, required) - Longitude coordinate (-180 to 180)
  • accuracy (number, optional) - Location accuracy in meters (default: 100)

Example

{
  "name": "set_geolocation",
  "arguments": {
    "latitude": 37.7749,
    "longitude": -122.4194,
    "accuracy": 50
  }
}

Multi-Browser

Browser engine management and cross-browser automation (3 tools)

switch_browser

Switch between different browser engines for cross-browser testing.

Parameters

  • engine (string, required) - Browser engine: "chromium", "firefox", "webkit"

Example

{
  "name": "switch_browser",
  "arguments": {
    "engine": "firefox"
  }
}

Response

{
  "success": true,
  "data": {
    "previousEngine": "chromium",
    "currentEngine": "firefox",
    "version": "118.0.1"
  }
}

get_browser_info

Get comprehensive information about the current browser engine and capabilities.

Parameters

None

Response

{
  "success": true,
  "data": {
    "engine": "chromium",
    "version": "119.0.6045.105",
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)...",
    "viewport": { "width": 1280, "height": 720 },
    "capabilities": ["headless", "screenshots", "pdf"]
  }
}

list_available_browsers

List all available browser engines with version information.

Parameters

None

Response

{
  "success": true,
  "data": {
    "browsers": [
      { "engine": "chromium", "version": "119.0.6045.105", "available": true },
      { "engine": "firefox", "version": "118.0.1", "available": true },
      { "engine": "webkit", "version": "17.0", "available": true }
    ]
  }
}

Debugging

Advanced debugging tools for element inspection and performance analysis (4 tools)

highlight_element

Visually highlight elements on the page for debugging workflows.

Parameters

  • selector (string, required) - CSS selector for element(s) to highlight
  • style (object, optional) - Highlight style configuration
  • duration (number, optional) - Highlight duration in milliseconds (default: 3000, 0 for permanent)
  • showInfo (boolean, optional) - Show element information tooltip (default: true)
  • timeout (number, optional) - Operation timeout (default: 30000)

Example

{
  "name": "highlight_element",
  "arguments": {
    "selector": "button.submit",
    "style": {
      "border": "3px solid red",
      "backgroundColor": "rgba(255,0,0,0.1)"
    },
    "duration": 5000
  }
}

trace_execution

Enable detailed execution tracing for debugging browser operations.

Parameters

  • enabled (boolean, optional) - Enable or disable tracing (default: true)
  • options (object, optional) - Tracing configuration options
  • path (string, optional) - Path to save trace files

Example

{
  "name": "trace_execution",
  "arguments": {
    "enabled": true,
    "options": {
      "screenshots": true,
      "snapshots": true,
      "network": true
    }
  }
}

capture_performance_timeline

Capture detailed browser performance timeline data for optimization analysis.

Parameters

  • categories (array, optional) - Performance categories: "navigation", "resource", "measure", "mark", "paint", "layout", "longtask", "element"
  • duration (number, optional) - Capture duration in milliseconds (default: 0 for current state)
  • includeMetrics (boolean, optional) - Include Web Vitals metrics (default: true)
  • format (string, optional) - Output format: "json", "timeline", "summary" (default: "json")

Example

{
  "name": "capture_performance_timeline",
  "arguments": {
    "categories": ["navigation", "paint", "layout"],
    "includeMetrics": true,
    "format": "summary"
  }
}

debug_mode

Enable or disable comprehensive debugging mode with enhanced logging.

Parameters

  • enabled (boolean, required) - Enable or disable debug mode
  • level (string, optional) - Debug logging level: "verbose", "info", "warn", "error" (default: "info")
  • features (object, optional) - Debug features to enable
  • outputPath (string, optional) - Path for debug output files

Example

{
  "name": "debug_mode",
  "arguments": {
    "enabled": true,
    "level": "verbose",
    "features": {
      "consoleLogging": true,
      "networkLogging": true,
      "performanceMonitoring": true
    }
  }
}

Security

Security validation, CSP handling, and certificate management tools (3 tools)

handle_csp

Configure Content Security Policy handling and compliance checking.

Parameters

  • action (string, required) - CSP action: "bypass", "enforce", "report", "check" (default: "check")
  • policies (array, optional) - CSP policies to check or enforce
  • bypassUnsafe (boolean, optional) - Allow bypassing unsafe CSP directives (default: false)
  • reportOnly (boolean, optional) - Enable CSP report-only mode (default: false)
  • violationCallback (string, optional) - JavaScript callback for CSP violations

Example

{
  "name": "handle_csp",
  "arguments": {
    "action": "check",
    "policies": [
      "default-src 'self'",
      "script-src 'self' 'unsafe-inline'"
    ]
  }
}

manage_certificates

Certificate validation and custom certificate handling for HTTPS sites.

Parameters

  • action (string, required) - Certificate action: "validate", "ignore", "add_trusted", "check_chain", "get_info" (default: "validate")
  • url (string, optional) - URL to check certificate for
  • certificatePath (string, optional) - Path to certificate file
  • ignoreHTTPSErrors (boolean, optional) - Ignore HTTPS certificate errors (default: false)
  • checkExpiry (boolean, optional) - Check certificate expiry date (default: true)
  • validateChain (boolean, optional) - Validate certificate chain (default: true)

Example

{
  "name": "manage_certificates",
  "arguments": {
    "action": "validate",
    "url": "https://example.com",
    "checkExpiry": true
  }
}

validate_security

Comprehensive security validation and vulnerability scanning for web pages.

Parameters

  • checks (array, optional) - Security checks: "https_usage", "mixed_content", "insecure_forms", "csp_presence", "hsts_headers", "xss_protection", "clickjacking_protection", "content_type_options", "referrer_policy", "permissions_policy"
  • level (string, optional) - Security validation level: "basic", "intermediate", "advanced" (default: "intermediate")
  • includeHeaders (boolean, optional) - Include security header analysis (default: true)
  • scanContent (boolean, optional) - Scan page content for security issues (default: true)
  • reportFormat (string, optional) - Report format: "summary", "detailed", "json" (default: "detailed")

Example

{
  "name": "validate_security",
  "arguments": {
    "checks": ["https_usage", "csp_presence", "hsts_headers"],
    "level": "advanced",
    "reportFormat": "detailed"
  }
}

Monitoring

Usage analytics, error tracking, performance monitoring, and session analysis (4 tools)

usage_analytics

Track and report browser automation usage patterns and statistics.

Parameters

  • action (string, required) - Analytics action: "start_tracking", "stop_tracking", "get_report", "reset_data", "configure" (default: "get_report")
  • trackingConfig (object, optional) - Configuration for usage tracking
  • reportFormat (string, optional) - Report format: "summary", "detailed", "json", "csv" (default: "summary")
  • timeRange (object, optional) - Time range for analytics report

Example

{
  "name": "usage_analytics",
  "arguments": {
    "action": "get_report",
    "reportFormat": "detailed",
    "timeRange": { "preset": "last_week" }
  }
}

error_tracking

Advanced error tracking, categorization, and alerting system.

Parameters

  • action (string, required) - Error tracking action: "start_monitoring", "stop_monitoring", "get_errors", "clear_errors", "configure_alerts" (default: "get_errors")
  • errorTypes (array, optional) - Error types to track: "javascript_errors", "network_errors", "console_errors", "playwright_errors", "timeout_errors", "element_not_found", "security_errors"
  • alertConfig (object, optional) - Alert configuration
  • filters (object, optional) - Error filtering options

Example

{
  "name": "error_tracking",
  "arguments": {
    "action": "get_errors",
    "errorTypes": ["javascript_errors", "network_errors"],
    "filters": { "severity": "error", "limit": 20 }
  }
}

performance_monitoring

Real-time performance monitoring, profiling, and optimization insights.

Parameters

  • action (string, required) - Performance action: "start_monitoring", "stop_monitoring", "get_metrics", "analyze_performance", "set_thresholds" (default: "get_metrics")
  • metrics (array, optional) - Performance metrics: "page_load_time", "first_contentful_paint", "largest_contentful_paint", "cumulative_layout_shift", "first_input_delay", "memory_usage", "cpu_usage", "network_timing", "resource_sizes", "dom_metrics"
  • thresholds (object, optional) - Performance thresholds for alerting
  • samplingInterval (number, optional) - Sampling interval in milliseconds (default: 1000)
  • reportFormat (string, optional) - Report format: "realtime", "summary", "detailed", "chart_data" (default: "summary")

Example

{
  "name": "performance_monitoring",
  "arguments": {
    "action": "get_metrics",
    "metrics": ["page_load_time", "first_contentful_paint", "largest_contentful_paint"],
    "reportFormat": "detailed"
  }
}

session_analytics

Session-based analytics, user journey tracking, and workflow optimization.

Parameters

  • action (string, required) - Session action: "start_session", "end_session", "get_session_data", "analyze_journey", "export_sessions" (default: "get_session_data")
  • sessionConfig (object, optional) - Session tracking configuration
  • analysisType (string, optional) - Analysis type: "funnel_analysis", "path_analysis", "interaction_heatmap", "time_analysis", "conversion_analysis" (default: "path_analysis")
  • filters (object, optional) - Session filtering options
  • exportFormat (string, optional) - Export format: "json", "csv", "timeline", "report" (default: "json")

Example

{
  "name": "session_analytics",
  "arguments": {
    "action": "analyze_journey",
    "analysisType": "funnel_analysis",
    "exportFormat": "report"
  }
}

Visual Testing

Screenshot comparison, visual regression testing, and cross-browser visual validation (5 tools)

screenshot_compare

Compare screenshots with diff generation for visual testing workflows.

Parameters

  • baselineImage (string, required) - Path to baseline/reference image file
  • currentImage (string, optional) - Path to current screenshot (will take new if not provided)
  • diffOutputPath (string, optional) - Path to save diff image
  • threshold (number, optional) - Difference threshold 0-1 (default: 0.1)
  • includeAntiAliasing (boolean, optional) - Include anti-aliasing differences (default: false)
  • highlightColor (string, optional) - Color for highlighting differences (default: "#ff0000")
  • generateReport (boolean, optional) - Generate detailed comparison report (default: true)

Example

{
  "name": "screenshot_compare",
  "arguments": {
    "baselineImage": "./baselines/homepage.png",
    "threshold": 0.05,
    "generateReport": true
  }
}

visual_regression_testing

Automated visual regression testing framework with baseline management.

Parameters

  • testSuite (string, required) - Name of the visual test suite
  • baselineDirectory (string, optional) - Directory containing baseline images
  • testCases (array, required) - Visual test cases to execute
  • threshold (number, optional) - Global difference threshold (default: 0.1)
  • updateBaselines (boolean, optional) - Update baseline images (default: false)

Example

{
  "name": "visual_regression_testing",
  "arguments": {
    "testSuite": "homepage-suite",
    "testCases": [
      {
        "name": "homepage-desktop",
        "url": "https://example.com",
        "viewport": { "width": 1920, "height": 1080 }
      }
    ]
  }
}

cross_browser_visual_validation

Validate visual consistency across different browser engines.

Parameters

  • url (string, required) - URL to test across browsers
  • browsers (array, optional) - Browser engines: "chromium", "firefox", "webkit" (default: all)
  • viewports (array, optional) - Viewport sizes to test
  • elements (array, optional) - Specific elements to compare
  • threshold (number, optional) - Difference threshold (default: 0.05)
  • outputDirectory (string, optional) - Directory to save results

Example

{
  "name": "cross_browser_visual_validation",
  "arguments": {
    "url": "https://example.com",
    "browsers": ["chromium", "firefox"],
    "viewports": [
      { "width": 1920, "height": 1080, "name": "desktop" },
      { "width": 768, "height": 1024, "name": "tablet" }
    ]
  }
}

element_screenshot_compare

Compare specific elements across different states or versions.

Parameters

  • selector (string, required) - CSS selector for the element to compare
  • baselineImage (string, optional) - Path to baseline element image
  • states (array, optional) - Different states to capture and compare
  • includeMargin (number, optional) - Include margin around element in pixels (default: 0)
  • threshold (number, optional) - Comparison threshold (default: 0.1)

Example

{
  "name": "element_screenshot_compare",
  "arguments": {
    "selector": "button.primary",
    "states": [
      {
        "name": "hover",
        "actions": [{ "type": "hover", "selector": "button.primary" }]
      }
    ]
  }
}

visual_test_reporting

Generate comprehensive visual test reports with image galleries.

Parameters

  • reportName (string, required) - Name of the test report
  • testResults (array, required) - Test results to include in report
  • outputPath (string, optional) - Path to save the report
  • format (string, optional) - Report format: "html", "json", "junit" (default: "html")
  • includeMetadata (boolean, optional) - Include test metadata (default: true)
  • generateGallery (boolean, optional) - Generate image comparison gallery (default: true)

Example

{
  "name": "visual_test_reporting",
  "arguments": {
    "reportName": "Visual Regression Report",
    "testResults": [
      {
        "testName": "homepage-test",
        "status": "pass",
        "difference": 0.02,
        "threshold": 0.05
      }
    ],
    "format": "html"
  }
}

Test Integration

Testing framework integration and advanced test reporting capabilities (4 tools)

playwright_test_adapter

Integration adapter for Playwright Test runner with advanced configuration and reporting.

Parameters

  • action (string, required) - Adapter action: "initialize", "configure", "run_test", "get_results", "cleanup"
  • config (object, optional) - Playwright Test configuration
  • testPath (string, optional) - Specific test file or pattern to run
  • reportFormat (string, optional) - Test report format: "html", "json", "junit", "list", "dot" (default: "html")
  • outputDir (string, optional) - Output directory for reports (default: "./test-results")

Example

{
  "name": "playwright_test_adapter",
  "arguments": {
    "action": "configure",
    "config": {
      "testDir": "./tests/e2e",
      "workers": 2,
      "retries": 1,
      "projects": [
        { "name": "chromium", "browser": "chromium" },
        { "name": "firefox", "browser": "firefox" }
      ]
    }
  }
}

jest_adapter

Integration adapter for Jest testing framework with browser automation capabilities.

Parameters

  • action (string, required) - Jest adapter action: "initialize", "configure", "run_test", "get_results", "watch"
  • config (object, optional) - Jest configuration options
  • testPath (string, optional) - Specific test file or pattern to run
  • watchMode (boolean, optional) - Enable watch mode for continuous testing (default: false)
  • bail (number, optional) - Stop running tests after n failures (default: 0)
  • verbose (boolean, optional) - Display individual test results (default: true)

Example

{
  "name": "jest_adapter",
  "arguments": {
    "action": "run_test",
    "config": {
      "testEnvironment": "playwright",
      "collectCoverage": true,
      "maxWorkers": 2
    },
    "testPath": "**/*.test.js"
  }
}

mocha_adapter

Integration adapter for Mocha testing framework with browser automation hooks.

Parameters

  • action (string, required) - Mocha adapter action: "initialize", "configure", "run_test", "get_results", "watch"
  • config (object, optional) - Mocha configuration options
  • testPath (string, optional) - Specific test file or pattern to run
  • bail (boolean, optional) - Bail after first test failure (default: false)
  • watch (boolean, optional) - Watch files for changes (default: false)
  • require (array, optional) - Modules to require before running tests

Example

{
  "name": "mocha_adapter",
  "arguments": {
    "action": "configure",
    "config": {
      "reporter": "spec",
      "timeout": 30000,
      "parallel": true,
      "jobs": 2
    }
  }
}

test_reporter

Advanced test reporting and result aggregation with multi-format output and analytics.

Parameters

  • action (string, required) - Reporter action: "generate_report", "aggregate_results", "export_data", "get_analytics", "compare_runs"
  • sources (array, optional) - Test result sources to aggregate
  • outputFormat (string, optional) - Output format: "html", "json", "pdf", "xml", "csv", "junit" (default: "html")
  • outputPath (string, optional) - Output path for generated report (default: "./test-reports")
  • includeScreenshots (boolean, optional) - Include screenshots in report (default: true)
  • includeVideos (boolean, optional) - Include videos in report (default: false)
  • analytics (object, optional) - Analytics configuration
  • filters (object, optional) - Report filtering options
  • compareWith (string, optional) - Path to previous test results for comparison
  • threshold (object, optional) - Quality gate thresholds

Example

{
  "name": "test_reporter",
  "arguments": {
    "action": "generate_report",
    "sources": [
      {
        "framework": "playwright",
        "resultsPath": "./test-results/results.json",
        "format": "json"
      }
    ],
    "outputFormat": "html",
    "analytics": {
      "trends": true,
      "performance": true,
      "flakiness": true
    }
  }
}

Response Format

All InSite tools return responses in the following standardized format following MCP protocol:

{
  "success": true|false,
  "data": {
    // Tool-specific response data
  },
  "error": {
    "type": "ERROR_TYPE",
    "message": "Human-readable error description",
    "details": {
      // Additional error context
    }
  },
  "metadata": {
    "timestamp": "2025-08-01T10:30:00.000Z",
    "executionTime": 1250,
    "toolVersion": "1.2.0"
  }
}

Error Types

InSite uses standardized error types for consistent error handling across all tools:

BROWSER_NOT_INITIALIZED

Browser instance not started or initialization failed. Call load_page or switch_browser first.

ELEMENT_NOT_FOUND

CSS selector matched no elements on the page. Verify selector syntax and element presence.

TIMEOUT_ERROR

Operation exceeded the specified timeout duration. Consider increasing timeout or checking network conditions.

NAVIGATION_FAILED

Page navigation was unsuccessful due to network issues, invalid URL, or server errors.

JAVASCRIPT_ERROR

JavaScript execution failed or encountered an error. Check code syntax and page context.

NETWORK_ERROR

Network request failed or timed out. Verify connectivity and server availability.

INVALID_URL

URL format is invalid or malformed. Ensure proper protocol and domain format.

INVALID_SELECTOR

CSS selector syntax is invalid. Verify selector format and escaping.

SECURITY_ERROR

Security policy violation or certificate error. Check CSP settings and certificate validity.

CONFIGURATION_ERROR

Invalid configuration parameters or settings. Verify parameter types and values.

Best Practices

1. Error Handling

Always check the success field in responses and implement proper error handling with retry logic for transient failures.

2. Timeout Management

Set appropriate timeouts based on expected page load times and network conditions. Default 30-second timeouts may be insufficient for slow networks or complex pages.

3. Element Synchronization

Use wait_for_element before interacting with dynamic content to ensure elements are ready. Consider using networkidle wait condition for SPAs.

4. Resource Management

Always call close_browser when finished to clean up resources and prevent memory leaks in long-running processes.

5. Cross-Browser Testing

Use switch_browser and visual testing tools to ensure consistent behavior across different browser engines.

6. Performance Monitoring

Leverage monitoring tools to track performance metrics and identify optimization opportunities in your automation workflows.

7. Security Validation

Use security tools to validate CSP compliance, certificate validity, and identify potential security vulnerabilities.

8. Visual Regression Testing

Implement visual testing workflows to catch UI regressions and ensure consistent user experience across releases.