MCP Resources
In addition to tools, the Nefesh MCP server exposes resources that agents can subscribe to for live state updates.
Session State Resource
nefesh://session/{session_id}/state
Returns the current human state for a session as a JSON object. Agents can read this resource to check state without making a tool call.
Example
// Resource URI:
nefesh://session/sess_abc123/state
// Returns:
{
"session_id": "sess_abc123",
"state": "focused",
"stress_score": 45,
"confidence": 0.78,
"signals_received": ["cardiovascular"],
"suggested_action": "simplify_and_focus",
"action_reason": "heart rate signal",
"recommendation": "Reduce complexity. 2-3 sentences. Actionable."
}
When to Use Resources vs. Tools
| Use Case | Approach |
|---|---|
| Quick state check before responding | Resource (read-only, fast) |
| Send new sensor data | ingest tool |
| Detailed state with recommendation | get_human_state tool |
| Historical trend analysis | get_session_history tool |