check_session
Retrieve session details including elapsed time for active sessions in behavioral tracking systems like meditation or exercise logs.
Instructions
Get details for a single session, including elapsed_sec if active. Free (0 credits).
Args:
ak_id: The session ID to look up.Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ak_id | Yes |
Implementation Reference
- server.py:70-79 (handler)The check_session tool handler that retrieves session details by ak_id. Makes a GET request to /sessions/{ak_id} endpoint and returns the JSON response.
@mcp.tool() def check_session(ak_id: int) -> dict: """Get details for a single session, including elapsed_sec if active. Free (0 credits). Args: ak_id: The session ID to look up. """ with _client() as client: response = client.get(f"/sessions/{ak_id}") return response.json() - server.py:70-71 (registration)Tool registration using @mcp.tool() decorator that registers check_session as an available MCP tool.
@mcp.tool() def check_session(ak_id: int) -> dict: - server.py:23-24 (helper)Helper function that creates an httpx client with configured base URL and headers, used by check_session to make API requests.
def _client() -> httpx.Client: return httpx.Client(base_url=MG_BASE_URL, headers=HEADERS, timeout=30)