Skip to main content
Glama
lucas-1000

MCP Glucose Server

by lucas-1000

get_latest_glucose

Retrieve the most recent glucose reading for a user, including value, unit, timestamp, and source, to monitor blood sugar levels for diabetes management.

Instructions

Get the most recent glucose/blood sugar reading for a user. Returns value, unit, timestamp, and source.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
userIdNoUser identifier. Defaults to user_12345abcdef67890 if not specified.

Implementation Reference

  • Core handler implementation in HealthDataAPI class. Fetches the latest glucose reading via HTTP GET to backend /api/samples/latest endpoint, handles 404 by returning null, maps response to GlucoseReading interface.
    async getLatestGlucose(userId: string): Promise<GlucoseReading | null> {
      try {
        const response = await this.client.get('/api/samples/latest', {
          params: {
            userId,
            type: 'BloodGlucose',
          },
        });
    
        const sample = response.data;
        return {
          value: sample.value,
          unit: sample.unit,
          date: sample.start_date,
          source: sample.source,
        };
      } catch (error: any) {
        if (error.response?.status === 404) {
          return null;
        }
        throw error;
      }
    }
  • Type definition for GlucoseReading, used as return type for getLatestGlucose and structure for response data.
    export interface GlucoseReading {
      value: number;
      unit: string;
      date: string;
      source: string;
  • src/index.ts:57-71 (registration)
    MCP Tool registration in stdio server, defines name, description, and input schema for get_latest_glucose.
    {
      name: 'get_latest_glucose',
      description:
        'Get the most recent glucose/blood sugar reading for a user. Returns value, unit, timestamp, and source.',
      inputSchema: {
        type: 'object',
        properties: {
          userId: {
            type: 'string',
            description: `User identifier. Defaults to ${DEFAULT_USER_ID || 'configured user'} if not specified.`,
          },
        },
        required: [],
      },
    },
  • MCP tool call dispatcher in stdio server. Calls api.getLatestGlucose, handles null response, formats JSON output for MCP response.
    case 'get_latest_glucose': {
      const reading = await api.getLatestGlucose(userId);
    
      if (!reading) {
        return {
          content: [
            {
              type: 'text',
              text: 'No glucose readings found for this user.',
            },
          ],
        };
      }
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(
              {
                value: reading.value,
                unit: reading.unit,
                date: reading.date,
                source: reading.source,
              },
              null,
              2
            ),
          },
        ],
      };
    }
  • MCP Tool registration in HTTP SSE server.
    name: 'get_latest_glucose',
    description:
      'Get the most recent glucose/blood sugar reading for a user. Returns value, unit, timestamp, and source.',
    inputSchema: {
      type: 'object',
      properties: {
        userId: {
          type: 'string',
          description: `User identifier. Defaults to ${DEFAULT_USER_ID || 'configured user'} if not specified.`,
        },
      },
      required: [],
    },
Behavior3/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It describes the return format (value, unit, timestamp, source) which is helpful, but doesn't mention authentication requirements, error conditions, rate limits, or whether this is a read-only operation. The description adds some behavioral context but leaves significant gaps.

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

Conciseness5/5

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

The description is perfectly concise with two sentences that each serve distinct purposes: the first states the tool's function and scope, the second specifies the return format. There's no wasted language, and the information is front-loaded with the core purpose stated immediately.

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?

For a simple read operation with one parameter and no output schema, the description provides adequate but minimal information. It explains what data is returned but doesn't cover authentication, error handling, or data freshness. Given the lack of annotations and output schema, more behavioral context would be helpful for a complete understanding.

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

Parameters4/5

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

Schema description coverage is 100%, so the schema already fully documents the userId parameter. The description doesn't add any parameter-specific information beyond what's in the schema, but with only one parameter that has complete schema documentation, this is acceptable. The baseline for high schema coverage is 3, but the description's clarity about what the tool does provides good overall context.

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

Purpose5/5

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

The description clearly states the specific action ('Get the most recent glucose/blood sugar reading'), identifies the resource ('for a user'), and distinguishes from siblings by specifying it returns only the latest reading rather than multiple readings or statistics. It explicitly mentions what data is returned (value, unit, timestamp, source).

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

Usage Guidelines4/5

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

The description implies usage context by specifying 'most recent' reading, suggesting this tool should be used when only the latest data point is needed. However, it doesn't explicitly state when to use alternatives like get_glucose_readings (for historical data) or get_glucose_stats (for aggregated metrics), leaving some ambiguity about sibling tool differentiation.

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