Skip to main content
Glama

get_current_glucose

Read-only

Retrieve the most recent glucose reading from your FreeStyle Libre sensor. Returns current mg/dL value, trend direction, and whether within target range for real-time monitoring.

Instructions

Get the most recent glucose reading from your FreeStyle Libre sensor. Returns current glucose value in mg/dL, trend direction (rising/falling/stable), and whether the value is in target range. Use this for real-time glucose monitoring.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Main tool handler for 'get_current_glucose'. Calls client.getCurrentGlucose() and returns a JSON response with current_glucose, timestamp, trend, status, and color.
    case 'get_current_glucose': {
      if (!client) {
        throw new Error('LibreLinkUp not configured. Use configure_credentials first.');
      }
    
      const reading = await client.getCurrentGlucose();
    
      return {
        content: [{
          type: 'text',
          text: JSON.stringify({
            current_glucose: reading.value,
            timestamp: reading.timestamp,
            trend: reading.trend,
            status: reading.isHigh ? 'High' : reading.isLow ? 'Low' : 'Normal',
            color: reading.color
          }, null, 2)
        }]
      };
    }
  • Tool definition and input schema for 'get_current_glucose'. Has an empty input schema (no parameters) and readOnlyHint annotation.
    const tools = [
      {
        name: 'get_current_glucose',
        description: 'Get the most recent glucose reading from your FreeStyle Libre sensor. Returns current glucose value in mg/dL, trend direction (rising/falling/stable), and whether the value is in target range. Use this for real-time glucose monitoring.',
        inputSchema: {
          type: 'object',
          properties: {},
          required: []
        },
        annotations: {
          readOnlyHint: true
        }
  • LibreLinkClient.getCurrentGlucose() method. Fetches graph data and maps the current glucose measurement to a GlucoseReading via mapGlucoseItem().
    /**
     * Get current glucose reading
     */
    async getCurrentGlucose(): Promise<GlucoseReading> {
      const data = await this.getGraphData();
      const current = data.connection.glucoseMeasurement;
    
      return mapGlucoseItem(current, this.config.targetLow, this.config.targetHigh);
    }
  • mapGlucoseItem() helper that transforms raw API data (RawGlucoseItem) into a GlucoseReading with value, timestamp, trend, isHigh/isLow flags, and color.
    /**
     * Convert raw glucose item to GlucoseReading
     */
    function mapGlucoseItem(item: RawGlucoseItem, targetLow: number, targetHigh: number): GlucoseReading {
      return {
        value: item.ValueInMgPerDl,
        timestamp: item.Timestamp,
        trend: TREND_MAP[item.TrendArrow || 3] || 'Flat',
        trendArrow: item.TrendArrow || 3,
        isHigh: item.isHigh,
        isLow: item.isLow,
        color: getGlucoseColor(item.ValueInMgPerDl, targetLow, targetHigh)
      };
    }
  • src/index.ts:243-245 (registration)
    Tool registration via ListToolsRequestSchema handler. Returns the tools array (which includes get_current_glucose) in response to list requests.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return { tools };
    });
Behavior4/5

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

Annotations already declare readOnlyHint=true. Description adds value by detailing the return data (value in mg/dL, trend direction, in-range status). No contradictions, good disclosure beyond annotations.

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?

Two sentences, no unnecessary words. Information is front-loaded and each sentence adds value. Perfectly concise.

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

Completeness5/5

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

Given zero parameters, no output schema, and simple read nature, the description covers all necessary context: what it returns and when to use it. No gaps.

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?

No parameters in input schema, schema description coverage is 100% (empty). Description correctly omits parameter info. Baseline score of 4 applies per guidelines.

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?

Description clearly states verb 'Get', resource 'most recent glucose reading', and source 'FreeStyle Libre sensor'. It distinguishes from siblings like get_glucose_history (historical data) and get_glucose_stats (statistics).

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?

Explicitly states 'Use this for real-time glucose monitoring', providing clear usage context. Does not include explicit when-not-to-use or alternatives, but the sibling list and context make it obvious.

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/sedoglia/librelink-mcp-server'

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