get_versions
Retrieve available software versions for a product using license key, hardware ID, and product details. Integrates with LicenseSpring MCP Server for streamlined license management.
Instructions
Get available software versions for a product
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hardware_id | Yes | ||
| license_key | Yes | ||
| product | Yes |
Implementation Reference
- src/license-api-server.ts:635-659 (handler)The handler function for the 'get_versions' tool. It takes license_key, hardware_id, and product as input, makes a GET request to the LicenseSpring API /api/v4/versions endpoint with these as query parameters, and returns the JSON response or an error message.}, async ({ license_key, hardware_id, product }) => { try { const queryParams = new URLSearchParams({ license_key, hardware_id, product, }); const response = await apiClient.get(`/api/v4/versions?${queryParams}`); return { content: [{ type: 'text', text: JSON.stringify(response.data, null, 2), }], }; } catch (error) { return { content: [{ type: 'text', text: `Error getting versions: ${handleApiError(error)}`, }], isError: true, }; } });
- src/license-api-server.ts:630-634 (schema)The input schema for the 'get_versions' tool defined using Zod (z), validating the required string parameters: license_key, hardware_id, and product.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'), },
- src/license-api-server.ts:627-659 (registration)The registration of the 'get_versions' MCP tool on the server, including title, description, input schema, and inline handler function.server.registerTool('get_versions', { title: 'Get Software Versions', description: 'Get available software versions for a product', 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/versions?${queryParams}`); return { content: [{ type: 'text', text: JSON.stringify(response.data, null, 2), }], }; } catch (error) { return { content: [{ type: 'text', text: `Error getting versions: ${handleApiError(error)}`, }], isError: true, }; } });