Expose typed, auditable tools to your agent (structured inputs/outputs + traceable execution), so tool calls are deterministic and debuggable.
This guide covers:
tool_call trace eventsTool calls should be validated and replayable.
The Tool Registry gives tools the same failure semantics as the rest of the runtime: strict schemas, explicit capability checks, and trace events for post-mortems.
Without typed tools, agents “call tools” with ambiguous payloads:
Tool Registry addresses this by:
tool_call trace events (success/failure + duration)You can register a ready-made tool pack for common browser operations.
| Tool | Purpose |
|---|---|
snapshot_state | Capture a bounded snapshot state. |
click, type, press | Core interaction primitives. |
scroll, scroll_to_element, click_rect | Viewport movement + coordinate click. |
evaluate_js | Bounded JavaScript evaluation. |
grant_permissions, clear_permissions, set_geolocation | Permission management tools (backend-dependent). |
from pydantic import BaseModel
from predicate.tools import ToolRegistry, ToolSpec
class EchoIn(BaseModel):
message: str
class EchoOut(BaseModel):
echoed: str
registry = ToolRegistry()
registry.register(ToolSpec(
name="echo",
description="Echo a message",
input_model=EchoIn,
output_model=EchoOut,
))When you execute tools through the registry, inputs/outputs are validated and tool_call events are emitted (if tracing is enabled).
from predicate.tools import ToolRegistry, ToolContext, register_default_tools
registry = ToolRegistry()
register_default_tools(registry, runtime)
ctx = ToolContext(runtime)
result = await registry.execute("snapshot_state", {"limit": 60}, ctx=ctx)Some tools require backend capabilities (e.g., permissions). Keep failures explicit: