get_certificate
Retrieve SSL/TLS certificates, private keys, and detailed certificate information for a specific website using the site ID and certificate ID through the ESA MCP Server.
Instructions
Retrieve the certificate, private key, and certificate information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Certificate ID. Example: babaded901474b9693acf530e0fb1d95 | |
| siteId | Yes | The website ID. Reference Value Source: list_sites |
Implementation Reference
- src/tools/site/certificate.ts:215-223 (handler)The main handler function for the 'get_certificate' MCP tool. It extracts arguments from the request, calls the underlying API service, stringifies the response, and returns it in the expected MCP format.export const get_certificate = async (request: CallToolRequest) => { const res = await api.getCertificate( request.params.arguments as GetCertificateRequest, ); return { content: [{ type: 'text', text: JSON.stringify(res) }], success: true, };
- src/tools/site/certificate.ts:93-113 (registration)Tool registration exporting GET_CERTIFICATE_TOOL with name, description, and input schema definition.export const GET_CERTIFICATE_TOOL: Tool = { name: 'get_certificate', description: 'Retrieve the certificate, private key, and certificate information', inputSchema: { type: 'object', properties: { siteId: { type: 'number', description: 'The website ID. Reference Value Source: list_sites', }, id: { type: 'string', description: 'Certificate ID. Example: babaded901474b9693acf530e0fb1d95', }, }, required: ['siteId', 'id'], annotations: {}, }, };
- src/tools/list-esa-function.ts:143-150 (registration)Central registration including GET_CERTIFICATE_TOOL in the CERTIFICATE_LIST, which is merged into the full list of ESA tools (ESA_OPENAPI_LIST).export const CERTIFICATE_LIST = [ SET_CERTIFICATE_TOOL, APPLY_CERTIFICATE_TOOL, GET_CERTIFICATE_TOOL, DELETE_CERTIFICATE_TOOL, LIST_CERTIFICATES_TOOL, GET_CERTIFICATE_QUOTA_TOOL, ];
- src/utils/service.ts:520-529 (helper)Helper method in the API client service that wraps the Alibaba Cloud ESA getCertificate API call with request construction and generic callApi invocation.getCertificate(params: GetCertificateRequest) { const request = new GetCertificateRequest(params); return this.callApi( this.client.getCertificate.bind(this.client) as ApiMethod< GetCertificateRequest, GetCertificateResponse >, request, ); }
- src/tools/list-esa-function.ts:164-208 (registration)Maps the imported get_certificate handler function into the esaHandlers object for tool execution dispatching.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, };