list_certificates
Retrieve and filter certificates for a specific website by ID, with options to search by keyword, filter by validity, and manage paginated results.
Instructions
Lists certificates of a website.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| keyword | No | The search keyword. | |
| pageNumber | No | The page number of the returned data. | |
| pageSize | No | The number of records per page. | |
| siteId | Yes | The website ID. Reference Value Source: list_sites. Example: 1234567890123 | |
| validOnly | No | Whether to return only valid certificates. |
Implementation Reference
- src/tools/site/certificate.ts:237-246 (handler)The main handler function for the 'list_certificates' tool. It calls the api.listCertificates method with the provided arguments cast to ListCertificatesRequest and returns the JSON-stringified 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 definition including the input schema for 'list_certificates', specifying parameters like siteId (required), keyword, validOnly, pageNumber, pageSize.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:144-150 (registration)Registration of the LIST_CERTIFICATES_TOOL in the CERTIFICATE_LIST array, which is included in the main ESA_OPENAPI_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)Maps the 'list_certificates' handler function in the esaHandlers object used 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, };
- src/utils/service.ts:542-551 (helper)The underlying API helper method listCertificates that wraps the ESA client call for listing certificates.listCertificates(params: ListCertificatesRequest) { const request = new ListCertificatesRequest(params); return this.callApi( this.client.listCertificates.bind(this.client) as ApiMethod< ListCertificatesRequest, ListCertificatesResponse >, request, ); }