Skip to main content
Glama

get_pomodoro_stats

Retrieve productivity statistics for Pomodoro sessions to analyze work patterns and track progress over specified time periods.

Instructions

Get statistics about pomodoro sessions

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
periodNoTime period for stats

Implementation Reference

  • The main handler logic for the 'get_pomodoro_stats' tool. It filters completed pomodoro sessions based on the specified period (today, week, month, or all), calculates statistics including total sessions, work sessions, break sessions, and total minutes worked, then returns the stats in JSON format.
    case "get_pomodoro_stats": {
      const period = (args.period as string) || "all";
      let filteredSessions = data.sessions.filter((s) => s.completed);
    
      const now = new Date();
      if (period === "today") {
        const today = new Date(now.setHours(0, 0, 0, 0));
        filteredSessions = filteredSessions.filter(
          (s) => new Date(s.startTime) >= today
        );
      } else if (period === "week") {
        const weekAgo = new Date(now.getTime() - 7 * 24 * 60 * 60 * 1000);
        filteredSessions = filteredSessions.filter(
          (s) => new Date(s.startTime) >= weekAgo
        );
      } else if (period === "month") {
        const monthAgo = new Date(now.getTime() - 30 * 24 * 60 * 60 * 1000);
        filteredSessions = filteredSessions.filter(
          (s) => new Date(s.startTime) >= monthAgo
        );
      }
    
      const stats = {
        totalSessions: filteredSessions.length,
        workSessions: filteredSessions.filter((s) => s.type === "work").length,
        breakSessions: filteredSessions.filter((s) => s.type !== "work").length,
        totalMinutes: filteredSessions.reduce((sum, s) => sum + s.duration, 0),
        period,
      };
      return {
        content: [
          { type: "text", text: JSON.stringify({ success: true, stats }, null, 2) },
        ],
      };
    }
  • src/index.ts:198-211 (registration)
    Registration of the 'get_pomodoro_stats' tool in the TOOLS array, which is returned by the ListTools handler. Includes name, description, and input schema definition.
    {
      name: "get_pomodoro_stats",
      description: "Get statistics about pomodoro sessions",
      inputSchema: {
        type: "object",
        properties: {
          period: {
            type: "string",
            enum: ["today", "week", "month", "all"],
            description: "Time period for stats",
          },
        },
      },
    },
  • Input schema for the 'get_pomodoro_stats' tool, defining the optional 'period' parameter with allowed values: today, week, month, all.
    inputSchema: {
      type: "object",
      properties: {
        period: {
          type: "string",
          enum: ["today", "week", "month", "all"],
          description: "Time period for stats",
        },
      },
    },
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure but offers minimal information. It states this is a read operation ('Get') but doesn't describe what statistics are returned, format, whether data is aggregated or detailed, or any performance characteristics. The description is too vague to provide meaningful behavioral context beyond the basic operation type.

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

Conciseness5/5

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

The description is extremely concise at just 5 words, front-loading the core purpose without any unnecessary elaboration. Every word earns its place, making it efficient for quick understanding while avoiding verbosity.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is insufficiently complete. It doesn't explain what statistics are returned (e.g., counts, durations, completion rates), how data is structured, or whether there are limitations. For a statistics tool with no structured output documentation, this leaves significant gaps in understanding what the tool actually provides.

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

Parameters3/5

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

The input schema has 100% description coverage, with the single parameter 'period' fully documented with enum values and description. The tool description doesn't add any parameter-specific information beyond what's already in the schema, so it meets the baseline of 3 for adequate but not additive parameter semantics.

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 tool's purpose with a specific verb ('Get') and resource ('statistics about pomodoro sessions'), making it immediately understandable. However, it doesn't differentiate this from potential sibling tools like 'get_active_session' or explain what specific statistics are provided beyond the general category.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'get_active_session' or 'list_tasks', nor does it mention any prerequisites or contextual constraints. The agent must infer usage purely from the tool name and description without explicit direction.

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/PratyayRajak/todopomo-mcp'

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