Skip to main content
Glama

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
NameRequiredDescriptionDefault
ak_idYes

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:
  • 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)

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/thunderrabbit/jikan'

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