kifas.session.check
kifas.session.check
Section titled “kifas.session.check”Run one check step against the current page exactly as a replay would: collect a list, table or text into a variable (data.collect), compare two values (assert.compare), ask the AI judge whether a stated condition holds for named values and screenshots (assert.ai_check, needs scope ai_check:run and is billed like a replay), or compare a screenshot with its approved baseline (assert.visual_match, needs scope visual_snapshot:write and a project). Pass the variables collected so far in vars; the reply returns them plus anything data.collect wrote. A failing check is returned with pass=false and a reason; unavailable=true means the check could not be run: reason_code ambiguous_target when a target matches several elements, not_judged when the AI or image service could not give a verdict. A target, mask or screenshot target may be a ref from the latest page read; it is replaced by the element’s stable selector (test id, then a real id, then short CSS) and the reply’s resolved_config holds the step as it should be saved.
Required scopes: session:create, ai_check:run, visual_snapshot:write
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
session_id |
string |
yes | — | |
run_id |
any |
no | — | |
workflow_id |
any |
no | — | |
project_id |
any |
no | — | |
step |
object |
yes | — | |
vars |
object |
no | {} |
|
billed_to |
"customer"` | `"platform" |
no | — |
Returns
Section titled “Returns”{ "type": "object", "properties": { "pass": { "type": "boolean" }, "reason": { "type": "string" }, "unavailable": { "type": "boolean" }, "reason_code": { "type": "string", "enum": [ "ambiguous_target", "not_judged" ] }, "resolved_config": { "type": "object", "properties": { "version": { "type": "number", "const": 2 }, "target": { "anyOf": [ { "type": "string" }, { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } ] }, "itemSelector": { "type": "string", "minLength": 1, "maxLength": 500 } }, "additionalProperties": {} }, "vars": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} }, "check": { "type": "object", "properties": { "evidence": { "type": "object", "properties": { "version": { "type": "number", "const": 1 }, "observed": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "returned": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "omitted": { "type": "boolean" }, "reasons": { "maxItems": 20, "type": "array", "items": { "type": "string", "enum": [ "item_limit", "byte_limit", "brief_limit", "unknown_extent", "enumeration_limit", "unresolved_membership" ] } }, "domCoverage": { "type": "string", "enum": [ "complete", "partial", "unknown" ] }, "applicationCoverage": { "type": "string", "enum": [ "complete", "partial", "unknown" ] }, "contextHash": { "type": "string", "minLength": 1, "maxLength": 200 }, "recipeHash": { "type": "string", "minLength": 1, "maxLength": 200 }, "dataHash": { "type": "string", "minLength": 1, "maxLength": 200 }, "recordIds": { "maxItems": 2000, "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 500 } }, "selection": { "type": "object", "properties": { "container": { "type": "string", "minLength": 1, "maxLength": 500 }, "itemSelector": { "type": "string", "minLength": 1, "maxLength": 500 }, "nesting": { "type": "string", "enum": [ "flat", "grouped", "unknown" ] } }, "required": [ "container", "nesting" ], "additionalProperties": false }, "extentEvidence": { "type": "object", "properties": { "kind": { "type": "string", "enum": [ "loaded_dom", "end_marker", "count_match", "unknown" ] }, "observationRefs": { "maxItems": 100, "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 200 } } }, "required": [ "kind", "observationRefs" ], "additionalProperties": false }, "limitations": { "maxItems": 40, "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 500 } } }, "required": [ "version", "observed", "returned", "bytes", "omitted", "reasons", "domCoverage", "applicationCoverage", "contextHash", "recipeHash", "dataHash", "recordIds", "selection", "extentEvidence", "limitations" ], "additionalProperties": false } }, "additionalProperties": {} }, "signals": { "type": "object", "properties": { "check": { "type": "object", "properties": { "kind": { "type": "string" }, "pass": { "type": "boolean" }, "reason": { "type": "string", "maxLength": 2000 }, "cached": { "type": "boolean" }, "unavailable": { "type": "boolean" } }, "required": [ "kind", "pass", "reason" ], "additionalProperties": false } }, "required": [ "check" ], "additionalProperties": false } }, "required": [ "pass", "reason", "unavailable", "vars", "check", "signals" ], "additionalProperties": false}Code samples
Section titled “Code samples”TypeScript (Anthropic MCP SDK)
import { Client } from '@modelcontextprotocol/sdk/client/index.js'import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamable-http.js'
const transport = new StreamableHTTPClientTransport( new URL('https://mcp.kifas.io/'), { requestInit: { headers: { Authorization: `Bearer ${process.env.KIFAS_API_KEY}` }, }, },)const client = new Client({ name: 'demo', version: '0.1.0' })await client.connect(transport)
const result = await client.callTool({ name: 'kifas.session.check', arguments: { "session_id": "00000000-0000-0000-0000-000000000000", "step": null, "vars": {} },})console.log(result)Python (httpx, raw JSON-RPC)
import osimport httpx
resp = httpx.post( "https://mcp.kifas.io/", headers={ "Authorization": f"Bearer {os.environ['KIFAS_API_KEY']}", "Content-Type": "application/json", }, json={ "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "kifas.session.check", "arguments": { "session_id": "00000000-0000-0000-0000-000000000000", "step": null, "vars": {} }, }, },)print(resp.json())curl
curl https://mcp.kifas.io/ \ -H "Authorization: Bearer $KIFAS_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "kifas.session.check", "arguments": { "session_id": "00000000-0000-0000-0000-000000000000", "step": null, "vars": {} } }}'Raw JSON-RPC body
{ "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "kifas.session.check", "arguments": { "session_id": "00000000-0000-0000-0000-000000000000", "step": null, "vars": {} } }}Try it
Section titled “Try it”Want to try kifas.session.check? Sign in to the dashboard and run it against a real session.