ppm_risk_start_monitoring
Transition a risk to 'monitoring' status to activate ongoing oversight and control of its mitigation.
Instructions
Transition a risk to 'monitoring'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| risk_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/qod_ppm_mcp/server.py:233-237 (handler)The tool handler function for ppm_risk_start_monitoring. Calls the Odoo 'action_start_monitoring' action on the ppm.risk model and returns the updated state.
@mcp.tool() def ppm_risk_start_monitoring(risk_id: int) -> dict[str, Any]: """Transition a risk to 'monitoring'.""" client().call_action("ppm.risk", "action_start_monitoring", [risk_id]) return _read_state("ppm.risk", risk_id, _RISK_FIELDS) - src/qod_ppm_mcp/server.py:206-216 (schema)The _RISK_FIELDS list defines the fields read back after the action, serving as the implicit output schema for the tool.
_RISK_FIELDS = [ "name", "state", "risk_type", "probability", "impact", "risk_score", "risk_level", "project_id", "owner_id", ] - src/qod_ppm_mcp/server.py:233-234 (registration)The @mcp.tool() decorator registers the function as an MCP tool named 'ppm_risk_start_monitoring'.
@mcp.tool() def ppm_risk_start_monitoring(risk_id: int) -> dict[str, Any]: - src/qod_ppm_mcp/server.py:30-34 (helper)The _read_state helper function reads the current state of a record from Odoo, used to return the updated risk after the action.
def _read_state(model: str, rec_id: int, fields: list[str]) -> dict[str, Any]: rows = client().read(model, [rec_id], fields) if not rows: raise ValueError(f"{model} id={rec_id} not found") return rows[0] - src/qod_ppm_mcp/client.py:122-124 (helper)The call_action helper on OdooClient invokes an action_* button method on the Odoo model, which is what the tool uses to transition the risk state.
def call_action(self, model: str, method: str, ids: list[int]) -> Any: """Invoke an `action_*` button method on the given record ids.""" return self.execute_kw(model, method, [ids])