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)
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses that the tool is 'Free (0 credits)' which is useful behavioral context, and mentions it returns both 'completed and active sessions'. However, it doesn't describe response format, pagination behavior beyond parameters, error conditions, or authentication requirements. The description adds some value but leaves significant behavioral gaps.

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

Conciseness4/5

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

The description is well-structured with purpose statement first, then organized parameter documentation. Every sentence serves a purpose - the first states the tool's function and cost, the parameter section provides essential usage details. It could be slightly more concise by combining some parameter explanations, but overall efficient.

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

Completeness3/5

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

Given 5 parameters with 0% schema coverage and no output schema, the description does well on parameters but leaves gaps. It doesn't describe the return format (what a 'session' object contains), doesn't mention error handling, and while it documents parameters thoroughly, the overall context for a listing tool with filtering and pagination could be more complete about result structure and limitations.

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

Parameters5/5

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

The schema description coverage is 0%, so the description must fully compensate. It provides detailed parameter documentation including: date format specifications (YYYY-MM-DD), activity_id meaning (0 = no filter), default values (limit default 20, offset default 0), and range constraints (max 50). This adds substantial meaning beyond what the bare schema provides.

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

Purpose4/5

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

The description clearly states the verb 'List' and resource 'completed and active sessions', making the purpose immediately understandable. It distinguishes from siblings like 'check_session' (specific session) and 'start_session' (creation). However, it doesn't explicitly contrast with 'list_activities' which might be a related listing tool.

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

Usage Guidelines3/5

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

The description mentions 'Free (0 credits)' which provides some usage context about cost, but doesn't explicitly state when to use this tool versus alternatives like 'check_session' for individual sessions or 'list_activities' for activities. It implies usage through parameter descriptions but lacks explicit guidance on tool selection.

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

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