# Using the SeaLights MCP server

### Best practices for MCP prompting <a href="#best-practices-for-mcp-prompting" id="best-practices-for-mcp-prompting"></a>

The server provides a standardized way to interact with the SeaLights platform programmatically through a tool-based architecture.

Effective prompting is key to getting the most out of the Sealights MCP integration. This topic provides the various tools, input/output details and examples to help you get the most out of the Sealights MCP.

### Available MCP tools <a href="#available-mcp-tools" id="available-mcp-tools"></a>

Below is a comprehensive list of all tools available through the MCP SeaLights Server, organized by category.

#### Cockpit Tools <a href="#cockpit-tools" id="cockpit-tools"></a>

Cockpit tools provide access to agent and lab management functionality as well as audit logs.

<table><thead><tr><th width="127.80859375">Tool Name</th><th>Description</th><th width="237.42578125">Input Parameters</th><th>Output</th><th>Example Prompt</th></tr></thead><tbody><tr><td><code>cockpit_get_live_agents</code></td><td>Retrieves information about live agents with optional filtering</td><td><code>appName</code> (string, optional), <code>branchName</code> (string, optional), <code>buildName</code> (string, optional), <code>labId</code> (string, optional), <code>type</code> (string, optional), <code>bsid</code> (string, optional), <code>top</code> (string, optional, default "100")</td><td>JSON array of filtered agent data</td><td>"Show me all active Java agents in production lab"</td></tr><tr><td><code>cockpit_get_live_labs</code></td><td>Retrieves information about all live labs</td><td>None</td><td>JSON array of lab data</td><td>"List all the active labs"</td></tr><tr><td><code>cockpit_get_live_components_by_lab_id</code></td><td>Gets components for a specific lab</td><td><code>lab_id</code> (string)</td><td>JSON array of component data</td><td>"What components are in lab LAB-123?"</td></tr><tr><td><code>cockpit_get_agent_default_version</code></td><td>Gets the default version for a specific agent</td><td><code>agent_type</code> (string)</td><td>JSON object with version info</td><td>"What's the default version for the Java agent?"</td></tr><tr><td><code>cockpit_get_audit_log_actions</code></td><td>Gets a list of available audit log action types</td><td>None</td><td>JSON array of action types</td><td>"What kinds of actions are tracked in audit logs?"</td></tr><tr><td><code>cockpit_download_audit_log</code></td><td>Downloads audit log for a specific time range</td><td><code>start_time</code> (string in ISO 8601 format, e.g., "2023-01-01T00:00:00Z"), <code>end_time</code> (string in ISO 8601 format, e.g., "2023-01-31T23:59:59Z"), <code>action_types</code> (array, optional)</td><td>CSV data</td><td>"Download the audit logs from March 1st to March 15th"</td></tr></tbody></table>

#### Coverage Tools <a href="#coverage-tools" id="coverage-tools"></a>

Coverage tools provide access to application, branch, build, and code management functionality.

