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,
      }));
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool returns glucose values in mg/dL with timestamps and sources, which is useful. However, it lacks critical behavioral details such as whether this is a read-only operation, any authentication requirements, rate limits, error conditions, or pagination behavior (though the 'limit' parameter hints at this). The description is minimal and does not fully compensate for the absence of annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and front-loaded, consisting of two sentences that directly state the tool's purpose and return format. There is no wasted text, and it efficiently communicates the core functionality. However, it could be slightly improved by structuring usage guidelines or behavioral details more explicitly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (4 parameters, no annotations, no output schema), the description is partially complete. It covers the basic purpose and return format but lacks details on behavioral traits, usage guidelines, and error handling. The absence of an output schema means the description should ideally explain return values more thoroughly, which it does not. It is adequate but has clear gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, providing clear details for all parameters (userId, startDate, endDate, limit). The description adds no additional parameter semantics beyond what the schema already documents. According to the rules, with high schema coverage (>80%), the baseline score is 3 when no param info is added in the description, which applies here.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Get glucose/blood sugar readings for a user within a date range.' It specifies the verb ('Get'), resource ('glucose/blood sugar readings'), and scope ('for a user within a date range'), but does not explicitly differentiate it from sibling tools like 'get_glucose_stats' or 'get_latest_glucose' beyond implying it returns multiple readings with timestamps.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It mentions date ranges and returns glucose values, but does not specify scenarios where this tool is preferred over 'get_glucose_stats' (which likely provides aggregated statistics) or 'get_latest_glucose' (which likely returns only the most recent reading). No exclusions or prerequisites are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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