list_certificates
Retrieve SSL/TLS certificates for a specific website to monitor security status, search by keyword, filter valid certificates, and manage pagination.
Instructions
Lists certificates of a website.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| siteId | Yes | The website ID. Reference Value Source: list_sites. Example: 1234567890123 | |
| keyword | No | The search keyword. | |
| validOnly | No | Whether to return only valid certificates. | |
| pageNumber | No | The page number of the returned data. | |
| pageSize | No | The number of records per page. |
Implementation Reference
- src/tools/site/certificate.ts:237-246 (handler)The handler function that implements the core logic of the 'list_certificates' tool. It calls the service API with the provided parameters and returns the result as a standardized tool response.export const list_certificates = async (request: CallToolRequest) => { const res = await api.listCertificates( request.params.arguments as ListCertificatesRequest, ); return { content: [{ type: 'text', text: JSON.stringify(res) }], success: true, }; };
- The tool registration object defining the schema, name, description, and input validation for 'list_certificates'.export const LIST_CERTIFICATES_TOOL: Tool = { name: 'list_certificates', description: 'Lists certificates of a website.', inputSchema: { type: 'object', properties: { siteId: { type: 'number', description: 'The website ID. Reference Value Source: list_sites. Example: 1234567890123', }, keyword: { type: 'string', description: 'The search keyword.', }, validOnly: { type: 'boolean', description: 'Whether to return only valid certificates.', }, pageNumber: { type: 'number', description: 'The page number of the returned data.', }, pageSize: { type: 'number', description: 'The number of records per page.', }, }, required: ['siteId'], annotations: {}, }, };
- src/tools/list-esa-function.ts:143-150 (registration)Registration list for certificate tools, including LIST_CERTIFICATES_TOOL.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)Central registration of tool handlers, including 'list_certificates' mapped to its handler function.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:542-551 (helper)Helper method in the API service client that performs the actual listCertificates API call to the ESA service.listCertificates(params: ListCertificatesRequest) { const request = new ListCertificatesRequest(params); return this.callApi( this.client.listCertificates.bind(this.client) as ApiMethod< ListCertificatesRequest, ListCertificatesResponse >, request, ); }