thunderclient_add_license
Add Thunder Client licenses for specified email addresses using the MCP Server's API. Simplify license management with this tool to ensure access for authorized users.
Instructions
Add Thunder Client licenses for specified email addresses
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| emails | Yes | Array of email addresses to add licenses for |
Input Schema (JSON Schema)
{
"properties": {
"emails": {
"description": "Array of email addresses to add licenses for",
"items": {
"format": "email",
"type": "string"
},
"minItems": 1,
"type": "array"
}
},
"required": [
"emails"
],
"type": "object"
}
Implementation Reference
- src/api-client.ts:38-73 (handler)Core implementation of the thunderclient_add_license tool: sends POST request to Thunder Client API to add licenses for given emails.async addLicense(request: AddLicenseRequest): Promise<ApiResponse> { const url = `${this.config.baseUrl}/api/license/add`; 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 added 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:136-154 (handler)MCP CallToolRequestSchema handler case for thunderclient_add_license: validates input and calls the API client.case 'thunderclient_add_license': { const addRequest = (args || {}) as unknown as AddLicenseRequest; if (!addRequest.emails || !Array.isArray(addRequest.emails) || addRequest.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.addLicense(addRequest); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
- src/index.ts:73-91 (registration)Tool registration in the ListTools response, defining name, description, and input schema.{ name: 'thunderclient_add_license', description: 'Add 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 add licenses for', minItems: 1, }, }, required: ['emails'], }, },
- src/types.ts:6-8 (schema)TypeScript interface defining the input shape for addLicense request, matching the tool's inputSchema.export interface AddLicenseRequest { emails: string[]; }