Skip to main content
Glama

get_sensor_info

Read-only

Check your active FreeStyle Libre sensor status, serial number, and activation date to determine if the sensor is working properly or requires replacement.

Instructions

Get information about your active FreeStyle Libre sensor including serial number, activation date, and status. Use this to check if sensor is working properly or needs replacement.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The MCP tool handler for 'get_sensor_info'. It checks if the client is initialized, calls client.getSensorInfo(), and returns the formatted response with active_sensors and sensor_count.
    case 'get_sensor_info': {
      if (!client) {
        throw new Error('LibreLinkUp not configured. Use configure_credentials first.');
      }
    
      const sensors = await client.getSensorInfo();
    
      return {
        content: [{
          type: 'text',
          text: JSON.stringify({
            active_sensors: sensors,
            sensor_count: sensors.length
          }, null, 2)
        }]
      };
    }
  • src/index.ts:145-156 (registration)
    The tool registration definition for 'get_sensor_info'. Declares name, description, empty inputSchema (no parameters), and readOnlyHint annotation in the tools array.
    {
      name: 'get_sensor_info',
      description: 'Get information about your active FreeStyle Libre sensor including serial number, activation date, and status. Use this to check if sensor is working properly or needs replacement.',
      inputSchema: {
        type: 'object',
        properties: {},
        required: []
      },
      annotations: {
        readOnlyHint: true
      }
    },
  • The getSensorInfo() method on LibreLinkClient. Fetches graph data, maps activeSensors to SensorInfo objects computing activation and expiration timestamps assuming 15-day sensor lifetime.
    async getSensorInfo(): Promise<SensorInfo[]> {
      const data = await this.getGraphData();
    
      return data.activeSensors.map(s => {
        // a is Unix timestamp in seconds (when sensor became active after warm-up)
        const activatedTimestamp = s.sensor.a * 1000; // Convert to milliseconds
    
        // Sensor lifetime depends on product type:
        // - Libre 2 Plus: 15 days
        // - Libre 3: 14 days
        // - Libre 2: 14 days
        // The 'w' field is NOT the lifetime - default to 15 days for Libre 2 Plus
        const SENSOR_LIFETIME_DAYS = 15;
        const expiresTimestamp = activatedTimestamp + (SENSOR_LIFETIME_DAYS * 24 * 60 * 60 * 1000);
    
        return {
          sn: s.sensor.sn,
          activatedOn: new Date(activatedTimestamp).toISOString(),
          expiresOn: new Date(expiresTimestamp).toISOString(),
          status: 'active'
        };
      });
    }
  • The SensorInfo interface defining the shape: sn (serial number), activatedOn, expiresOn (ISO strings), and status.
    export interface SensorInfo {
      sn: string;
      activatedOn: string;
      expiresOn: string;
      status: string;
    }
Behavior4/5

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

Annotations already provide readOnlyHint=true, so agent knows it's safe. Description adds that it pertains to the 'active' sensor and lists specific fields returned, providing useful behavioral context beyond annotations. No surprising side effects are implied.

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, front-loaded with key purpose and a follow-up usage hint. No unnecessary words; each sentence earns its place.

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 the tool's simplicity (zero parameters, read-only), the description fully covers purpose, output (listing serial number, activation date, status), and usage scenario. No output schema exists, but the description compensates sufficiently.

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 exist; schema coverage is 100% by default. The description does not need to add parameter information. The baseline for 0 parameters is 4, and the description fulfills it without redundancy.

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 uses specific verb 'Get information' and clearly identifies the resource ('active FreeStyle Libre sensor') with concrete details (serial number, activation date, status). It distinguishes from sibling tools like get_current_glucose and get_glucose_history by focusing on sensor metadata rather than glucose readings.

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 when to use: 'check if sensor is working properly or needs replacement.' Does not provide explicit alternatives or when-not-to-use, but given the sibling tools cover other aspects, the usage context is clear.

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