<table><thead><tr><th width="133.21484375">Tool Name</th><th width="126.39453125">Description</th><th width="232.8359375">Input Parameters</th><th width="132.2109375">Output</th><th>Example Prompt</th></tr></thead><tbody><tr><td><code>coverage_get_apps</code></td><td>Retrieves a list of all applications</td><td>None</td><td>JSON array of application data</td><td>"List all the applications in the system"</td></tr><tr><td><code>coverage_get_branches</code></td><td>Gets branches for a specific application</td><td><code>app_name</code> (string)</td><td>JSON array of branch data</td><td>"Show me the branches for the MyApp application"</td></tr><tr><td><code>coverage_set_quality_gates</code></td><td>Sets quality gates for an application</td><td><code>app_name</code> (string), <code>quality_gates</code> (object)</td><td>JSON response</td><td>"Update the quality gates for MyApp to require 80% code coverage"</td></tr><tr><td><code>does_branch_exist</code></td><td>Checks if a branch exists for an application</td><td><code>app_name</code> (string), <code>branch_name</code> (string)</td><td>Boolean</td><td>"Does the develop branch exist for the MyApp application?"</td></tr><tr><td><code>toggle_hidden_flag_for_app</code></td><td>Shows or hides an application</td><td><code>app_name</code> (string), <code>hidden</code> (boolean)</td><td>JSON response</td><td>"Hide the test application from the dashboard"</td></tr><tr><td><code>toggle_hidden_flag_for_app_branch</code></td><td>Shows or hides a branch</td><td><code>app_name</code> (string), <code>branch_name</code> (string), <code>hidden</code> (boolean)</td><td>JSON response</td><td>"Hide the deprecated-feature branch in the MyApp application"</td></tr><tr><td><code>submit_batch_task</code></td><td>Submits a new batch task</td><td><code>task_type</code> (string), <code>params</code> (object)</td><td>JSON response</td><td>"Submit a batch task to recalculate coverage for all builds in MyApp"</td></tr><tr><td><code>get_batch_task_by_id</code></td><td>Gets a batch task by ID</td><td><code>task_id</code> (string)</td><td>JSON object</td><td>"What's the status of batch task ABC123?"</td></tr><tr><td><code>search_batch_tasks</code></td><td>Searches for batch tasks</td><td>various filter parameters</td><td>JSON array</td><td>"Find all batch tasks that failed in the last week"</td></tr><tr><td><code>download_batch_task_completion_report_file</code></td><td>Downloads a completion report for a batch task</td><td><code>task_id</code> (string)</td><td>File data</td><td>"Download the completion report for batch task ABC123"</td></tr><tr><td><code>coverage_get_builds</code></td><td>Gets builds for a specific app and branch</td><td><code>app_name</code> (string), <code>branch_name</code> (string)</td><td>JSON array</td><td>"List all builds for the main branch of MyApp"</td></tr><tr><td><code>get_build_metadata</code></td><td>Gets metadata for a specific build</td><td><code>bs_id</code> (string)</td><td>JSON object</td><td>"Show me the metadata for build session BS123"</td></tr><tr><td><code>get_tests_state</code></td><td>Gets test states for a specific build</td><td><code>bs_id</code> (string)</td><td>JSON object</td><td>"What's the test status for build session BS123?"</td></tr><tr><td><code>get_quality_status</code></td><td>Gets quality status for a specific build</td><td><code>bs_id</code> (string)</td><td>JSON object</td><td>"Did build session BS123 pass the quality gates?"</td></tr><tr><td><code>set_reference_build</code></td><td>Sets or unsets a build as reference</td><td><code>bs_id</code> (string), <code>is_reference</code> (boolean)</td><td>JSON response</td><td>"Set build BS123 as the reference build"</td></tr><tr><td><code>get_builds</code></td><td>Gets a list of builds for an app/branch</td><td><code>app_name</code> (string), <code>branch_name</code> (string), <code>limit</code> (number)</td><td>JSON array</td><td>"Get the last 10 builds from MyApp's develop branch"</td></tr><tr><td><code>resolve_builds</code></td><td>Resolves builds based on app name, branch name and time range</td><td><code>app_name</code> (string), <code>branch_name</code> (string), <code>period_from</code> (string), <code>period_to</code> (string, optional), <code>include_prs</code> (boolean, optional), <code>offset</code> (number, optional), <code>limit</code> (number, optional)</td><td>JSON object</td><td>"Get builds from MyApp's main branch between yesterday and today"</td></tr><tr><td><code>filter_builds_by_tags</code></td><td>Filters builds by tags</td><td><code>app_name</code> (string), <code>tags</code> (array)</td><td>JSON array</td><td>"Find all builds tagged with 'production' in MyApp"</td></tr><tr><td><code>add_and_update_tags_for_build</code></td><td>Adds or updates tags for a build</td><td><code>bs_id</code> (string), <code>tags</code> (object)</td><td>JSON response</td><td>"Tag build BS123 as 'tested' and 'ready'"</td></tr><tr><td><code>delete_tag_from_specific_build</code></td><td>Deletes a tag from a build</td><td><code>bs_id</code> (string), <code>tag_name</code> (string)</td><td>JSON response</td><td>"Remove the 'failed' tag from build BS123"</td></tr><tr><td><code>coverage_get_code_domains</code></td><td>Gets code domains with optional filtering by domain names</td><td><code>code_domain_names</code> (array of strings, optional)</td><td>JSON array</td><td>"Get all code domains" or "Get code domains for Team1 and Team2"</td></tr><tr><td><code>create_code_domain</code></td><td>Creates a new code domain or updates existing domain's app list</td><td><code>code_domain_name</code> (string), <code>apps</code> (array of objects with appName properties)</td><td>JSON response</td><td>"Create a new code domain called 'Backend APIs' with app1 and app2"</td></tr><tr><td><code>get_code_domains</code></td><td>Gets all code domains</td><td>None</td><td>JSON array</td><td>"Show me all code domains in the system"</td></tr><tr><td><code>delete_code_domain</code></td><td>Deletes a code domain</td><td><code>code_domain_name</code> (string)</td><td>JSON response</td><td>"Delete the 'Team1' code domain"</td></tr><tr><td><code>get_code_labels</code></td><td>Gets code labels</td><td>None</td><td>JSON array</td><td>"What code labels are defined in the system?"</td></tr><tr><td><code>bulk_create_code_label_rules</code></td><td>Creates code label rules in bulk</td><td><code>rules</code> (array)</td><td>JSON response</td><td>"Create label rules to identify security-sensitive code"</td></tr><tr><td><code>bulk_delete_code_label_rules</code></td><td>Deletes code label rules in bulk</td><td><code>rule_ids</code> (array)</td><td>JSON response</td><td>"Delete these outdated label rules"</td></tr><tr><td><code>get_code_scope_rules</code></td><td>Gets code scope rules</td><td>None</td><td>JSON array</td><td>"Show me all code scope rules"</td></tr><tr><td><code>create_code_scope_rules</code></td><td>Creates code scope rules</td><td><code>rules</code> (array)</td><td>JSON response</td><td>"Create scope rules for our microservices"</td></tr><tr><td><code>delete_code_scope_rule</code></td><td>Deletes a code scope rule</td><td><code>rule_id</code> (string)</td><td>JSON response</td><td>"Delete the obsolete scope rule RS123"</td></tr><tr><td><code>update_code_scope_rule</code></td><td>Updates a code scope rule</td><td><code>rule_id</code> (string), <code>rule_data</code> (object)</td><td>JSON response</td><td>"Update scope rule RS123 to include the new module"</td></tr><tr><td><code>get_build_coverage</code></td><td>Gets coverage data for a build</td><td><code>bs_id</code> (string), various options</td><td>JSON object</td><td>"Get code coverage details for build BS123"</td></tr><tr><td><code>download_build_coverage_csv</code></td><td>Downloads build coverage as CSV</td><td><code>bs_id</code> (string)</td><td>CSV data</td><td>"Download the coverage report for build BS123 as CSV"</td></tr><tr><td><code>get_aggregated_coverage_report_data</code></td><td>Gets aggregated coverage data</td><td><code>bs_id</code> (string), <code>aggregation</code> (string)</td><td>JSON object</td><td>"Show me the aggregated coverage by package for build BS123"</td></tr><tr><td><code>create_update_integration_build_components</code></td><td>Creates/updates integration build components</td><td><code>lab_id</code> (string), <code>components</code> (array)</td><td>JSON response</td><td>"Update the components for the integration build in lab LAB123"</td></tr><tr><td><code>delete_integration_build_components</code></td><td>Deletes integration build components</td><td><code>lab_id</code> (string), <code>component_ids</code> (array)</td><td>JSON response</td><td>"Remove components C1 and C2 from the integration build"</td></tr><tr><td><code>coverage_get_integration_builds</code></td><td>Gets integration builds</td><td><code>app_name</code> (string), <code>branch_name</code> (string)</td><td>JSON array</td><td>"List all integration builds for MyApp's main branch"</td></tr><tr><td><code>attach_integration_build_to_lab</code></td><td>Attaches an integration build to a lab</td><td><code>lab_id</code> (string), <code>bs_id</code> (string)</td><td>JSON response</td><td>"Attach build BS123 to lab LAB456"</td></tr><tr><td><code>generate_integration_build</code></td><td>Generates an integration build</td><td><code>lab_id</code> (string), <code>build_data</code> (object)</td><td>JSON response</td><td>"Generate a new integration build for lab LAB123"</td></tr><tr><td><code>create_integration_build_lab</code></td><td>Creates an integration build lab</td><td><code>name</code> (string), <code>config</code> (object)</td><td>JSON response</td><td>"Create a new integration build lab called 'Staging Environment'"</td></tr><tr><td><code>get_lab_ids</code></td><td>Gets lab IDs</td><td>None</td><td>JSON array</td><td>"List all lab IDs in the system"</td></tr><tr><td><code>resolve_build_session</code></td><td>Resolves build session using a lab ID and optional alias</td><td><code>lab_id</code> (string), <code>lab_alias</code> (string, optional)</td><td>JSON object with build session details</td><td>"Resolve the latest build session for lab LAB123 with alias 'integ'"</td></tr><tr><td><code>update_test_group_code_domains</code></td><td>Updates test group code domains</td><td><code>test_stage</code> (string), <code>test_group_id</code> (string), <code>domains</code> (array)</td><td>JSON response</td><td>"Update the code domains for test group TG123"</td></tr><tr><td><code>get_test_group_code_domains</code></td><td>Gets code domains for a test group</td><td><code>test_stage</code> (string), <code>test_group_id</code> (string)</td><td>JSON array</td><td>"What code domains are assigned to test group TG123?"</td></tr><tr><td><code>get_test_runs_by_bsid</code></td><td>Gets test runs by build session ID</td><td><code>bs_id</code> (string), <code>test_stage</code> (string)</td><td>JSON array</td><td>"Show me all test runs for build BS123 in the unit test stage"</td></tr><tr><td><code>get_test_runs_by_build_name</code></td><td>Gets test runs by build name</td><td><code>app_name</code> (string), <code>branch_name</code> (string), <code>build_name</code> (string), <code>test_stage</code> (string)</td><td>JSON array</td><td>"List all test runs for build 1.0.0 in MyApp's develop branch"</td></tr><tr><td><code>get_test_runs_by_latest_build</code></td><td>Gets test runs for the latest build</td><td><code>app_name</code> (string), <code>branch_name</code> (string), <code>test_stage</code> (string)</td><td>JSON array</td><td>"Show me test runs for the latest build in MyApp's main branch"</td></tr><tr><td><code>coverage_get_test_runs</code></td><td>Gets test runs for a build</td><td><code>bs_id</code> (string)</td><td>JSON array</td><td>"List all test runs for build session BS123"</td></tr><tr><td><code>get_coverage_by_build_name</code></td><td>Gets coverage by build name</td><td><code>app_name</code> (string), <code>branch_name</code> (string), <code>build_name</code> (string)</td><td>JSON object</td><td>"What's the coverage for build 2.0.0 in MyApp's main branch?"</td></tr></tbody></table>

