kifas.session.snapshot
kifas.session.snapshot
Section titled “kifas.session.snapshot”Capture a snapshot of the current page. format “ax” (default) returns a compressed accessibility tree with ref ids that subsequent click/type tools reference; “elements” returns an HTML-shaped element list (real attributes such as id, data-testid, name, placeholder, value) with tables, lists and dropdowns summarized — pass “expand” with a ref to read all their rows 50 at a time, or pass “zoom” with a ref to read that one section in full without scrolling (a heading reads the section it names, any other element its own subtree); “dom” returns raw MHTML; “text” returns the page’s visible innerText for reading confirmations, error banners, and content. Compressed to fit within max_tokens.
Required scopes: session:create
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
session_id |
string |
yes | — | |
format |
"ax"` | `"dom"` | `"text"` | `"elements" |
no | "ax" |
|
max_tokens |
integer |
no | 400 |
|
max_wait_ms |
integer |
no | — | |
settle |
boolean |
no | true |
|
query |
string |
no | — | |
viewport |
boolean |
no | false |
|
page_keys |
boolean |
no | false |
|
expand |
object |
no | — | |
zoom |
object |
no | — |
Returns
Section titled “Returns”{ "type": "object", "properties": { "format": { "type": "string", "enum": [ "ax", "dom", "ax-mobile", "text", "elements" ] }, "snapshot": { "type": "string" }, "truncated": { "type": "boolean" }, "refs_count": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "elements_shown": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "keyboard_keys_hidden": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "scroll_y": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "document_height": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "viewport_height": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }, "element_keys": { "type": "array", "items": { "type": "string" } }, "element_keys_truncated": { "type": "boolean" }, "page_blank": { "type": "boolean" }, "kept_refs": { "type": "array", "items": { "type": "string" } }, "expand_total": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "signals": { "type": "object", "properties": { "url_before": { "type": "string" }, "url_after": { "type": "string" }, "scroll_y_before": { "type": "number" }, "scroll_y_after": { "type": "number" }, "settled_ms": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "settled_reason": { "type": "string", "enum": [ "quiet", "steady", "timeout" ] }, "dom_mutation_count": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "screen_change_count": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "screen_changed": { "type": "boolean" }, "effect_unverified_reason": { "type": "string" }, "console_errors": { "default": [], "type": "array", "items": { "type": "string" } }, "http_statuses": { "default": [], "type": "array", "items": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 } }, "element_found": { "type": "boolean" }, "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": [ "settled_ms", "console_errors", "http_statuses" ], "additionalProperties": false }, "dom_artifact_id": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "settled": { "type": "boolean" }, "settled_ms": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "format", "snapshot", "truncated" ], "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.snapshot', arguments: { "session_id": "00000000-0000-0000-0000-000000000000", "format": "ax", "max_tokens": 400, "settle": true, "viewport": false, "page_keys": false },})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.snapshot", "arguments": { "session_id": "00000000-0000-0000-0000-000000000000", "format": "ax", "max_tokens": 400, "settle": true, "viewport": false, "page_keys": false }, }, },)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.snapshot", "arguments": { "session_id": "00000000-0000-0000-0000-000000000000", "format": "ax", "max_tokens": 400, "settle": true, "viewport": false, "page_keys": false } }}'Raw JSON-RPC body
{ "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "kifas.session.snapshot", "arguments": { "session_id": "00000000-0000-0000-0000-000000000000", "format": "ax", "max_tokens": 400, "settle": true, "viewport": false, "page_keys": false } }}Try it
Section titled “Try it”Want to try kifas.session.snapshot? Sign in to the dashboard and run it against a real session.