Skip to main content
Glama
stier1ba

LicenseSpring MCP Server

by stier1ba

get_device_variables

Retrieve tracked variables for a specific device by providing its license key, hardware ID, and product name through the LicenseSpring MCP Server integration.

Instructions

Get tracked variables for a device

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hardware_idYes
license_keyYes
productYes

Implementation Reference

  • Complete tool registration, input schema, and handler implementation. The handler constructs query parameters from inputs and fetches device variables from the LicenseSpring API endpoint `/api/v4/get_device_variables`, returning the JSON response or an error.
    server.registerTool('get_device_variables', {
      title: 'Get Device Variables',
      description: 'Get tracked 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'),
      },
    }, async ({ license_key, hardware_id, product }) => {
      try {
        const queryParams = new URLSearchParams({
          license_key,
          hardware_id,
          product,
        });
        const response = await apiClient.get(`/api/v4/get_device_variables?${queryParams}`);
    
        return {
          content: [{
            type: 'text',
            text: JSON.stringify(response.data, null, 2),
          }],
        };
      } catch (error) {
        return {
          content: [{
            type: 'text',
            text: `Error getting device variables: ${handleApiError(error)}`,
          }],
          isError: true,
        };
      }
    });
  • TypeScript interface defining the request parameters for the get_device_variables tool: license_key, hardware_id, and product.
    export interface GetDeviceVariablesRequest {
      license_key: string;
      hardware_id: string;
      product: 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