Skip to main content
Glama
nacos-group

Nacos MCP Server

Official
by nacos-group

list_config_listeners

Retrieve listeners subscribed to a specific Nacos configuration by providing groupName and dataId parameters. This tool helps monitor which clients are actively receiving configuration updates.

Instructions

This interface retrieves the list of listeners subscribed to a specific configuration.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
namespaceIdNoThe namespaceId of configs, default is `public` if missing
groupNameYesThe groupName of config, Required.
dataIdYesThe dataId of config, Required.
aggregationNoWhether aggregation from whole cluster, if `false`, only get listeners from requested node, default `true` if missing

Implementation Reference

  • The specific case handler in the call_tool function that retrieves the tool URL and executes the Nacos API request for listing configuration listeners.
    case nacos_tools.NacosToolNames.LIST_CONFIG_LISTENERS: url = nacos_tools.NacosListConfigListeners().url result = nacos.get(name, url, arguments) return [types.TextContent(type="text", text=result)]
  • Class defining the tool schema, including input parameters (namespaceId, groupName, dataId, aggregation), description, and the Nacos API endpoint URL.
    class NacosListConfigListeners(NacosTool): def __init__(self): super().__init__( name=NacosToolNames.LIST_CONFIG_LISTENERS, description="This interface retrieves the list of listeners subscribed to a specific configuration.", inputSchema={ "type": "object", "properties": { "namespaceId": {"type": "string", "description": "The namespaceId of configs, default is `public` if missing"}, "groupName": {"type": "string", "description": "The groupName of config, Required."}, "dataId": {"type": "string", "description": "The dataId of config, Required."}, "aggregation": {"type": "bool", "description": "Whether aggregation from whole cluster, if `false`, only get listeners from requested node, default `true` if missing"} }, "required": ["groupName", "dataId"], }, url="/nacos/v3/admin/cs/config/listener" )
  • Tool registration in the list_tools handler, where an instance of NacosListConfigListeners is returned as part of the available tools list.
    @server.list_tools() async def handle_list_tools() -> list[types.Tool]: """List available tools""" return [ nacos_tools.NacosListNamespacesTool(), nacos_tools.NacosListServices(), nacos_tools.NacosGetService(), nacos_tools.NacosListInstances(), nacos_tools.NacosListServiceSubscribers(), nacos_tools.NacosListConfigs(), nacos_tools.NacosGetConfig(), nacos_tools.NacosListConfigHistory(), nacos_tools.NacosGetConfigHistory(), nacos_tools.NacosListConfigListeners(), nacos_tools.NacosListListenedConfigs(), ]
  • Enum definition assigning the tool name 'list_config_listeners' used for matching in handlers and registration.
    LIST_CONFIG_LISTENERS = "list_config_listeners",
  • Helper method in NacosServer that performs the actual HTTP GET request to the Nacos API, used by all tool handlers including list_config_listeners.
    def get(self, name:str, url: str, params: Any = None) -> str: url = f'http://{self.host}:{self.port}{url}' logger.debug(f'GET {url} with params {params}') result = self._request(url, params=params) if result is None: return "Unexpected error: None result handled." if result.is_success(): return str(result.data) return f'Do {name} failed with message: {result.message}'

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