Check selectors

The ostra_check_selector tool on the Ostra MCP server — arguments, result, errors and examples.

MCPhttps://ostra.testrelic.ai/mcp · ostra_check_selector

Predicts whether each locator will survive the next release or break.

Title
Ostra Decision: Selector survival
Access
Full-access key. Read-only keys can list the tool but not call it.
Cost
$0.25 per 1M locators.
Hints
readOnlyHint: true · destructiveHint: false · idempotentHint: true · openWorldHint: false

Once the Ostra MCP server is connected, your agent calls the tool with these arguments.

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "ostra_check_selector",
    "arguments": {
      "locators": [
        {
          "locator_id": "checkout.apply-coupon",
          "strategy": "css",
          "dom_locator_found": true,
          "history": [
            {
              "release": "2026.10.1",
              "resolve_rate": 1
            },
            {
              "release": "2026.10.2",
              "resolve_rate": 0.92
            },
            {
              "release": "2026.11.1",
              "resolve_rate": 0.71
            }
          ]
        },
        {
          "locator_id": "nav.account-menu",
          "strategy": "role",
          "dom_locator_found": true,
          "history": [
            {
              "release": "2026.10.2",
              "resolve_rate": 1
            },
            {
              "release": "2026.11.1",
              "resolve_rate": 1
            }
          ]
        }
      ]
    }
  }
}
Headers
mcp-protocol-version
2025-06-18
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{\"id\":\"req_01JDXK6P7Q8R9S0T1U2V3W4X5Y\",\"model\":\"ostra-lite@v.beta.5\",\"task\":\"selector_survival\",\"cached\":false,\"billed\":{\"units\":2,\"costNano\":500,\"costUsd\":\"0.0000005\"},\"output\":{\"decisions\":[{\"decision_id\":\"dec_4d5e6f708192a3b4c5d6e7f8091a2b3c\",\"task\":\"selector_survival\",\"decision\":\"breaks\",\"value\":\"breaks\",\"p\":0.78,\"probabilities\":{\"survives\":0.22,\"breaks\":0.78},\"threshold\":0.6,\"defer_reason\":null,\"decided_by\":\"model\",\"rule\":null,\"model\":{\"release\":\"v.beta.5\",\"version\":\"1.2.0\",\"content_hash\":\"sha256:5d21f0e9c4a7b3e8\",\"gate_passed\":true},\"locator_id\":\"checkout.apply-coupon\"},{\"decision_id\":\"dec_5e6f708192a3b4c5d6e7f8091a2b3c4d\",\"task\":\"selector_survival\",\"decision\":\"survives\",\"value\":\"survives\",\"p\":0.96,\"probabilities\":{\"survives\":0.96,\"breaks\":0.04},\"threshold\":0.6,\"defer_reason\":null,\"decided_by\":\"model\",\"rule\":null,\"model\":{\"release\":\"v.beta.5\",\"version\":\"1.2.0\",\"content_hash\":\"sha256:5d21f0e9c4a7b3e8\",\"gate_passed\":true},\"locator_id\":\"nav.account-menu\"}]}}"
      }
    ],
    "structuredContent": {
      "id": "req_01JDXK6P7Q8R9S0T1U2V3W4X5Y",
      "model": "ostra-lite@v.beta.5",
      "task": "selector_survival",
      "cached": false,
      "billed": {
        "units": 2,
        "costNano": 500,
        "costUsd": "0.0000005"
      },
      "output": {
        "decisions": [
          {
            "decision_id": "dec_4d5e6f708192a3b4c5d6e7f8091a2b3c",
            "task": "selector_survival",
            "decision": "breaks",
            "value": "breaks",
            "p": 0.78,
            "probabilities": {
              "survives": 0.22,
              "breaks": 0.78
            },
            "threshold": 0.6,
            "defer_reason": null,
            "decided_by": "model",
            "rule": null,
            "model": {
              "release": "v.beta.5",
              "version": "1.2.0",
              "content_hash": "sha256:5d21f0e9c4a7b3e8",
              "gate_passed": true
            },
            "locator_id": "checkout.apply-coupon"
          },
          {
            "decision_id": "dec_5e6f708192a3b4c5d6e7f8091a2b3c4d",
            "task": "selector_survival",
            "decision": "survives",
            "value": "survives",
            "p": 0.96,
            "probabilities": {
              "survives": 0.96,
              "breaks": 0.04
            },
            "threshold": 0.6,
            "defer_reason": null,
            "decided_by": "model",
            "rule": null,
            "model": {
              "release": "v.beta.5",
              "version": "1.2.0",
              "content_hash": "sha256:5d21f0e9c4a7b3e8",
              "gate_passed": true
            },
            "locator_id": "nav.account-menu"
          }
        ]
      }
    },
    "isError": false
  }
}

Arguments

  • locatorsarray of objectsRequired

    The locators to check. Billed per locator.

    1–500 items
    Show 4 child fields
    • locator_idstring

      Your identifier for the locator, echoed back.

      1–512 chars
    • strategystring

      How the locator finds its element.

      One ofcssxpathtest_idtextrolenone
    • dom_locator_foundboolean

      The locator matches an element in the current build’s DOM.

    • historyarray of objects

      How well the locator resolved in past releases, oldest first.

      0–100 items
      Show 2 child fields
      • releasestringRequired

        Release label, e.g. 2026.11.1.

        1–128 chars
      • resolve_ratenumber

        Share of runs in that release where the locator resolved, 0–1.

        0 to 1

Result

content[0].text holds the answer as text; structuredContent holds it as JSON:

  • idstring

    Request id.

  • modelstring

    Model and release, e.g. ostra-lite@v.beta.5.

  • taskstring

    The task.

  • cachedboolean

    Answered from the 24-hour cache.

  • billedobject

    What this request cost. Cached answers cost 0.

    Show 3 child fields
    • unitsinteger

      Billable units: 1 per failure (triage), 1 per request (test impact), 1 per locator (selector survival). 0 for a cached answer.

    • costNanointeger

      Cost in nano-dollars (1 USD = 1,000,000,000).

    • costUsdstring

      Cost in USD as an exact decimal string, e.g. "0.0000005".

  • outputobject

    The task’s answer, the same shape as /predict.

Errors

Billing, validation, rate-limit and permission problems come back as a normal result with isError: true and structuredContent.error (type, message), the same types as the REST errors. Authentication failures are HTTP 401/403 before any JSON-RPC.

Was this page helpful?