deactivate_license
Deactivate a license linked to a specific hardware ID by providing the license key, hardware ID, and product details. Ensure license management integrity and compliance.
Instructions
Deactivate a license for a specific hardware ID
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hardware_id | Yes | ||
| license_key | Yes | ||
| product | Yes |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"hardware_id": {
"minLength": 1,
"type": "string"
},
"license_key": {
"minLength": 1,
"type": "string"
},
"product": {
"minLength": 1,
"type": "string"
}
},
"required": [
"license_key",
"hardware_id",
"product"
],
"type": "object"
}
Implementation Reference
- src/license-api-server.ts:296-319 (handler)The tool handler function that performs the POST request to the LicenseSpring API to deactivate the license using the provided license_key, hardware_id, and product.}, async ({ license_key, hardware_id, product }) => { try { const response = await apiClient.post('/api/v4/deactivate_license', { license_key, hardware_id, product, }); return { content: [{ type: 'text', text: JSON.stringify(response.data, null, 2), }], }; } catch (error) { return { content: [{ type: 'text', text: `Error deactivating license: ${handleApiError(error)}`, }], isError: true, }; } });
- src/license-api-server.ts:291-295 (schema)Inline Zod schema defining the input parameters for the deactivate_license 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'), },
- src/license-api-server.ts:288-319 (registration)Registration of the deactivate_license tool with the MCP server, including title, description, input schema, and handler function.server.registerTool('deactivate_license', { title: 'Deactivate License', description: 'Deactivate a license for a specific hardware ID', 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 response = await apiClient.post('/api/v4/deactivate_license', { license_key, hardware_id, product, }); return { content: [{ type: 'text', text: JSON.stringify(response.data, null, 2), }], }; } catch (error) { return { content: [{ type: 'text', text: `Error deactivating license: ${handleApiError(error)}`, }], isError: true, }; } });
- src/types/index.ts:103-107 (schema)TypeScript interface defining the request structure for deactivating a license.export interface DeactivateLicenseRequest { license_key: string; hardware_id: string; product: string; }