list_service_subscribers
Retrieve a paginated list of subscribers for a specified service in Nacos MCP Server, filtering by namespace, group, and aggregation preferences.
Instructions
This interface retrieves the list of subscribers for a specified service.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| aggregation | No | Whether aggregation from whole cluster, if `false`, only get subscribers from requested node, default `true` if missing | |
| groupName | No | The groupName pattern of service, default is `DEFAULT_GROUP` if missing | |
| namespaceId | No | The namespaceId of service, default is `public` if missing | |
| pageNo | Yes | The current page number, default is 1. | |
| pageSize | Yes | The size of subscribers in each page, default is 100 | |
| serviceName | Yes | The serviceName pattern of service, required. |
Implementation Reference
- src/mcp_server_nacos/server.py:108-111 (handler)Handler logic for the 'list_service_subscribers' tool: retrieves the configured Nacos API URL and performs an HTTP GET request with the input arguments, returning the response as text.case nacos_tools.NacosToolNames.LIST_SERVICE_SUBSCRIBERS: url = nacos_tools.NacosListServiceSubscribers().url result = nacos.get(name, url, arguments) return [types.TextContent(type="text", text=result)]
- Input schema defining parameters for listing service subscribers: pageNo, pageSize (required), namespaceId, groupName, serviceName (required), aggregation.inputSchema={ "type": "object", "properties": { "pageNo": {"type": "int", "description": "The current page number, default is 1."}, "pageSize": {"type": "int", "description": "The size of subscribers in each page, default is 100"}, "namespaceId": {"type": "string", "description": "The namespaceId of service, default is `public` if missing"}, "groupName": {"type": "string", "description": "The groupName pattern of service, default is `DEFAULT_GROUP` if missing"}, "serviceName": {"type": "string", "description": "The serviceName pattern of service, required."}, "aggregation": {"type": "bool", "description": "Whether aggregation from whole cluster, if `false`, only get subscribers from requested node, default `true` if missing"} }, "required": ["pageNo", "pageSize", "serviceName"], },
- src/mcp_server_nacos/server.py:79-79 (registration)Registers the NacosListServiceSubscribers tool instance in the MCP server's list_tools() response.nacos_tools.NacosListServiceSubscribers(),
- src/mcp_server_nacos/nacos_tools.py:266-266 (registration)Defines the string name constant for the 'list_service_subscribers' tool in NacosToolNames enum.LIST_SERVICE_SUBSCRIBERS = "list_service_subscribers",
- Core tool class definition: inherits from NacosTool, sets tool name, description, input schema, and the specific Nacos API endpoint URL for listing service subscribers.class NacosListServiceSubscribers(NacosTool): def __init__(self): super().__init__( name=NacosToolNames.LIST_SERVICE_SUBSCRIBERS, description="This interface retrieves the list of subscribers for a specified service.", inputSchema={ "type": "object", "properties": { "pageNo": {"type": "int", "description": "The current page number, default is 1."}, "pageSize": {"type": "int", "description": "The size of subscribers in each page, default is 100"}, "namespaceId": {"type": "string", "description": "The namespaceId of service, default is `public` if missing"}, "groupName": {"type": "string", "description": "The groupName pattern of service, default is `DEFAULT_GROUP` if missing"}, "serviceName": {"type": "string", "description": "The serviceName pattern of service, required."}, "aggregation": {"type": "bool", "description": "Whether aggregation from whole cluster, if `false`, only get subscribers from requested node, default `true` if missing"} }, "required": ["pageNo", "pageSize", "serviceName"], }, url="/nacos/v3/admin/ns/service/subscribers" )