Skip to main content
Glama

get_stats

Retrieve aggregated session statistics including totals, streaks, and remaining credits to track behavioral activities like meditation, focus, and exercise.

Instructions

Get pre-computed session aggregates. Costs 1 credit.

Returns total sessions, total seconds, current streak in days, and credits remaining. Offloads all calendar arithmetic to the server.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The get_stats tool implementation decorated with @mcp.tool(). This function makes a GET request to /stats endpoint and returns pre-computed session aggregates including total sessions, total seconds, current streak in days, and credits remaining. The @mcp.tool() decorator registers this function as an MCP tool.
    @mcp.tool()
    def get_stats() -> dict:
        """Get pre-computed session aggregates. Costs 1 credit.
    
        Returns total sessions, total seconds, current streak in days, and
        credits remaining. Offloads all calendar arithmetic to the server.
        """
        with _client() as client:
            response = client.get("/stats")
        return response.json()

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