refresh_terraform_service
Refresh Terraform state for a specified service to detect configuration drift using SSH connection.
Instructions
Refresh Terraform state and detect configuration drift
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| service_name | Yes | Name of the service to refresh | |
| hostname | Yes | Hostname or IP address of the device | |
| username | No | SSH username (use 'mcp_admin' for passwordless access after setup) | mcp_admin |
| password | No | SSH password (not needed for mcp_admin after setup) |
Implementation Reference
- Handler function for refresh_terraform_service. Creates a ServiceInstaller and calls installer.refresh_terraform_service(**arguments), returning the JSON-serialized result.
async def handle_refresh_terraform_service(arguments: dict[str, Any]) -> dict[str, Any]: """Handle refresh_terraform_service tool.""" installer = ServiceInstaller() refresh_result = await installer.refresh_terraform_service(**arguments) return {"content": [{"type": "text", "text": json.dumps(refresh_result, indent=2)}]} - Input schema for refresh_terraform_service tool. Defines description, properties (service_name, hostname, username, password) with required fields service_name and hostname.
"refresh_terraform_service": { "description": "Refresh Terraform state and detect configuration drift", "inputSchema": { "type": "object", "properties": { "service_name": { "type": "string", "description": "Name of the service to refresh", }, "hostname": { "type": "string", "description": "Hostname or IP address of the device", }, "username": { "type": "string", "description": "SSH username (use 'mcp_admin' for passwordless access after setup)", "default": "mcp_admin", }, "password": { "type": "string", "description": "SSH password (not needed for mcp_admin after setup)", }, }, "required": ["service_name", "hostname"], }, }, - src/homelab_mcp/tool_handlers/__init__.py:129-129 (registration)Registration mapping tool name 'refresh_terraform_service' to handler handle_refresh_terraform_service in the tool handler registry.
"refresh_terraform_service": handle_refresh_terraform_service, - src/homelab_mcp/openapi_app.py:84-84 (registration)Tool listed in _SERVICE_TOOLS_WITH_HOST tuple for OpenAPI app registration.
"refresh_terraform_service", - Tool annotation for refresh_terraform_service marking it as idempotent (idempotentHint=True), not read-only, and not destructive.
"refresh_terraform_service": ToolAnnotations( readOnlyHint=False, destructiveHint=False, idempotentHint=True, ),