get_gear_activities
Get a list of activities associated with a specific gear item, like runs using a particular pair of shoes. Paginate results with offset and limit parameters.
Instructions
Get activities associated with a specific gear item (e.g. runs with a specific pair of shoes)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| gearUuid | Yes | The UUID of the gear item | |
| start | No | Pagination offset. Defaults to 0 | |
| limit | No | Number of activities to return (1-100). Defaults to 20 |
Implementation Reference
- src/client/garmin.client.ts:598-600 (handler)The client method that executes the API request for gear activities. Calls the Garmin endpoint '/activitylist-service/activities/{gearUuid}/gear' with pagination params.
async getGearActivities(gearUuid: string, start = 0, limit = DEFAULT_GEAR_ACTIVITIES_LIMIT): Promise<unknown> { return this.request(`${GEAR_ACTIVITIES_ENDPOINT}/${gearUuid}/gear?start=${start}&limit=${limit}`); } - src/dtos/devices.dto.ts:46-61 (schema)Zod schema and TypeScript type for the 'get_gear_activities' tool input (gearUuid, start, limit).
export const getGearActivitiesSchema = z.object({ gearUuid: z.string().uuid().describe('The UUID of the gear item'), start: z .number() .min(0) .default(0) .optional() .describe('Pagination offset. Defaults to 0'), limit: z .number() .min(1) .max(100) .default(20) .optional() .describe('Number of activities to return (1-100). Defaults to 20'), }); - src/tools/profile.tools.ts:186-198 (registration)Registration of the 'get_gear_activities' tool on the MCP server with description, input schema, and handler callback.
server.registerTool( 'get_gear_activities', { description: 'Get activities associated with a specific gear item (e.g. runs with a specific pair of shoes)', inputSchema: getGearActivitiesSchema.shape, }, async ({ gearUuid, start, limit }) => { const data = await client.getGearActivities(gearUuid, start ?? 0, limit ?? 20); return { content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }], }; }, ); - src/tools/profile.tools.ts:1-11 (registration)Import of getGearActivitiesSchema and the registerProfileTools function that registers the tool.
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; import { GarminClient } from '../client'; import { getDeviceSettingsSchema, getDeviceSolarSchema, getGearStatsSchema, getGearActivitiesSchema, getWorkoutSchema, } from '../dtos'; export function registerProfileTools(server: McpServer, client: GarminClient): void { - The API endpoint constant GEAR_ACTIVITIES_ENDPOINT used by the client to fetch gear activities.
export const GEAR_ACTIVITIES_ENDPOINT = '/activitylist-service/activities';