list_sites
Retrieve and filter site lists under your account, including site names, statuses, configurations, and tags, using customizable search and pagination options.
Instructions
用于查询当前用户下的站点列表 ,包括站点的名称、状态、配置等信息。
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| accessType | No | 接入类型。取值:; - **NS**:通过NS托管接入。; - **CNAME**:通过CNAME接入。 | |
| coverage | No | 加速区域。取值:; - **domestic**:仅中国内地。; - **global**:全球。; - **overseas**:全球(不包含中国内地)。 | |
| onlyEnterprise | No | 仅企业版,传**true**时代表仅查询企业版的站点。 | |
| orderBy | No | 排序字段,默认按照创建时间排序,支持; - gmtCreate:站点创建时间; - visitTime:站点访问时间 | |
| pageNumber | No | 页码。默认值:**1**。 | |
| pageSize | No | 分页大小。默认值:**500**。 | |
| planSubscribeType | No | 套餐订阅类型。取值:; - **basicplan**: 基础版。; - **standardplan**:标准版。; - **advancedplan**:高级版。; - **enterpriseplan**:企业版。 | |
| resourceGroupId | No | 资源组ID。用于查询的过滤条件。 | |
| siteName | No | 站点名称。用于查询的过滤条件。 | |
| siteSearchType | No | 站点名称的搜索匹配模式。默认为精确匹配,取值:; - **prefix**:前缀匹配。; - **suffix**:后缀匹配。; - **exact**:精确匹配。; - **fuzzy**:模糊匹配。 | |
| status | No | 站点状态。用于查询的过滤条件。 | |
| tagFilter | No | 标签过滤规则。 |
Implementation Reference
- src/tools/site/site.ts:232-239 (handler)The main handler function that implements the 'list_sites' tool logic. It receives the tool call request, invokes the underlying API service, and returns the response as a JSON string in the expected MCP tool response format.export const list_sites = async (request: CallToolRequest) => { const res = await api.listSites(request.params.arguments as ListSitesRequest); return { content: [{ type: 'text', text: JSON.stringify(res) }], success: true, }; };
- src/tools/site/site.ts:11-88 (schema)The schema definition for the 'list_sites' tool, including name, description, and detailed input schema with properties for filtering and paginating site lists.export const LIST_SITES_TOOL: Tool = { name: 'list_sites', description: '用于查询当前用户下的站点列表 ,包括站点的名称、状态、配置等信息。', inputSchema: { type: 'object', properties: { siteName: { type: 'string', description: '站点名称。用于查询的过滤条件。', }, siteSearchType: { type: 'string', description: '站点名称的搜索匹配模式。默认为精确匹配,取值:; - **prefix**:前缀匹配。; - **suffix**:后缀匹配。; - **exact**:精确匹配。; - **fuzzy**:模糊匹配。', enum: ['suffix', 'exact', 'prefix', 'fuzzy'], }, pageNumber: { type: 'number', description: '页码。默认值:**1**。', }, pageSize: { type: 'number', description: '分页大小。默认值:**500**。', }, tagFilter: { type: 'array', description: '标签过滤规则。', items: { type: 'object', properties: { key: { type: 'string', description: '标签键,用于查询的过滤条件。', }, value: { type: 'string', description: '标签值,用于查询的过滤条件。', }, }, }, }, resourceGroupId: { type: 'string', description: '资源组ID。用于查询的过滤条件。', }, status: { type: 'string', description: '站点状态。用于查询的过滤条件。', }, onlyEnterprise: { type: 'boolean', description: '仅企业版,传**true**时代表仅查询企业版的站点。', }, planSubscribeType: { type: 'string', description: '套餐订阅类型。取值:; - **basicplan**: 基础版。; - **standardplan**:标准版。; - **advancedplan**:高级版。; - **enterpriseplan**:企业版。', }, coverage: { type: 'string', description: '加速区域。取值:; - **domestic**:仅中国内地。; - **global**:全球。; - **overseas**:全球(不包含中国内地)。', }, accessType: { type: 'string', description: '接入类型。取值:; - **NS**:通过NS托管接入。; - **CNAME**:通过CNAME接入。', }, orderBy: { type: 'string', description: '排序字段,默认按照创建时间排序,支持; - gmtCreate:站点创建时间; - visitTime:站点访问时间', }, }, annotations: {}, }, };
- src/tools/list-esa-function.ts:164-208 (registration)Registration of the 'list_sites' handler in the esaHandlers object, which maps tool names to their handler functions for MCP tool 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/tools/list-esa-function.ts:125-139 (registration)Registration of the 'list_sites' tool schema in the ESA_OPENAPI_SITE_LIST array, likely used for exposing tools in MCP.export const ESA_OPENAPI_SITE_LIST = [ LIST_SITES_TOOL, CREATE_SITE_TOOL, UPDATE_SITE_PAUSE_TOOL, GET_SITE_PAUSE_TOOL, UPDATE_RECORD_TOOL, CREATE_SITE_MX_RECORD_TOOL, CREATE_SITE_NS_RECORD_TOOL, CREATE_SITE_TXT_RECORD_TOOL, CREATE_SITE_CNAME_RECORD_TOOL, CREATE_SITE_A_OR_AAAA_RECORD_TOOL, DELETE_RECORD_TOOL, LIST_RECORDS_TOOL, GET_RECORD_TOOL, ];
- src/utils/service.ts:199-208 (helper)Helper method in the API service client that performs the actual 'listSites' API call to Alibaba Cloud ESA, used by the tool handler.listSites(params: ListSitesRequest) { const request = new ListSitesRequest(params); return this.callApi( this.client.listSites.bind(this.client) as ApiMethod< ListSitesRequest, ListSitesResponse >, request, ); }