Wire types
WireRunResult
WireRunResult
create_session() and start_turn().Session UUID.
Agent response text.
Number of turns completed.
Number of tool calls made.
Token usage breakdown.
Parsed structured output.
Schema validation warnings.
WireUsage
WireUsage
WireEvent (deprecated)
WireEvent (deprecated)
CapabilitiesResponse
CapabilitiesResponse
CapabilityChecker
Standalone capability-checking helper:| Method | Description |
|---|---|
has(capability_id) | Returns True if status is "Available" |
require(capability_id) | Raises CapabilityUnavailableError if not available |
available | List of all available capability IDs |
SkillHelper
Helpers for invoking Meerkat skills:| Method | Description |
|---|---|
is_available() | Returns True if "skills" capability is available |
require_skills() | Raises error if skills not available |
invoke(session_id, skill_ref, prompt) | Invoke skill in existing session |
invoke_new_session(skill_ref, prompt, model?) | Create session and invoke skill |
Streaming API
StreamingTurn provides real-time event streaming during agent execution. Events are yielded as raw dicts matching the Rust AgentEvent serde-tagged enum (e.g. {"type": "text_delta", "delta": "..."}).
create_session_streaming
create_session() plus preload_skills and skill_references.
start_turn_streaming
Convenience methods
Event types
Events have atype field discriminating the variant:
| Type | Description |
|---|---|
run_started | Agent run began |
turn_started | New LLM turn |
text_delta | Incremental text chunk (delta field) |
text_complete | Full text available |
tool_call_requested | Agent wants to call a tool |
tool_result_received | Tool returned a result |
turn_completed | LLM turn finished |
run_completed | Agent run finished |
The streaming methods are synchronous (not
async def) — they return a StreamingTurn directly. The request is sent when entering the async with block.Skills parameters
Bothcreate_session() and start_turn() accept skill-related parameters:
Error handling
All errors inherit fromMeerkatError:
| Class | Description |
|---|---|
MeerkatError | Base error with code, message, details, capability_hint |
CapabilityUnavailableError | Required capability not available |
SessionNotFoundError | Session not found |
SkillNotFoundError | Skill reference cannot be resolved |
Client-side error codes
| Code | Description |
|---|---|
BINARY_NOT_FOUND | rkat binary not found on PATH |
NOT_CONNECTED | Operation attempted before connect() |
CONNECTION_CLOSED | rkat rpc process closed unexpectedly |
VERSION_MISMATCH | Server contract version incompatible |
CAPABILITY_UNAVAILABLE | Capability check failed |
Server-side error codes
| Code | JSON-RPC code | Description |
|---|---|---|
SESSION_NOT_FOUND | -32001 | Session does not exist |
SESSION_BUSY | -32002 | Turn already in progress |
PROVIDER_ERROR | -32010 | LLM provider error |
BUDGET_EXHAUSTED | -32011 | Budget exceeded |
HOOK_DENIED | -32012 | Hook blocked operation |
AGENT_ERROR | -32013 | Internal agent error |
INVALID_PARAMS | -32602 | Invalid method parameters |
Example
Version compatibility
The SDK negotiates version compatibility duringconnect():
- 0.x: Requires exact minor version match (SDK
0.1.0works with server0.1.x) - 1.0+: Requires same major version
Running tests
See also
- Python SDK overview - getting started and MeerkatClient API
- TypeScript SDK - TypeScript SDK
- RPC reference - JSON-RPC protocol specification
