get_config
Retrieve configuration details from Nacos by specifying group name and data ID to access application settings and parameters.
Instructions
This interface retrieves the details of the specified configuration.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| namespaceId | No | The namespaceId of configs, default is `public` if missing | |
| groupName | Yes | The groupName of config, Required. | |
| dataId | Yes | The dataId of config, Required. |
Implementation Reference
- src/mcp_server_nacos/server.py:116-119 (handler)Handler case in call_tool function that executes the get_config tool by fetching the API URL and making an HTTP GET request to Nacos with the input arguments.case nacos_tools.NacosToolNames.GET_CONFIG: url = nacos_tools.NacosGetConfig().url result = nacos.get(name, url, arguments) return [types.TextContent(type="text", text=result)]
- NacosGetConfig class defining the tool schema, input parameters (namespaceId, groupName, dataId), description, and the Nacos API endpoint URL.class NacosGetConfig(NacosTool): def __init__(self): super().__init__( name=NacosToolNames.GET_CONFIG, description="This interface retrieves the details of the specified 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."} }, "required": ["groupName", "dataId"], }, url="/nacos/v3/admin/cs/config" )
- src/mcp_server_nacos/server.py:74-86 (registration)Registration of the get_config tool (NacosGetConfig) in the list_tools handler, returned as part of the available tools list.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 mapping NacosToolNames.GET_CONFIG to the string 'get_config' used for tool identification.GET_CONFIG = "get_config",