Skip to main content
Glama

get_human_state

Retrieve current stress scores and recommended actions to adapt AI response length and complexity based on user emotional state.

Instructions

Get current unified human state for a session. Call this before generating important responses.

Returns:
- state: calm | relaxed | focused | stressed | acute_stress
- stress_score: 0-100 (lower = calmer)
- confidence: 0.0-1.0 (based on signal quality and device type)
- suggested_action: maintain_engagement | simplify_and_focus | de-escalate_and_shorten | pause_and_ground
- action_reason: human-readable explanation of why this action was suggested
- adaptation_effectiveness (on 2nd+ call): shows whether your previous suggested_action actually reduced stress — contains previous_action, stress_delta, and effective boolean. Use this to self-improve.

Use suggested_action to adapt your response: calm/relaxed = full complexity, focused = shorter and structured, stressed = max 2 sentences, acute_stress = one grounding sentence only.

Requires a prior ingest call to have data. Not a medical device.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_idYes

Implementation Reference

  • proxy.py:44-71 (handler)
    The get_human_state tool handler implementation. Takes a session_id, makes HTTP GET request to API_URL/v1/state, and returns the human state data including state (calm/relaxed/focused/stressed/acute_stress), stress_score, confidence, suggested_action, and action_reason.
    # ── Tool: get_human_state ───────────────────────────────────────
    @mcp.tool()
    async def get_human_state(session_id: str) -> dict:
        """Get current unified human state for a session. Call this before generating important responses.
    
        Returns:
        - state: calm | relaxed | focused | stressed | acute_stress
        - stress_score: 0-100 (lower = calmer)
        - confidence: 0.0-1.0 (based on signal quality and device type)
        - suggested_action: maintain_engagement | simplify_and_focus | de-escalate_and_shorten | pause_and_ground
        - action_reason: human-readable explanation of why this action was suggested
        - adaptation_effectiveness (on 2nd+ call): shows whether your previous suggested_action actually reduced stress — contains previous_action, stress_delta, and effective boolean. Use this to self-improve.
    
        Use suggested_action to adapt your response: calm/relaxed = full complexity, focused = shorter and structured, stressed = max 2 sentences, acute_stress = one grounding sentence only.
    
        Requires a prior ingest call to have data. Not a medical device.
        """
        async with httpx.AsyncClient(timeout=10) as client:
            resp = await client.get(
                f"{API_URL}/v1/state",
                params={"session_id": session_id},
                headers=_headers(),
            )
            if resp.status_code == 200:
                return resp.json()
            if resp.status_code == 404:
                return {"error": f"No data for session {session_id}. Send signals via ingest first."}
            return {"error": f"API returned {resp.status_code}. Check your API key and parameters."}
  • proxy.py:45-45 (registration)
    Registration of the get_human_state tool with the MCP server using the @mcp.tool() decorator from FastMCP.
    @mcp.tool()
  • Input schema defined by function signature: session_id (str) parameter. Output schema is dict (generic).
    async def get_human_state(session_id: str) -> dict:
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full behavioral disclosure burden. It explains state meanings, confidence calculation methodology ('based on signal quality and device type'), conditional return fields ('on 2nd+ call'), and self-improvement loops ('Use this to self-improve'). No contradictions with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Perfectly structured with front-loaded purpose, followed by Returns bullet points, usage adaptation rules, and prerequisites. Every sentence provides unique value—no repetition of schema structure or tautology. Dense but scannable.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema exists, so the description comprehensively documents all return fields (state, stress_score, confidence, suggested_action, adaptation_effectiveness) including their formats and semantic meanings. Covers behavioral adaptation, medical disclaimers, and data prerequisites—fully complete for this complexity level.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema has 0% description coverage for the single 'session_id' parameter. While the description mentions 'for a session' and implies the parameter through context, it does not explicitly document what the session_id represents or where to obtain it (beyond the ingest prerequisite). Partial compensation for the schema gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb ('Get') and resource ('unified human state') scoped to 'a session'. It clearly differentiates from sibling tool 'ingest' by stating it 'Requires a prior ingest call to have data', establishing the dependency chain.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit when-to-use ('Call this before generating important responses'), prerequisites ('Requires a prior ingest call'), and detailed response adaptation rules ('calm/relaxed = full complexity...acute_stress = one grounding sentence only'). Also includes necessary disclaimers ('Not a medical device').

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nefesh-ai/nefesh-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server