get_config_history
Retrieve specific historical configuration change records from Nacos to track modifications, identify issues, and maintain configuration integrity.
Instructions
This interface retrieves a specific historical change record of a 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. | |
| nid | No | the actual id of config history record, Get from list config history api/tool, `id` field. |
Implementation Reference
- src/mcp_server_nacos/server.py:124-127 (handler)Executes the "get_config_history" tool by instantiating the tool class to get its URL, then calling NacosServer.get() with the tool name, URL, and input arguments to perform the HTTP GET request to Nacos API.case nacos_tools.NacosToolNames.GET_CONFIG_HISTORY: url = nacos_tools.NacosGetConfigHistory().url result = nacos.get(name, url, arguments) return [types.TextContent(type="text", text=result)]
- Defines the tool schema, name, description, input parameters validation (namespaceId optional, groupName/dataId required, nid optional), and the Nacos API endpoint URL "/nacos/v3/admin/cs/history".class NacosGetConfigHistory(NacosTool): def __init__(self): super().__init__( name=NacosToolNames.GET_CONFIG_HISTORY, description="This interface retrieves a specific historical change record of a 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."}, "nid": {"type": "long", "description": "the actual id of config history record, Get from list config history api/tool, `id` field."}, }, "required": ["groupName", "dataId"], }, url="/nacos/v3/admin/cs/history" )
- src/mcp_server_nacos/server.py:74-86 (registration)Registers the NacosGetConfigHistory tool instance in the MCP server's list of 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(), ]
- Helper enum defining the exact string name "get_config_history" for the tool.GET_CONFIG_HISTORY = "get_config_history",