Skip to main content
Glama

get_workouts

Retrieve workout data from the MCP Logger fitness tracking server using filters like date range, workout type, tags, or exercise names to analyze exercise history.

Instructions

Query workouts with various filters.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
from_dateNo
to_dateNo
workout_typeNo
tagNo
exercise_name_containsNo
limitNo
offsetNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Implementation of the get_workouts tool, which queries the workouts table with various filters and hydrates the results with related exercise and set data.
    def get_workouts(
        from_date: Optional[str] = None,
        to_date: Optional[str] = None,
        workout_type: Optional[str] = None,
        tag: Optional[str] = None,
        exercise_name_contains: Optional[str] = None,
        limit: int = 20,
        offset: int = 0,
    ) -> dict[str, list[dict[str, Any]]]:
        """Query workouts with various filters."""
        conn = get_connection()
        cursor = conn.cursor()
    
        filters: list[str] = []
        params: list[Any] = []
    
        if from_date:
            filters.append("date_time >= ?")
            params.append(f"{_ensure_date(from_date)}T00:00:00")
        if to_date:
            filters.append("date_time <= ?")
            params.append(f"{_ensure_date(to_date)}T23:59:59")
        if workout_type:
            filters.append("workout_type = ?")
            params.append(workout_type)
        if tag:
            filters.append("tags LIKE ?")
            params.append(f'%"{tag}"%')
    
        base = "SELECT * FROM workouts"
        if filters:
            base += " WHERE " + " AND ".join(filters)
        base += " ORDER BY date_time DESC LIMIT ? OFFSET ?"
        params.extend([limit, offset])
    
        cursor.execute(base, params)
        rows = cursor.fetchall()
    
        workouts = [_hydrate_workout(conn, _row_to_dict(row)) for row in rows]
        conn.close()
        return {"workouts": workouts}
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions 'various filters' but doesn't disclose behavioral traits like pagination (implied by limit/offset in schema), authentication needs, rate limits, or what happens with null parameters. For a query tool with 7 parameters, this leaves significant gaps in understanding how it behaves.

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 a single, efficient sentence with zero waste. It's appropriately sized and front-loaded, directly stating the tool's function without unnecessary elaboration. Every word earns its place, making it easy to parse quickly.

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 7 parameters with 0% schema coverage, no annotations, and sibling tools that suggest a fitness-tracking context, the description is incomplete. It doesn't explain filter semantics, output format (though an output schema exists), or how this tool fits into the broader system. For a query tool with multiple filters, more context is needed to use it effectively.

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

Parameters2/5

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

Schema description coverage is 0%, so parameters are undocumented in the schema. The description only vaguely references 'various filters' without explaining what the 7 parameters mean (e.g., date ranges, workout types, tags). It adds minimal semantic value beyond the parameter names themselves, failing to compensate for the schema gap.

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

Purpose3/5

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

The description 'Query workouts with various filters' states the action (query) and resource (workouts) but is vague about scope and differentiation. It doesn't specify whether this returns all workouts or a subset, nor how it differs from sibling tools like 'get_last_workout' or 'log_workout'. The purpose is understandable but lacks specificity.

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?

No guidance is provided on when to use this tool versus alternatives. With siblings like 'get_last_workout' (likely for recent data) and 'log_workout' (likely for creating records), the description offers no context for choosing this filtered query tool. Usage is implied only by the word 'query', but no explicit when/when-not instructions are given.

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/JohnZolton/MCP-logger'

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