Skip to main content
Glama

get_exercise_history

Retrieve historical workout data for a specific exercise to track progress over time. Filter by date range and set result limits to analyze performance trends.

Instructions

Get history of a specific exercise across workouts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
exercise_nameYes
from_dateNo
to_dateNo
limitNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Implementation of the get_exercise_history tool which queries the database for exercise history based on exercise name and date range.
    def get_exercise_history(
        exercise_name: str,
        from_date: Optional[str] = None,
        to_date: Optional[str] = None,
        limit: int = 20,
    ) -> dict[str, list[dict[str, Any]]]:
        """Get history of a specific exercise across workouts."""
        conn = get_connection()
        cursor = conn.cursor()
    
        base = """
        SELECT w.id as workout_id, w.date_time, w.workout_type, w.tags, w.notes as workout_notes,
               e.id as exercise_id, e.name as exercise_name, e.category as exercise_category, e.notes as exercise_notes
        FROM workouts w
        JOIN exercises e ON e.workout_id = w.id
        WHERE LOWER(e.name) = LOWER(?)
        """
        params: list[Any] = [exercise_name]
    
        if from_date:
            base += " AND w.date_time >= ?"
            params.append(f"{_ensure_date(from_date)}T00:00:00")
        if to_date:
            base += " AND w.date_time <= ?"
            params.append(f"{_ensure_date(to_date)}T23:59:59")
    
        base += " ORDER BY w.date_time DESC LIMIT ?"
        params.append(limit)
    
        cursor.execute(base, params)
        rows = cursor.fetchall()
    
        entries: list[dict[str, Any]] = []
        for row in rows:
            item = _row_to_dict(row)
            item["tags"] = deserialize_tags(item["tags"])
            item["sets"] = _load_sets(conn, item["exercise_id"])
            entries.append(item)
    
        conn.close()
        return {"entries": entries}
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. It states this is a 'Get' operation, implying it's likely read-only, but doesn't confirm this or describe other traits like authentication needs, rate limits, error conditions, or what the output contains (though an output schema exists). For a tool with 4 parameters and no annotations, more behavioral context is needed.

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, clear sentence with no wasted words. It's front-loaded with the core purpose and efficiently conveys the tool's function. Every part of the sentence earns its place by specifying what is being retrieved and for what scope.

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 the tool has 4 parameters with 0% schema coverage and an output schema exists, the description is moderately complete. It covers the basic purpose but lacks details on parameter usage, behavioral traits, and differentiation from siblings. The output schema mitigates the need to describe return values, but overall completeness is adequate with clear gaps.

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 description mentions 'history of a specific exercise' which aligns with the 'exercise_name' parameter, and 'across workouts' hints at date ranges, loosely relating to 'from_date' and 'to_date'. However, with 0% schema description coverage, the schema provides no parameter details, and the description doesn't explain parameter purposes, formats (e.g., date string format), or the 'limit' parameter. It adds minimal value beyond the schema.

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 ('history of a specific exercise across workouts'), making it easy to understand what the tool does. However, it doesn't explicitly differentiate from sibling tools like 'get_workouts' or 'search_logs' which might also retrieve exercise-related data, so it doesn't reach the highest score.

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. It doesn't mention sibling tools like 'get_workouts' (which might list workouts containing exercises) or 'search_logs' (which could filter logs including exercises), leaving the agent to guess based on tool names alone. No exclusions or prerequisites are stated.

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