#### Reports Tools <a href="#reports-tools" id="reports-tools"></a>

Reports tools provide access to various types of reports including custom reports, trend reports, and test gap analysis.

| Tool Name                                      | Description                                    | Input Parameters                                                                                                                                 | Output                    | Example Prompt                                                                 |
| ---------------------------------------------- | ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------- | ------------------------------------------------------------------------------ |
| `report_get_custom_reports`                    | Lists all custom reports                       | None                                                                                                                                             | JSON array of report data | "What custom reports are available in the system?"                             |
| `report_download_custom_report`                | Gets download link for a custom report         | `report_id` (string)                                                                                                                             | URL string                | "Get me a download link for the weekly coverage report"                        |
| `report_generate_coverage_trend_report`        | Generates a coverage trend report              | `app_name` (string), `branch_name` (string), `from_date` (string), `to_date` (string), various options                                           | JSON object               | "Generate a coverage trend report for the main branch from last week to today" |
| `report_generate_group_coverage_trend_report`  | Generates a group coverage trend report        | `app_name` (string), `branch_name` (string), `from_date` (string), `to_date` (string), `groups` (array)                                          | JSON object               | "Create a coverage trend report for the backend group from January to March"   |
| `report_create_data_only_quality_trend_report` | Creates a quality trend report                 | `app_name` (string), `branch_name` (string), `from_date` (string), `to_date` (string), various options                                           | JSON object               | "Generate a quality trend report for the develop branch for Q1"                |
| `report_create_tga_report`                     | Creates a Test Gap Analysis report             | `name` (string), `config` (object)                                                                                                               | JSON object               | "Create a Test Gap Analysis report for MyApp's main branch"                    |
| `report_search_tga_reports`                    | Searches for existing TGA reports              | various filter parameters                                                                                                                        | JSON array                | "Find all Test Gap Analysis reports for the MyApp application"                 |
| `report_get_tga_report`                        | Gets a specific TGA report                     | `report_id` (string)                                                                                                                             | JSON object               | "Get me the details of TGA report TGA123"                                      |
| `report_get_latest_tga_report`                 | Gets the latest TGA report for an app/branch   | `app_name` (string), `branch_name` (string)                                                                                                      | JSON object               | "What's the latest Test Gap Analysis report for MyApp's develop branch?"       |
| `report_delete_tga_report`                     | Deletes a TGA report                           | `report_id` (string)                                                                                                                             | JSON response             | "Delete the obsolete TGA report TGA123"                                        |
| `report_regenerate_tga_report_template`        | Regenerates a TGA report template              | `report_id` (string)                                                                                                                             | JSON response             | "Regenerate the template for TGA report TGA123"                                |
| `report_download_tga_report_csv`               | Gets download link for a TGA report CSV        | `report_id` (string)                                                                                                                             | URL string                | "Give me a CSV download link for TGA report TGA123"                            |
| `report_create_executive_report_time_range`    | Creates an executive report for a time range   | `app_name` (string), `branch_name` (string), `from_date` (string), `to_date` (string), `test_stage` (string, optional)                           | JSON object               | "Generate an executive report for MyApp from January to June"                  |
| `report_create_executive_report_build_range`   | Creates an executive report for a build range  | `app_name` (string), `branch_name` (string), `from_build` (string), `to_build` (string), `test_stage` (string, optional)                         | JSON object               | "Create an executive report from build 1.0.0 to 2.0.0"                         |
| `report_download_executive_report_csv`         | Gets download link for an executive report CSV | `report_type` (string), `app_name` (string), `branch_name` (string), `from_value` (string), `to_value` (string), `test_stage` (string, optional) | URL string                | "Download as CSV the executive report for MyApp from Q1 to Q2"                 |

