Function-call schemas
All 7 tools, with JSON Schema bodies, return shapes, and one runnable example per language.
Updated May 28, 2026
The Nyra Agent SDK exposes seven tools. Each is published as a single JSON object with name, description, and a JSON Schema parameters block. The shape works as-is with OpenAI tool-use, Anthropic tool-use, or any other harness that accepts the {name, description, parameters} triple.
Get the full list with toolDefinitions() (TS) or tool_definitions() (Python).
The 7 tools
| Tool | HTTP | Required scope |
|---|---|---|
me.read | GET /v1/me | identity.read |
evidence_map.read | GET /v1/patients/:id/evidence-map | evidence_map.read |
scales.read | GET /v1/scales/{instrument} | scales.read |
audit.read | GET /v1/audit/:patientId | audit.read |
sandbox.fork | POST /v1/sandbox/fork | sandbox.fork |
simulation.run | POST /v1/simulations | simulation.run |
draft.create | POST /v1/drafts | draft.create |
evidence_map.read, the read most agents start with
{
"name": "evidence_map.read",
"description": "Read a patient's evidence map. Each anxiety-behavior signal, scale trend, and differential carries its source and an audit_ref receipt.",
"parameters": {
"type": "object",
"properties": {
"patient_id": { "type": "string" },
"since": { "type": "string", "format": "date-time" }
},
"required": ["patient_id"],
"additionalProperties": false
}
}
Return shape: Evidence map JSON.
simulation.run, walk a plan against the graph surrogate
{
"name": "simulation.run",
"description": "Walk a plan against a graph-grounded surrogate. Returns transcript and confidence bands, never a verdict. Modes: forecast | rehearse | compare.",
"parameters": {
"type": "object",
"properties": {
"patient_id": { "type": "string" },
"mode": { "type": "string", "enum": ["forecast", "rehearse", "compare"] },
"plan": { "type": "object" },
"horizon_days": { "type": "integer", "minimum": 1, "maximum": 90 },
"sandbox_id": { "type": "string" }
},
"required": ["patient_id", "mode", "plan"],
"additionalProperties": false
}
}
draft.create, propose, never commit
{
"name": "draft.create",
"description": "Propose a clinical edit: note, plan, or follow-up. The draft is held in the sandbox subgraph until a clinician commits. Agents never commit.",
"parameters": {
"type": "object",
"properties": {
"patient_id": { "type": "string" },
"kind": { "type": "string", "enum": ["note", "plan", "follow_up"] },
"body": { "type": "string", "minLength": 1 },
"rationale": { "type": "string" },
"sandbox_id": { "type": "string" }
},
"required": ["patient_id", "kind", "body"],
"additionalProperties": false
}
}
Dispatch a tool by name
The SDK gives you a single entry point that takes the tool name and the LLM's argument object. It routes to the typed method and returns the parsed result. The dispatcher hits whatever transport you handed the client; in v0.1.0 that is HttpTransport, which raises NotLiveYetError until the auth server is live.
import { NyraClient, HttpTransport, NotLiveYetError } from "@humyn/nyra";
const client = new NyraClient({
transport: new HttpTransport({
baseUrl: "https://api.nyra.us.com",
token: "<oauth-token>",
}),
});
// Whatever your LLM emitted as a tool_use block:
try {
const result = await client.dispatch("evidence_map.read", {
patient_id: "<patient-id-from-roster>",
});
} catch (err) {
if (err instanceof NotLiveYetError) {
// v0.1.0. Tool wiring is committed; only the body lands when auth ships.
} else {
throw err;
}
}
import asyncio
from humyn_nyra import NyraClient, HttpTransport, NotLiveYetError
from humyn_nyra.transport.http import HttpTransportOptions
async def main():
client = NyraClient(transport=HttpTransport(HttpTransportOptions(
base_url="https://api.nyra.us.com",
token="<oauth-token>",
)))
try:
await client.dispatch("evidence_map.read", {"patient_id": "<id>"})
except NotLiveYetError:
pass # expected in v0.1.0
asyncio.run(main())
The other four tools (me.read, scales.read, audit.read, sandbox.fork) follow the same shape: the JSON Schema is the source of truth, the SDK does the validation.
Next: Evidence map JSON.