Skip to main content
Glama
stier1ba

LicenseSpring MCP Server

by stier1ba

track_device_variables

Monitor and update custom variables for a device using license key, hardware ID, and product details to enhance license management and tracking capabilities.

Instructions

Track custom variables for a device

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hardware_idYes
license_keyYes
productYes
variablesYes

Implementation Reference

  • Handler function that POSTs the license_key, hardware_id, product, and variables to the LicenseSpring API /api/v4/track_device_variables endpoint, returning the JSON response or formatted error.
    }, async ({ license_key, hardware_id, product, variables }) => {
      try {
        const response = await apiClient.post('/api/v4/track_device_variables', {
          license_key,
          hardware_id,
          product,
          variables,
        });
    
        return {
          content: [{
            type: 'text',
            text: JSON.stringify(response.data, null, 2),
          }],
        };
      } catch (error) {
        return {
          content: [{
            type: 'text',
            text: `Error tracking device variables: ${handleApiError(error)}`,
          }],
          isError: true,
        };
      }
    });
  • Input schema definition using Zod validators for the tool parameters: license_key, hardware_id, product, and variables (non-empty record). Includes title and description.
    title: 'Track Device Variables',
    description: 'Track custom variables for a device',
    inputSchema: {
      license_key: z.string().min(1, 'License key is required'),
      hardware_id: z.string().min(1, 'Hardware ID is required'),
      product: z.string().min(1, 'Product code is required'),
      variables: z.record(z.string(), z.string()).refine(obj => Object.keys(obj).length > 0, 'At least one variable is required'),
  • Full registration of the 'track_device_variables' tool with MCP server, including schema, title, description, and inline handler function.
    server.registerTool('track_device_variables', {
      title: 'Track Device Variables',
      description: 'Track custom variables for a device',
      inputSchema: {
        license_key: z.string().min(1, 'License key is required'),
        hardware_id: z.string().min(1, 'Hardware ID is required'),
        product: z.string().min(1, 'Product code is required'),
        variables: z.record(z.string(), z.string()).refine(obj => Object.keys(obj).length > 0, 'At least one variable is required'),
      },
    }, async ({ license_key, hardware_id, product, variables }) => {
      try {
        const response = await apiClient.post('/api/v4/track_device_variables', {
          license_key,
          hardware_id,
          product,
          variables,
        });
    
        return {
          content: [{
            type: 'text',
            text: JSON.stringify(response.data, null, 2),
          }],
        };
      } catch (error) {
        return {
          content: [{
            type: 'text',
            text: `Error tracking device variables: ${handleApiError(error)}`,
          }],
          isError: true,
        };
      }
    });
  • TypeScript interface defining the request shape for TrackDeviceVariablesRequest, matching the tool input.
    export interface TrackDeviceVariablesRequest {
      license_key: string;
      hardware_id: string;
      product: string;
      variables: Record<string, string>;
    }

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/stier1ba/licensespring-mcp'

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