#### Test Optimization Tools <a href="#test-optimization-tools" id="test-optimization-tools"></a>

Test Optimization tools provide access to Test Impact Analysis (TIA) configuration and test execution optimization.

| Tool Name                                             | Description                                   | Input Parameters                                                                                                                                           | Output        | Example Prompt                                                                       |
| ----------------------------------------------------- | --------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | ------------------------------------------------------------------------------------ |
| `optimization_enable_disable_tia`                     | Enables or disables Test Impact Analysis      | `app_name` (string), `branch_name` (string), `test_stage` (string), `enabled` (boolean)                                                                    | JSON response | "Enable Test Impact Analysis for the unit tests in MyApp's main branch"              |
| `optimization_update_full_run`                        | Updates full run setting for an app/branch    | `app_name` (string), `branch_name` (string), `test_stage` (string), `full_run` (boolean)                                                                   | JSON response | "Set the integration tests to run in full mode for the next build"                   |
| `optimization_update_full_run_bsid`                   | Updates full run setting for a build          | `bs_id` (string), `test_stage` (string), `full_run` (boolean)                                                                                              | JSON response | "Set build BS123 to use TIA for unit tests"                                          |
| `optimization_get_executions_status_list`             | Gets test execution statuses                  | various filter parameters                                                                                                                                  | JSON array    | "Show me the status of recent test executions for MyApp"                             |
| `optimization_create_test_session`                    | Creates a new test session                    | `test_stage` (string), `lab_id` or `bs_id` (string), various options                                                                                       | JSON object   | "Create a new test session for the unit tests in build BS-123"                       |
| `optimization_delete_test_session`                    | Deletes a test session                        | `test_session_id` (string)                                                                                                                                 | JSON response | "Delete test session TS123"                                                          |
| `optimization_get_exclude_tests_v2`                   | Gets tests to exclude for a session           | `test_session_id` (string), `run_all_tests_on_last_failure` (boolean)                                                                                      | JSON array    | "Which tests can I skip in test session TS123?"                                      |
| `optimization_send_test_events`                       | Sends test events for a session               | `test_session_id` (string), `events` (array)                                                                                                               | JSON response | "Record these test results for session TS123"                                        |
| `optimization_get_recommended_tests_latest_build`     | Gets test recommendations for latest build    | `app_name` (string), `branch_name` (string), `test_stage` (string)                                                                                         | JSON array    | "Which tests should I run for the latest build of MyApp?"                            |
| `optimization_get_recommended_tests_by_bsid`          | Gets test recommendations by build ID         | `bs_id` (string), `test_stage` (string)                                                                                                                    | JSON array    | "Which tests should I run for build BS-123?"                                         |
| `optimization_get_recommended_tests_by_build_name`    | Gets test recommendations by build name       | `app_name` (string), `branch_name` (string), `build_name` (string), `test_stage` (string)                                                                  | JSON array    | "What tests should I run for build 1.2.0 of MyApp?"                                  |
| `optimization_get_test_runs_by_bsid_v2`               | Gets test runs by build ID (v2)               | `bs_id` (string), `test_stage` (string)                                                                                                                    | JSON array    | "Show me all test runs for build BS123"                                              |
| `optimization_get_test_runs_by_build_name_v2`         | Gets test runs by build name (v2)             | `app_name` (string), `branch_name` (string), `build_name` (string), `test_stage` (string)                                                                  | JSON array    | "List the test runs for build 1.0.0 in MyApp"                                        |
| `optimization_get_test_runs_by_latest_build_v2`       | Gets test runs for latest build (v2)          | `app_name` (string), `branch_name` (string), `test_stage` (string)                                                                                         | JSON array    | "What are the test runs for the latest build in MyApp?"                              |
| `optimization_get_previous_build_for_recalculation`   | Gets previous build for recalculation         | `bs_id` (string), `test_stage` (string)                                                                                                                    | JSON object   | "Which previous build should I use for recalculating test recommendations?"          |
| `optimization_recalc_test_stage_baseline_branch`      | Recalculates recommendations for a test stage | `app_name` (string), `branch_name` (string), `build_name` (string), `test_stage` (string), `baseline_branch` (string), `baseline_build` (string, optional) | JSON response | "Recalculate test recommendations for build 1.2.3 using the main branch as baseline" |
| `optimization_recalc_all_stages_baseline_branch`      | Recalculates recommendations for all stages   | `app_name` (string), `branch_name` (string), `build_name` (string), `baseline_branch` (string), `baseline_build` (string, optional)                        | JSON response | "Recalculate all test recommendations using master as baseline"                      |
| `optimization_recalc_latest_build_baseline_branch`    | Recalculates recommendations for latest build | `app_name` (string), `branch_name` (string), `baseline_branch` (string), `baseline_build` (string, optional)                                               | JSON response | "Recalculate test recommendations for the latest build using develop as baseline"    |
| `optimization_merge_statistical_models`               | Merges statistical models                     | `app_name` (string), `branch_name` (string), `test_stage` (string), `source_branches` (array)                                                              | JSON response | "Merge the statistical models from feature branches into main"                       |
| `optimization_calibrate_model`                        | Calibrates the statistical model              | `bs_id` (string), `test_stage` (string)                                                                                                                    | JSON response | "Calibrate the statistical model for build BS123"                                    |
| `optimization_get_auto_branching_configurations`      | Gets auto-branching configurations            | `app_name` (string)                                                                                                                                        | JSON array    | "Show me the auto-branching configurations for MyApp"                                |
| `optimization_upsert_auto_branching_configurations`   | Creates/updates auto-branching configs        | `app_name` (string), `configurations` (array)                                                                                                              | JSON response | "Update the auto-branching configurations for MyApp"                                 |
| `optimization_update_auto_branching_configuration`    | Updates a specific auto-branching config      | `app_name` (string), `config_id` (string), `configuration` (object)                                                                                        | JSON response | "Update auto-branching configuration ABC123"                                         |
| `optimization_download_code_to_test_csv`              | Gets code-to-test mapping as CSV              | `bs_id` (string), `test_stage` (string)                                                                                                                    | CSV data      | "Give me the mapping between code and tests for build BS-123"                        |
| `optimization_set_recommendation_strategy_by_build`   | Sets recommendation strategy for a build      | `app_name` (string), `branch_name` (string), `build_name` (string), `test_stage` (string), `strategy` (string)                                             | JSON response | "Set the test recommendation strategy to only run code-changed tests"                |
| `optimization_set_recommendation_strategy_by_session` | Sets recommendation strategy for a session    | `test_session_id` (string), `strategy` (string)                                                                                                            | JSON response | "Change the recommendation strategy for test session TS123"                          |
| `optimization_set_recommendation_strategy_by_bsid`    | Sets recommendation strategy by build ID      | `bs_id` (string), `test_stage` (string), `strategy` (string)                                                                                               | JSON response | "Set the recommendation strategy for build BS123 to include regression tests"        |

