Skip to main content
Glama

list_sessions

Retrieve completed and active behavioral sessions from the jikan MCP server. Filter by date range, activity type, and paginate results to manage meditation, focus, and exercise tracking.

Instructions

List completed and active sessions. Free (0 credits).

Args:
    from_date: Start date filter in YYYY-MM-DD format (optional).
    to_date: End date filter in YYYY-MM-DD format (optional).
    activity_id: Filter by activity type ID (optional, 0 = no filter).
    limit: Number of results to return (default 20, max 50).
    offset: Pagination offset (default 0).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
from_dateNo
to_dateNo
activity_idNo
limitNo
offsetNo

Implementation Reference

  • The list_sessions tool implementation decorated with @mcp.tool(). This function lists completed and active sessions by making a GET request to /sessions endpoint with optional date, activity_id, limit, and offset parameters. Returns the API response as JSON.
    @mcp.tool()
    def list_sessions(
        from_date: str = "",
        to_date: str = "",
        activity_id: int = 0,
        limit: int = 20,
        offset: int = 0,
    ) -> dict:
        """List completed and active sessions. Free (0 credits).
    
        Args:
            from_date: Start date filter in YYYY-MM-DD format (optional).
            to_date: End date filter in YYYY-MM-DD format (optional).
            activity_id: Filter by activity type ID (optional, 0 = no filter).
            limit: Number of results to return (default 20, max 50).
            offset: Pagination offset (default 0).
        """
        params: dict = {"limit": limit, "offset": offset}
        if from_date:
            params["from"] = from_date
        if to_date:
            params["to"] = to_date
        if activity_id:
            params["activity_id"] = activity_id
        with _client() as client:
            response = client.get("/sessions", params=params)
        return response.json()
  • Helper function that creates and returns an httpx.Client configured with the base URL and API headers. Used by list_sessions to make HTTP 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