update_dead_host
Modify configuration settings for an inactive proxy host in Nginx Proxy Manager to restore functionality or update parameters like domain names, SSL certificates, and security options.
Instructions
Update an existing dead host
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host_id | Yes | The ID of the dead host to update | |
| domain_names | No | ||
| certificate_id | No | ||
| ssl_forced | No | ||
| hsts_enabled | No | ||
| hsts_subdomains | No | ||
| http2_support | No | ||
| advanced_config | No |
Implementation Reference
- src/npm_mcp/server.py:440-446 (handler)Tool handler for 'update_dead_host' which fetches the current host, updates its data with provided arguments, and then sends a PUT request via the NPM client.
elif name == "update_dead_host": args = dict(arguments) host_id = args.pop("host_id") current = await npm_client.get_dead_host(host_id) updated_data = current.model_dump() updated_data.update(args) return _model_response(await npm_client.update_dead_host(host_id, DeadHost(**updated_data))) - src/npm_mcp/server.py:185-201 (schema)Definition of the 'update_dead_host' tool in the MCP server registration, including the input schema.
Tool( name="update_dead_host", description="Update an existing dead host", inputSchema={ "type": "object", "properties": { "host_id": {"type": "integer", "description": "The ID of the dead host to update"}, "domain_names": {"type": "array", "items": {"type": "string"}}, "certificate_id": {"type": "integer"}, "ssl_forced": {"type": "boolean"}, "hsts_enabled": {"type": "boolean"}, "hsts_subdomains": {"type": "boolean"}, "http2_support": {"type": "boolean"}, "advanced_config": {"type": "string"}, }, "required": ["host_id"], }, - src/npm_mcp/client.py:326-332 (helper)The actual API client method that performs the network request for updating a dead host.
async def update_dead_host(self, host_id: int, host: DeadHost) -> DeadHost: host_id = _validate_int_id(host_id, "host_id") response = await self._request( "PUT", f"/api/nginx/dead-hosts/{host_id}", json=host.model_dump(exclude_none=True, exclude={"id", "created_on", "modified_on", "owner_user_id"}), ) return DeadHost(**response.json())