- SDK install
- strict manifest inspection
- API-keyed
world.read - Cursor-style
Agent.create().send().stream() - semi-realtime
watch - trace/replay for deterministic harnesses
- optional governed execution with runtime and policy guardrails
1. Install
2. Set Keys
For SDK data calls and Agent live execution:3. Inspect The Strict Contract Without A Key
/api/contracts/tools is the SDK and Agent contract truth.
get_world_state is a broad compatibility name, not a canonical SDK/Agent tool.
4. Make The First SDK Data Call
MissingApiKeyError because world.read is cost-bearing and not anonymously allowlisted.
5. Create A Cursor-style Agent
Agent.create({ apiKey }) mounts read-only SimpleFunctions strict tools by default. Write tools are opt-in only.
6. Build A Market Watch Agent
7. Watch Semi-realtime Inputs Directly
client, watch.ticks() reads the SimpleFunctions market inspect
surface for current prices. Without one, it emits a synthetic: true development tick
so tests and local demos stay deterministic.
8. Use Query Directly
9. Trace And Replay A Low-level Tool Run
The low-level direct runner is still useful for deterministic harnesses:10. Optional Governed Execution
Execution tools are not mounted by default in model-backed agents and are denied by default in the low-level direct runner unless policy explicitly allowslive_trade.
blockedJurisdictions and requireJurisdiction to their Agent policy when they need venue-specific compliance safety valves.
11. Remember The Boundaries
| Surface | Scope |
|---|---|
@spfunctions/sdk | Typed data and contract client |
@spfunctions/agent | Cursor-style market-intelligence Agent SDK |
| Low-level direct runner | Deterministic canonical tool calls, trace, replay |
sf agent --tool | CLI wrapper for direct tool semantics |
/api/contracts/tools | Strict canonical SDK/Agent truth |
/api/tools | Broad hosted compatibility inventory |
| MCP | Broad client adapter, not SDK truth |