#### Common Workflows Tools <a href="#common-workflows-tools" id="common-workflows-tools"></a>

Common Workflows tools provide access to cross-cutting functionality like entity tagging and build monitoring.

<table><thead><tr><th>Tool Name</th><th>Description</th><th width="187.1328125">Input Parameters</th><th>Output</th><th>Example Prompt</th></tr></thead><tbody><tr><td><code>workflows_list_entity_tags</code></td><td>Lists all tags for an entity</td><td><code>entity_id</code> (string, optional)</td><td>JSON array of tags</td><td>"What tags are applied to build 1.2.3?"</td></tr><tr><td><code>workflows_add_entity_tag</code></td><td>Adds a tag to an entity</td><td><code>entity_id</code> (string), <code>tag</code> (string)</td><td>JSON response</td><td>"Tag the failed build 1.2.3 as 'needs-investigation'"</td></tr><tr><td><code>workflows_remove_entity_tag</code></td><td>Removes a tag from an entity</td><td><code>entity_id</code> (string), <code>tag</code> (string)</td><td>JSON response</td><td>"Remove the 'in-progress' tag from build 1.2.3"</td></tr><tr><td><code>workflow_create_entity_tagging_exact_match_rule</code></td><td>Creates a tagging rule with exact matches</td><td><code>entity_type</code> (string), <code>rule_name</code> (string), <code>exact_matches</code> (array), <code>tags</code> (array), various options</td><td>JSON response</td><td>"Create a rule to tag builds with 'production' if they're from the main branch"</td></tr><tr><td><code>workflow_create_entity_tagging_query_rule</code></td><td>Creates a tagging rule with query criteria</td><td><code>entity_type</code> (string), <code>rule_name</code> (string), <code>query</code> (object), <code>tags</code> (array), various options</td><td>JSON response</td><td>"Create a complex rule to tag builds based on multiple conditions"</td></tr><tr><td><code>workflow_tag_build</code></td><td>Adds or updates tags for a build</td><td><code>app_name</code> (string), <code>branch_name</code> (string), <code>build_name</code> (string), <code>tags</code> (object)</td><td>JSON response</td><td>"Tag build 1.2.3 in MyApp as 'stable' and 'verified'"</td></tr><tr><td><code>workflow_delete_tag_from_build</code></td><td>Deletes a tag from a build</td><td><code>app_name</code> (string), <code>branch_name</code> (string), <code>build_name</code> (string), <code>tag</code> (string)</td><td>JSON response</td><td>"Remove the 'experimental' tag from build 1.2.3"</td></tr><tr><td><code>workflow_filter_builds_by_tags</code></td><td>Filters builds by tags</td><td><code>app_name</code> (string), <code>tags</code> (array), various options</td><td>JSON array</td><td>"Find all builds in MyApp tagged with both 'release' and 'tested'"</td></tr><tr><td><code>workflow_create_and_monitor_build</code></td><td>Creates and monitors a build</td><td><code>app_name</code> (string), <code>branch_name</code> (string), <code>build_name</code> (string), <code>build_data</code> (object), various options</td><td>JSON object</td><td>"Start a new build 2.0.1 for MyApp and monitor its progress"</td></tr><tr><td><code>workflow_setup_quality_gates</code></td><td>Sets up quality gates</td><td><code>app_name</code> (string), <code>branch_name</code> (string), <code>gates</code> (object)</td><td>JSON response</td><td>"Set up the standard quality gates for our new application"</td></tr><tr><td><code>workflow_analyze_test_gap</code></td><td>Runs a test gap analysis</td><td><code>app_name</code> (string), <code>branch_name</code> (string), <code>params</code> (object), various options</td><td>JSON response</td><td>"Run a test gap analysis for the latest build in MyApp's develop branch"</td></tr></tbody></table>

#### Executions Tools <a href="#executions-tools" id="executions-tools"></a>

Executions tools provide access to test and build execution management, including creating executions, updating their status, and retrieving execution metrics.

<table><thead><tr><th>Tool Name</th><th>Description</th><th width="202.87890625">Input Parameters</th><th>Output</th><th>Example Prompt</th></tr></thead><tbody><tr><td><code>executions_get_latest</code></td><td>Get the latest executions for a specific application and branch</td><td><code>app_name</code> (string), <code>branch_name</code> (string), <code>limit</code> (integer, optional)</td><td>JSON array of executions</td><td>"Show me the 5 most recent executions for MyApp's main branch"</td></tr><tr><td><code>executions_get_by_id</code></td><td>Get details for a specific execution by ID</td><td><code>execution_id</code> (string)</td><td>JSON object</td><td>"What are the details of execution EX123?"</td></tr><tr><td><code>executions_create</code></td><td>Create a new execution for a specific build</td><td><code>app_name</code> (string), <code>branch_name</code> (string), <code>build_name</code> (string), <code>execution_type</code> (string), <code>metadata</code> (object, optional)</td><td>JSON object</td><td>"Create a new test execution for build 1.2.3 of MyApp"</td></tr><tr><td><code>executions_update_status</code></td><td>Update the status of an execution</td><td><code>execution_id</code> (string), <code>status</code> (string), <code>status_details</code> (object, optional)</td><td>JSON object</td><td>"Update execution EX123 status to 'completed'"</td></tr><tr><td><code>executions_get_metrics</code></td><td>Get metrics for a specific execution</td><td><code>execution_id</code> (string)</td><td>JSON object</td><td>"What are the performance metrics for execution EX123?"</td></tr><tr><td><code>executions_open_by_lab_id</code></td><td>Open a test execution by lab ID</td><td><code>app_name</code> (string), <code>branch_name</code> (string), <code>build_name</code> (string), <code>lab_id</code> (string), <code>test_stage</code> (string), <code>test_group_id</code> (string, optional)</td><td>Server response text</td><td>"Open a test execution for build 1.2.3 in lab LAB123 for the unit_test stage"</td></tr><tr><td><code>executions_close_by_lab_id</code></td><td>Close a test execution by lab ID</td><td><code>lab_id</code> (string)</td><td>Server response text</td><td>"Close the test execution for lab LAB123"</td></tr></tbody></table>

