apply_certificate
Apply for a free SSL certificate by specifying site ID, domains, and certificate type to secure website connections.
Instructions
Applies for a free SSL certificate.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| siteId | Yes | Site ID. Example: 1234567890123. Reference Value Source: list_sites | |
| domains | Yes | The list of domain names, separated by commas. Example: "example.com,www.example.com" | |
| type | Yes | The type of certificate. Possible values: - lets_encrypt (Let's Encrypt certificate) - digicert_single (Digicert single-domain certificate) - digicert_wildcard (Digicert wildcard certificate) |
Implementation Reference
- src/tools/site/certificate.ts:204-213 (handler)The primary handler function implementing the logic for the 'apply_certificate' MCP tool. It invokes the API service with the provided arguments and formats the response.export const apply_certificate = async (request: CallToolRequest) => { const res = await api.applyCertificate( request.params.arguments as ApplyCertificateRequest, ); return { content: [{ type: 'text', text: JSON.stringify(res) }], success: true, }; };
- src/tools/site/certificate.ts:64-90 (registration)Tool registration object APPLY_CERTIFICATE_TOOL defining the name, description, and input schema for validation.export const APPLY_CERTIFICATE_TOOL: Tool = { name: 'apply_certificate', description: 'Applies for a free SSL certificate.', inputSchema: { type: 'object', properties: { siteId: { type: 'number', description: 'Site ID. Example: 1234567890123. Reference Value Source: list_sites', }, domains: { type: 'string', description: 'The list of domain names, separated by commas. Example: "example.com,www.example.com"', }, type: { type: 'string', description: "The type of certificate. Possible values: - lets_encrypt (Let's Encrypt certificate) - digicert_single (Digicert single-domain certificate) - digicert_wildcard (Digicert wildcard certificate) ", }, }, required: ['siteId', 'domains', 'type'], annotations: {}, }, };
- src/tools/list-esa-function.ts:143-150 (registration)Registration of APPLY_CERTIFICATE_TOOL in the CERTIFICATE_LIST array, which is merged into the main ESA_OPENAPI_LIST of tools.export const CERTIFICATE_LIST = [ SET_CERTIFICATE_TOOL, APPLY_CERTIFICATE_TOOL, GET_CERTIFICATE_TOOL, DELETE_CERTIFICATE_TOOL, LIST_CERTIFICATES_TOOL, GET_CERTIFICATE_QUOTA_TOOL, ];
- src/tools/list-esa-function.ts:164-208 (registration)Mapping of the 'apply_certificate' handler function in the esaHandlers object for tool dispatch.export const esaHandlers: ToolHandlers = { site_active_list, site_match, site_route_list, site_record_list, routine_create, routine_code_commit, routine_delete, routine_list, routine_get, routine_code_deploy, routine_route_list, deployment_delete, route_create, route_delete, route_update, route_get, er_record_create, er_record_delete, er_record_list, html_deploy, create_site, update_site_pause, get_site_pause, create_site_mx_record, create_site_ns_record, create_site_txt_record, create_site_cname_record, create_site_a_or_aaaa_record, update_record, list_records, get_record, delete_record, update_ipv6, get_ipv6, update_managed_transform, get_managed_transform, set_certificate, apply_certificate, get_certificate, delete_certificate, list_certificates, get_certificate_quota, list_sites, };
- src/utils/service.ts:509-518 (helper)Supporting API wrapper method 'applyCertificate' in the service client that constructs the request and calls the Alibaba Cloud ESA SDK client.applyCertificate(params: ApplyCertificateRequest) { const request = new ApplyCertificateRequest(params); return this.callApi( this.client.applyCertificate.bind(this.client) as ApiMethod< ApplyCertificateRequest, ApplyCertificateResponse >, request, ); }