Skip to main content
Glama
nacos-group

Nacos MCP Server

Official
by nacos-group

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
NameRequiredDescriptionDefault
aggregationNoWhether aggregation from whole cluster, if `false`, only get subscribers from requested node, default `true` if missing
groupNameNoThe groupName pattern of service, default is `DEFAULT_GROUP` if missing
namespaceIdNoThe namespaceId of service, default is `public` if missing
pageNoYesThe current page number, default is 1.
pageSizeYesThe size of subscribers in each page, default is 100
serviceNameYesThe serviceName pattern of service, required.

Implementation Reference

  • 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"], },
  • Registers the NacosListServiceSubscribers tool instance in the MCP server's list_tools() response.
    nacos_tools.NacosListServiceSubscribers(),
  • 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" )

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nacos-group/nacos-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server