#### Utility Tools <a href="#utility-tools" id="utility-tools"></a>

Utility tools provide general-purpose functionality that can be used across various workflows.

<table><thead><tr><th>Tool Name</th><th>Description</th><th width="246.2421875">Input Parameters</th><th>Output</th><th>Example Prompt</th></tr></thead><tbody><tr><td><code>time_convert_to_unix_ms</code></td><td>Convert a time string to Unix epoch milliseconds</td><td><code>time_string</code> (string) - A string representing a time in various formats including absolute dates, "now", "today", "yesterday", and relative times like "2 days ago"</td><td>Integer representing Unix epoch time in milliseconds</td><td>"Convert 'yesterday at noon' to Unix timestamp"</td></tr><tr><td><code>time_convert_from_unix_ms</code></td><td>Convert Unix epoch milliseconds to a formatted datetime string</td><td><code>unix_ms</code> (integer) - Unix epoch time in milliseconds, <code>format_string</code> (string, optional) - Format string for the output (e.g., "%Y-%m-%d %H:%M:%S")</td><td>Formatted datetime string</td><td>"Convert 1617235200000 to a readable date"</td></tr></tbody></table>

#### Lab IDs <a href="#lab-ids" id="lab-ids"></a>

**Get Lab IDs**

{% code overflow="wrap" lineNumbers="true" %}

