get_gear_stats
Retrieve total distance and activity count for a specific gear item using its unique identifier.
Instructions
Get usage statistics for a specific gear item (total distance, activities)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| gearUuid | Yes | The UUID of the gear item |
Implementation Reference
- src/tools/profile.tools.ts:119-131 (registration)Registration of the 'get_gear_stats' tool on the MCP server with its description, input schema, and handler logic.
server.registerTool( 'get_gear_stats', { description: 'Get usage statistics for a specific gear item (total distance, activities)', inputSchema: getGearStatsSchema.shape, }, async ({ gearUuid }) => { const data = await client.getGearStats(gearUuid); return { content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }], }; }, ); - src/client/garmin.client.ts:487-489 (handler)Client method that makes the actual API request to fetch gear stats for a given gear UUID, appending the UUID to the GEAR_STATS_ENDPOINT.
async getGearStats(gearUuid: string): Promise<unknown> { return this.request(`${GEAR_STATS_ENDPOINT}/${gearUuid}`); } - src/dtos/devices.dto.ts:24-30 (schema)Zod schema and TypeScript type defining the input validation for get_gear_stats: requires gearUuid as a UUID string.
export type GetGearStatsDto = { gearUuid: string; }; export const getGearStatsSchema = z.object({ gearUuid: z.string().uuid().describe('The UUID of the gear item'), }); - Constants file defining the Garmin API endpoint path used by the gear stats service.
export const GEAR_STATS_ENDPOINT = '/gear-service/gear/stats';