Skip to main content
Glama
Loopback Training Server

Loopback Training Server

calculate_pace

Work out a pace, finish time, or distance from the other two inputs and return split times along the way. Use it for race targets, pace alerts, and checkpoints without arithmetic slips.

Instructions

Work out a pace, a finish time or a distance from the other two, with the split times along the way.

USE THIS FOR EVERY SUCH NUMBER YOU QUOTE: a target pace for a goal time, the finish time a pace gives, the clock at each kilometer of a race, the speed for a pace alert. Do not do this arithmetic yourself; it is where slips happen (a half marathon is 21.0975 km, not 21).

Give exactly two of the three: a distance (race or distance_m), a time, a pace. The third is worked out.

This converts between numbers. It does not say whether a pace is realistic for the athlete; judge that from their training (get_recent_runs, get_training_summary) and the coaching playbook.

Returns: - solved_for: "pace", "time" or "distance", whichever was left out. - distance_m, and distance in the athlete's unit ("21.1 km"). - time ("1:45:00") and time_s. - pace_per_km and pace_per_mile ("4:59", "8:01"), each rounded to the second, with pace_per_km_s and pace_per_mile_s to one decimal. Quote the one matching the athlete's units. - speed_mps: the same pace as meters per second, the form a workout's speed alert takes (create_workout). - splits: one row per mark in running order, mark ("5 km", "Half", "Finish") and the time on the clock there at an even pace. A whole km or mile that is also a named checkpoint carries checkpoint ("5K"); one that is the finish carries finish: true. Marks between two whole units carry distance_m. Split times are computed from the exact pace, so they add up to the finish time even where the rounded pace would not. On bad input: {"error": "..."} saying what to change.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "calculate_pace"
  }
}

Input Schema

NameRequiredDescriptionDefault
paceNoPace as "M:SS" per kilometer, or per MILE when units is "imperial" ("4:58"), or a number of seconds per that unit.
raceNoA standard race distance, exact to the meter. Use this OR distance_m, not both.
timeNoTotal time as "H:MM:SS" or "MM:SS" ("1:45:00", "24:30"), or a number of seconds.
unitsNoThe athlete's `units` from get_plan_context. Decides whether `pace` is read per km or per mile, and whether splits are per km or per mile.metric
splitsNo"all" = every km or mile plus the checkpoints and the finish; "checkpoints" = only 5K, 10K, half, 30K and the finish; "none" = no table.all
distance_mNoDistance in METERS, for anything that is not one of the standard races.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.36

TDQS

A4.6/5.0
Behavior5/5

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

No annotations are supplied, and the description carries the full burden: it states the cross-parameter constraint (exactly two of three), the failure mode and its shape ({"error": "..."} saying what to change), rounding rules, and that splits are computed from exact pace so they sum to the finish time. It also implies a side-effect-free conversion, which is the safety information an agent needs here.

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?

Core purpose is front-loaded, then usage, then the constraint, then returns — a sensible order with no filler sentences. The returns block is long, but with no output schema it is doing necessary work; it could still be tightened slightly.

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

Completeness5/5

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

Six optional parameters, no annotations, and no output schema make this a case where the description must do a lot, and it does: it covers inputs, the two-of-three rule, error behavior, and every returned field including units, rounding, and split row shapes. An agent can call and interpret this correctly from the description alone.

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?

Schema coverage is 100%, so per-parameter meaning is already documented, and much of the prose (units driving pace per km vs per mile, splits modes) restates the schema. The one genuine addition is the cross-parameter rule that exactly two of pace/time/distance must be given, which a per-field schema cannot express. Useful but narrow on top of an already complete schema.

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

Purpose5/5

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

The first sentence states a specific operation on a specific quantity: solve for pace, finish time, or distance from the other two, plus splits. It is clearly framed as a pure arithmetic tool ("This converts between numbers"), which distinguishes it from the run-fetching and plan-editing siblings.

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

Usage Guidelines5/5

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

It gives an explicit, emphatic when-to-use rule ("USE THIS FOR EVERY SUCH NUMBER YOU QUOTE") with four concrete examples, plus a when-not-to ("Do not do this arithmetic yourself"). It also draws a boundary against sibling tools, saying realism judgments belong with get_recent_runs, get_training_summary, and the coaching playbook.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.