get_trial_key
Generate trial license keys for specific products using hardware ID inputs within the LicenseSpring MCP Server for streamlined licensing management.
Instructions
Generate a trial license key for a product
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hardware_id | Yes | ||
| product | Yes |
Implementation Reference
- src/license-api-server.ts:397-427 (registration)Registration of the 'get_trial_key' tool, including inline schema and handler function that proxies to the LicenseSpring API /api/v4/trial_key endpoint.server.registerTool('get_trial_key', { title: 'Get Trial Key', description: 'Generate a trial license key for a product', inputSchema: { hardware_id: z.string().min(1, 'Hardware ID is required'), product: z.string().min(1, 'Product code is required'), }, }, async ({ hardware_id, product }) => { try { const queryParams = new URLSearchParams({ hardware_id, product, }); const response = await apiClient.get(`/api/v4/trial_key?${queryParams}`); return { content: [{ type: 'text', text: JSON.stringify(response.data, null, 2), }], }; } catch (error) { return { content: [{ type: 'text', text: `Error generating trial key: ${handleApiError(error)}`, }], isError: true, }; } });
- src/license-api-server.ts:404-427 (handler)The handler function for 'get_trial_key' which constructs a query with hardware_id and product, calls the LicenseSpring API, and returns the response or formatted error.}, async ({ hardware_id, product }) => { try { const queryParams = new URLSearchParams({ hardware_id, product, }); const response = await apiClient.get(`/api/v4/trial_key?${queryParams}`); return { content: [{ type: 'text', text: JSON.stringify(response.data, null, 2), }], }; } catch (error) { return { content: [{ type: 'text', text: `Error generating trial key: ${handleApiError(error)}`, }], isError: true, }; } });
- src/license-api-server.ts:400-403 (schema)Input schema validation using Zod for required hardware_id and product strings.inputSchema: { hardware_id: z.string().min(1, 'Hardware ID is required'), product: z.string().min(1, 'Product code is required'), },