start_session
Initiate a new behavioral tracking session for meditation, focus, or exercise activities. Records timestamps automatically and returns a session ID for future management.
Instructions
Start a new behavioral session. Costs 1 credit.
The server records the current time automatically — the agent does not
need to track time. Returns the new session including its ak_id, which
you need to stop or check the session later.
Args:
activity_id: Activity type ID (default 1 = Meditation).
Use list_activities to see all options.
timezone: IANA timezone name, e.g. 'Asia/Tokyo' (default UTC).
intended_sec: Planned duration in seconds (default 0 = open-ended).Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| activity_id | No | ||
| timezone | No | UTC | |
| intended_sec | No |
Implementation Reference
- server.py:27-52 (handler)The start_session tool handler function decorated with @mcp.tool(). This function starts a new behavioral session by making a POST request to the /sessions endpoint with activity_id, timezone, and intended_sec parameters. Returns the session data including ak_id.
@mcp.tool() def start_session( activity_id: int = 1, timezone: str = "UTC", intended_sec: int = 0, ) -> dict: """Start a new behavioral session. Costs 1 credit. The server records the current time automatically — the agent does not need to track time. Returns the new session including its ak_id, which you need to stop or check the session later. Args: activity_id: Activity type ID (default 1 = Meditation). Use list_activities to see all options. timezone: IANA timezone name, e.g. 'Asia/Tokyo' (default UTC). intended_sec: Planned duration in seconds (default 0 = open-ended). """ payload = { "activity_id": activity_id, "timezone": timezone, "intended_sec": intended_sec, } with _client() as client: response = client.post("/sessions", json=payload) return response.json() - server.py:27-27 (registration)Tool registration using @mcp.tool() decorator on the start_session function, which registers it with the FastMCP server instance.
@mcp.tool()