```
async def get_lab_ids(
    build_type: str = "integration",
    app_name: Optional[str] = None,
    branch_name: Optional[str] = None,
) -> str
```

{% endcode %}

Get a list of lab IDs with optional filtering.

**Parameters:**

* `build_type` (str, optional): Type of build to filter by. Currently only "integration" is supported. If "component" is provided, an empty list will be returned. Defaults to "integration".
* `app_name` (str, optional): App name to filter by.
* `branch_name` (str, optional): Branch name to filter by.

**Returns:** A JSON string containing:

* `appName`: Searched app name (only if queried with appName)
* `branchName`: Searched branch name (only if queried with branchName)
* `buildType`: Searched buildType
* `labIds`: List of lab ID objects, each containing:
  * `labId`: Lab ID
  * `appName`: App name (only if 'appName' wasn't provided in query)
  * `branchName`: Branch name (only if 'branchName' wasn't provided in query)
  * `labAlias`: Lab alias name
  * `cdOnly`: Whether the lab is only for Continuous Deployment

**Example:**

{% code overflow="wrap" lineNumbers="true" %}

```
# Get all integration lab IDs
response = await client.get_lab_ids()

# Get integration lab IDs for a specific app
response = await client.get_lab_ids(app_name="MyApp")

# Get integration lab IDs for a specific app and branch
response = await client.get_lab_ids(
    app_name="MyApp",
    branch_name="main"
)
```

{% endcode %}

**Note:** Currently only `build_type="integration"` is supported. If `build_type="component"` is provided, an empty list will be returned. This is a placeholder for future implementation which will also support component builds.

**Resolve Build Session**

{% code overflow="wrap" lineNumbers="true" %}

```
async def resolve_build_session(
    lab_id: str,
    lab_alias: Optional[str] = None
) -> str
```

{% endcode %}

Resolve build session using a lab ID and an optional alias.

This endpoint should be used only when linking the test runner and the test listener using lab ID. The BSID that is returned is the one resolved at the time the latest tests stage was run. If a test stage has not run yet against this lab ID it will return a status code 404 with the error 4000 - "not found".

**Parameters:**

* `lab_id` (str): Lab ID to resolve build session for
* `lab_alias` (str, optional): Optional alias to filter by

**Returns:** A JSON string containing:

* `alias`: alias used in the filter
* `buildSession`: BuildSession object containing:
  * `appName`: Name of the build's app
  * `branchName`: Name of the build's branch
  * `buildName`: Name of the build
  * `bsid`: Build Session ID

**Example:**

{% code overflow="wrap" lineNumbers="true" %}

```
# Resolve build session for a lab ID
response = await client.resolve_build_session("integ_lab123")

# Resolve build session for a lab ID with alias
response = await client.resolve_build_session("integ_lab123", lab_alias="integ")
```

{% endcode %}

**Note:** This endpoint will return a 404 error with code 4000 if no test stage has run yet against the specified lab ID.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sealights.io/knowledgebase/setup-and-configuration/integrations/sealights-mcp/using-the-sealights-mcp-server.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
