thunderclient_remove_license
Remove Thunder Client licenses for specified email addresses using the API tool. Manage license assignments efficiently by inputting valid email addresses for removal.
Instructions
Remove Thunder Client licenses for specified email addresses
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| emails | Yes | Array of email addresses to remove licenses for |
Input Schema (JSON Schema)
{
"properties": {
"emails": {
"description": "Array of email addresses to remove licenses for",
"items": {
"format": "email",
"type": "string"
},
"minItems": 1,
"type": "array"
}
},
"required": [
"emails"
],
"type": "object"
}
Implementation Reference
- src/api-client.ts:187-222 (handler)Core implementation of the tool: sends POST request to Thunder Client API /api/license/remove with accountNumber and emails to remove licenses.async removeLicense(request: RemoveLicenseRequest): Promise<ApiResponse> { const url = `${this.config.baseUrl}/api/license/remove`; const body = { accountNumber: this.getAccountNumber(), emails: request.emails }; try { const response = await fetch(url, { method: 'POST', headers: this.getHeaders('application/json'), body: JSON.stringify(body) }); const data = await response.json().catch(() => ({})); if (!response.ok) { return { success: false, error: `HTTP ${response.status}: ${response.statusText}`, data }; } return { success: true, data, message: `Successfully removed licenses for ${request.emails.length} email(s)` }; } catch (error) { return { success: false, error: `Request failed: ${error instanceof Error ? error.message : String(error)}` }; } }
- src/index.ts:169-187 (handler)MCP tool call handler: validates input, delegates to API client, and formats response.case 'thunderclient_remove_license': { const removeRequest = (args || {}) as unknown as RemoveLicenseRequest; if (!removeRequest.emails || !Array.isArray(removeRequest.emails) || removeRequest.emails.length === 0) { throw new McpError( ErrorCode.InvalidParams, 'emails array is required and must contain at least one email address' ); } const result = await this.apiClient.removeLicense(removeRequest); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
- src/index.ts:107-125 (registration)Registers the tool with MCP server: defines name, description, and input schema.{ name: 'thunderclient_remove_license', description: 'Remove Thunder Client licenses for specified email addresses', inputSchema: { type: 'object', properties: { emails: { type: 'array', items: { type: 'string', format: 'email', }, description: 'Array of email addresses to remove licenses for', minItems: 1, }, }, required: ['emails'], }, },
- src/types.ts:14-16 (schema)Type definition for the tool input: array of email strings.export interface RemoveLicenseRequest { emails: string[]; }