run-tests
Verifies all tools in this server by running each and reporting the results.
Instructions
Returns a test plan for verifying all garmin-connect-mcp tools work. Call each tool listed and report results.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools.ts:917-978 (handler)The 'run-tests' tool handler registered via server.tool(). It simply returns a static markdown test plan instructing the LLM/agent to call other tools manually and report results. No schema params needed (empty object {}).
server.tool( "run-tests", "Returns a test plan for verifying all garmin-connect-mcp tools work. Call each tool listed and report results.", {}, async () => { return textResult(`# garmin-connect-mcp Test Plan Execute each tool below and verify it returns valid data (not an error). Report results as a table: tool name, status (PASS/FAIL), notes. ## Prerequisites 1. Call check-session first. If it fails, call garmin-login to authenticate. ## Tests (run in order) ### Session - check-session -> should return { status: "ok", profile: { ... } } ### Activities - list-activities (limit: 3) -> should return array of 3 activities - get-activity (use activityId from above) -> should return activity object with summaryDTO - get-activity-details (same ID) -> should return metricDescriptors + metrics - get-activity-splits (same ID) -> should return lapDTOs array - get-activity-hr-zones (same ID) -> should return array of 5 zones with secsInZone - get-activity-polyline (same ID) -> should return polyline data (may fail for indoor activities) - get-activity-weather (same ID) -> should return weather data (may fail for indoor activities) ### Daily Health (use today's date or omit for default) - get-daily-summary -> should return steps, calories, distance fields - get-daily-heart-rate -> should return heartRateValues array - get-daily-stress -> should return stressValuesArray - get-daily-summary-chart -> should return chart data object - get-daily-intensity-minutes -> should return intensity minutes data - get-daily-movement -> should return movement data - get-daily-respiration -> should return respiration data ### Sleep / Body Battery / HRV - get-sleep -> should return sleep score, duration, sleep stages - get-body-battery -> should return charged/drained values - get-hrv -> should return HRV data (may return { noData: true } if no overnight data yet) ### Weight / Records / Fitness - get-weight (startDate: 30 days ago, endDate: today) -> should return weight data (may be empty array) - get-personal-records -> should return personal records with history - get-fitness-stats (startDate: 30 days ago, endDate: today) -> should return activity stats by type - get-vo2max -> should return VO2 max estimate - get-hr-zones-config -> should return HR zone boundaries - get-user-profile -> should return user settings with userData ### Download - download-fit (use activityId from list, outputDir: /tmp/garmin-test) -> should save .fit file and return path ## Expected Acceptable Failures - get-activity-polyline / get-activity-weather may fail for indoor activities (no GPS/weather data) - get-hrv may return { noData: true } for today if overnight data hasn't synced yet - get-weight may return empty array if no weight entries recorded ## Report Present results as a markdown table: | Tool | Status | Notes | Count total passed vs failed at the end.`); } ); - src/tools.ts:41-41 (registration)The function registerTools(server) is where all tools, including 'run-tests', are registered on the MCP server.
export function registerTools(server: McpServer): void { - src/tools.ts:20-25 (helper)The textResult helper function used by the 'run-tests' handler to return markdown content.
function textResult(text: string) { return { content: [{ type: "text" as const, text }] }; } function errorResult(msg: string) { return { content: [{ type: "text" as const, text: msg }], isError: true }; - src/tools.ts:920-920 (schema)The 'run-tests' tool has no input schema (empty object {}) — it takes no arguments.
{},