Skip to content

kifas.session.count

Count how many elements on the current page each role+name target (optionally scoped by within and picked by nth) resolves to, the way a replayed step resolves it. With ref_hints, also reports where each hinted element sits among the matches and the nearest uniquely named container that holds only it.

Required scopes: session:create

Name Type Required Default Description
session_id string yes —
targets object[] yes —
ref_hints any[] no —
{
"type": "object",
"properties": {
"counts": {
"type": "array",
"items": {
"type": "object",
"properties": {
"matches": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"hint_index": {
"anyOf": [
{
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
},
"container": {
"anyOf": [
{
"type": "object",
"properties": {
"role": {
"type": "string",
"minLength": 1
},
"name": {
"type": "string",
"minLength": 1
}
},
"required": [
"role",
"name"
],
"additionalProperties": false
},
{
"type": "null"
}
]
}
},
"required": [
"matches",
"hint_index",
"container"
],
"additionalProperties": false
}
}
},
"required": [
"counts"
],
"additionalProperties": false
}
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.count',
arguments: {
"session_id": "00000000-0000-0000-0000-000000000000",
"targets": []
},
})
console.log(result)
Python (httpx, raw JSON-RPC)
import os
import 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.count",
"arguments": {
"session_id": "00000000-0000-0000-0000-000000000000",
"targets": []
},
},
},
)
print(resp.json())
curl
Terminal window
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.count",
"arguments": {
"session_id": "00000000-0000-0000-0000-000000000000",
"targets": []
}
}
}'
Raw JSON-RPC body
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "kifas.session.count",
"arguments": {
"session_id": "00000000-0000-0000-0000-000000000000",
"targets": []
}
}
}

Want to try kifas.session.count? Sign in to the dashboard and run it against a real session.

Try in Kifas →