Skip to main content
Glama

get-workout-count

Retrieve the total number of workouts from your Hevy fitness account for pagination or statistical analysis.

Instructions

Get the total number of workouts on the account. Useful for pagination or statistics.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Executes the tool logic: checks for hevyClient, calls getWorkoutCount(), extracts count, returns JSON response.
    withErrorHandling(async () => { if (!hevyClient) { throw new Error( "API client not initialized. Please provide HEVY_API_KEY.", ); } const data = await hevyClient.getWorkoutCount(); // Use type assertion to access count property const count = data ? (data as { workoutCount?: number }).workoutCount || 0 : 0; return createJsonResponse({ count }); }, "get-workout-count"),
  • Registers the get-workout-count tool with the MCP server inside registerWorkoutTools function, including name, description, input schema (none), and handler.
    // Get workout count server.tool( "get-workout-count", "Get the total number of workouts on the account. Useful for pagination or statistics.", {}, withErrorHandling(async () => { if (!hevyClient) { throw new Error( "API client not initialized. Please provide HEVY_API_KEY.", ); } const data = await hevyClient.getWorkoutCount(); // Use type assertion to access count property const count = data ? (data as { workoutCount?: number }).workoutCount || 0 : 0; return createJsonResponse({ count }); }, "get-workout-count"), );
  • Zod input schema for the tool: empty object indicating no input parameters required.
    {},

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/chrisdoc/hevy-mcp'

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