get_remediation
Retrieve the stored remediation suggestion for a specific compliance violation to resolve hardening issues.
Instructions
[READ] Get the persisted Suggestion for a violation, or None.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| violation_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- vmware_harden/mcp/tools.py:91-103 (handler)Core implementation of the get_remediation tool. Opens the Twin store, calls twin.get_suggestion(violation_id), and returns the Suggestion as a dict (or None).
@vmware_tool(risk_level="low") def get_remediation(violation_id: str) -> dict | None: """[READ] Get the persisted Suggestion for a violation, or None.""" from vmware_harden.store.twin import Twin twin = Twin(_resolve_db()) try: sugg = twin.get_suggestion(violation_id) if sugg is None: return None return sugg.model_dump(mode="json") finally: twin.close() - mcp_server/server.py:29-32 (registration)Registration of the get_remediation tool on the FastMCP server with name='get_remediation'. Wraps the tools.py implementation via a lambda-like closure.
@server.tool(name="get_remediation") def _get_remediation_impl(violation_id: str) -> dict | None: """[READ] Get the persisted Suggestion for a violation, or None.""" return t.get_remediation(violation_id) - vmware_harden/store/twin.py:92-102 (helper)Twin.get_suggestion() - the low-level database helper that queries the remediation table for a given violation_id and deserializes the stored Suggestion JSON.
def get_suggestion(self, violation_id: str): """Load the saved Suggestion for a violation, or None if absent.""" from vmware_harden.baselines.model import Suggestion row = self.conn.execute( "SELECT suggestion FROM remediation WHERE violation_id = ?", [violation_id], ).fetchone() if row is None or row[0] is None: return None return Suggestion.model_validate_json(row[0])