set_blood_pressure
Record blood pressure measurements with systolic, diastolic, and pulse values for monitoring in Garmin Connect.
Instructions
Record a blood pressure measurement with systolic, diastolic, and pulse
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| systolic | Yes | Systolic pressure (mmHg) | |
| diastolic | Yes | Diastolic pressure (mmHg) | |
| pulse | Yes | Pulse rate (bpm) | |
| timestamp | No | Measurement timestamp in ISO 8601 format. Defaults to now | |
| notes | No | Optional notes about the measurement |
Implementation Reference
- src/tools/write.tools.ts:91-103 (handler)The tool registration and handler function for 'set_blood_pressure'. It registers the tool with server, defines description and input schema, and the handler calls client.setBloodPressure().
server.registerTool( 'set_blood_pressure', { description: 'Record a blood pressure measurement with systolic, diastolic, and pulse', inputSchema: setBloodPressureSchema.shape, }, async ({ systolic, diastolic, pulse, timestamp, notes }) => { const data = await client.setBloodPressure(systolic, diastolic, pulse, timestamp, notes); return { content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }], }; }, ); - src/tools/write.tools.ts:91-103 (registration)Registration of the 'set_blood_pressure' tool on the MCP server via server.registerTool().
server.registerTool( 'set_blood_pressure', { description: 'Record a blood pressure measurement with systolic, diastolic, and pulse', inputSchema: setBloodPressureSchema.shape, }, async ({ systolic, diastolic, pulse, timestamp, notes }) => { const data = await client.setBloodPressure(systolic, diastolic, pulse, timestamp, notes); return { content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }], }; }, ); - src/dtos/write.dto.ts:66-83 (schema)The SetBloodPressureDto type definition and the setBloodPressureSchema Zod validation schema defining systolic (max 300), diastolic (max 200), pulse (max 300), timestamp (optional ISO 8601), and notes (optional).
export type SetBloodPressureDto = { systolic: number; diastolic: number; pulse: number; timestamp?: string; notes?: string; }; export const setBloodPressureSchema = z.object({ systolic: z.number().positive().max(300).describe('Systolic pressure (mmHg)'), diastolic: z.number().positive().max(200).describe('Diastolic pressure (mmHg)'), pulse: z.number().positive().max(300).describe('Pulse rate (bpm)'), timestamp: z .string() .optional() .describe('Measurement timestamp in ISO 8601 format. Defaults to now'), notes: z.string().optional().describe('Optional notes about the measurement'), }); - src/client/garmin.client.ts:719-738 (helper)The client method setBloodPressure() that makes the actual HTTP POST request to the Garmin API endpoint with systolic, diastolic, pulse, measurementTimestampGMT, notes, and sourceType='manual'.
async setBloodPressure( systolic: number, diastolic: number, pulse: number, timestamp?: string, notes?: string, ): Promise<unknown> { const ts = timestamp ?? new Date().toISOString(); return this.request(SET_BLOOD_PRESSURE_ENDPOINT, { method: 'POST', body: { systolic, diastolic, pulse, measurementTimestampGMT: ts, notes: notes ?? null, sourceType: 'manual', }, }); } - The API endpoint constant SET_BLOOD_PRESSURE_ENDPOINT = '/bloodpressure-service/bloodpressure'.
export const SET_BLOOD_PRESSURE_ENDPOINT = '/bloodpressure-service/bloodpressure';