get_config_history
Retrieve historical change records for specific configurations in Nacos MCP Server by providing namespace, group, and data ID. Essential for tracking and auditing configuration updates.
Instructions
This interface retrieves a specific historical change record of a configuration.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dataId | Yes | The dataId of config, Required. | |
| groupName | Yes | The groupName of config, Required. | |
| namespaceId | No | The namespaceId of configs, default is `public` if missing | |
| 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 retrieving the tool's URL and making an HTTP GET request to the Nacos server with the provided arguments.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 input schema for the get_config_history tool, specifying parameters like namespaceId, groupName, dataId, and nid.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"
- Tool class implementation defining the get_config_history tool's name, description, input schema, and the specific Nacos API URL to call.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 (get_config_history) in the server's list_tools() function.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(), ]
- src/mcp_server_nacos/nacos_tools.py:270-270 (registration)Defines the string name for the GET_CONFIG_HISTORY tool enum.GET_CONFIG_HISTORY = "get_config_history",