Skip to main content
Glama

add_feature_consumption

Increase consumption units for a specific feature tied to a license key, hardware ID, and product in the LicenseSpring MCP Server.

Instructions

Add consumption units to a specific feature

Input Schema

NameRequiredDescriptionDefault
consumptionsYes
featureYes
hardware_idYes
license_keyYes
productYes

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "consumptions": { "minimum": 1, "type": "number" }, "feature": { "minLength": 1, "type": "string" }, "hardware_id": { "minLength": 1, "type": "string" }, "license_key": { "minLength": 1, "type": "string" }, "product": { "minLength": 1, "type": "string" } }, "required": [ "license_key", "hardware_id", "product", "feature", "consumptions" ], "type": "object" }

Implementation Reference

  • The main handler function for the 'add_feature_consumption' tool. It validates input (via schema), makes a POST request to the LicenseSpring API endpoint '/api/v4/add_feature_consumption', and returns the JSON response or an error message.
    }, async ({ license_key, hardware_id, product, feature, consumptions }) => { try { const response = await apiClient.post('/api/v4/add_feature_consumption', { license_key, hardware_id, product, feature, consumptions, }); return { content: [{ type: 'text', text: JSON.stringify(response.data, null, 2), }], }; } catch (error) { return { content: [{ type: 'text', text: `Error adding feature consumption: ${handleApiError(error)}`, }], isError: true, }; } });
  • Zod-based input schema for validating the parameters required by the add_feature_consumption tool.
    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'), feature: z.string().min(1, 'Feature code is required'), consumptions: z.number().min(1, 'Consumption units must be positive'), },
  • MCP server tool registration call, including title, description, input schema, and inline handler function.
    server.registerTool('add_feature_consumption', { title: 'Add Feature Consumption', description: 'Add consumption units to a specific feature', 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'), feature: z.string().min(1, 'Feature code is required'), consumptions: z.number().min(1, 'Consumption units must be positive'), }, }, async ({ license_key, hardware_id, product, feature, consumptions }) => { try { const response = await apiClient.post('/api/v4/add_feature_consumption', { license_key, hardware_id, product, feature, consumptions, }); return { content: [{ type: 'text', text: JSON.stringify(response.data, null, 2), }], }; } catch (error) { return { content: [{ type: 'text', text: `Error adding feature consumption: ${handleApiError(error)}`, }], isError: true, }; } });
  • TypeScript type definition for the AddFeatureConsumptionRequest interface, matching the tool's input parameters.
    export interface AddFeatureConsumptionRequest { license_key: string; hardware_id: string; product: string; feature: string; consumptions: number; }

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