Skip to main content
Glama
lucas-1000

MCP Glucose Server

by lucas-1000

get_glucose_readings

Retrieve glucose readings for a user within a specified date range, returning values in mg/dL with timestamps and data sources for health monitoring.

Instructions

Get glucose/blood sugar readings for a user within a date range. Returns glucose values in mg/dL with timestamps and sources.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
userIdNoUser identifier. Defaults to user_12345abcdef67890 if not specified.
startDateNoStart date in ISO 8601 format (e.g., 2025-10-01T00:00:00Z). Optional.
endDateNoEnd date in ISO 8601 format (e.g., 2025-10-22T23:59:59Z). Optional.
limitNoMaximum number of readings to return (default: 1000)

Implementation Reference

  • MCP tool handler for 'get_glucose_readings': extracts parameters, calls the API client, formats and returns the glucose readings as JSON.
    case 'get_glucose_readings': { const readings = await api.getGlucoseReadings({ userId, startDate: args?.startDate as string | undefined, endDate: args?.endDate as string | undefined, limit: (args?.limit as number) || 1000, }); return { content: [ { type: 'text', text: JSON.stringify( { count: readings.length, readings: readings.map((r) => ({ value: r.value, unit: r.unit, date: r.date, source: r.source, })), }, null, 2 ), }, ], }; }
  • src/index.ts:30-56 (registration)
    Registration of the 'get_glucose_readings' tool in the MCP tools list, including name, description, and input schema.
    { name: 'get_glucose_readings', description: 'Get glucose/blood sugar readings for a user within a date range. Returns glucose values in mg/dL with timestamps and sources.', inputSchema: { type: 'object', properties: { userId: { type: 'string', description: `User identifier. Defaults to ${DEFAULT_USER_ID || 'configured user'} if not specified.`, }, startDate: { type: 'string', description: 'Start date in ISO 8601 format (e.g., 2025-10-01T00:00:00Z). Optional.', }, endDate: { type: 'string', description: 'End date in ISO 8601 format (e.g., 2025-10-22T23:59:59Z). Optional.', }, limit: { type: 'number', description: 'Maximum number of readings to return (default: 1000)', }, }, required: [], }, },
  • Input schema definition for the 'get_glucose_readings' tool.
    inputSchema: { type: 'object', properties: { userId: { type: 'string', description: `User identifier. Defaults to ${DEFAULT_USER_ID || 'configured user'} if not specified.`, }, startDate: { type: 'string', description: 'Start date in ISO 8601 format (e.g., 2025-10-01T00:00:00Z). Optional.', }, endDate: { type: 'string', description: 'End date in ISO 8601 format (e.g., 2025-10-22T23:59:59Z). Optional.', }, limit: { type: 'number', description: 'Maximum number of readings to return (default: 1000)', }, }, required: [], }, },
  • Helper function in HealthDataAPI class that performs the HTTP request to fetch glucose readings from the backend API.
    async getGlucoseReadings(params: { userId: string; startDate?: string; endDate?: string; limit?: number; }): Promise<GlucoseReading[]> { const queryParams = new URLSearchParams({ userId: params.userId, type: 'BloodGlucose', }); if (params.startDate) queryParams.append('startDate', params.startDate); if (params.endDate) queryParams.append('endDate', params.endDate); if (params.limit) queryParams.append('limit', params.limit.toString()); const response = await this.client.get(`/api/samples?${queryParams}`); return response.data.samples.map((s: any) => ({ value: s.value, unit: s.unit, date: s.start_date, source: s.source, })); }

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/lucas-1000/mcp-glucose'

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