ppm_risk_start_analysis
Advance a risk from identified to analyzing status, enabling deeper evaluation and mitigation planning.
Instructions
Transition a risk from 'identified' to 'analyzing'.
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:219-223 (handler)The tool handler for ppm_risk_start_analysis. It transitions a risk from 'identified' to 'analyzing' by calling the Odoo server action 'action_start_analysis' on model 'ppm.risk', then reads and returns the updated risk state fields.
@mcp.tool() def ppm_risk_start_analysis(risk_id: int) -> dict[str, Any]: """Transition a risk from 'identified' to 'analyzing'.""" client().call_action("ppm.risk", "action_start_analysis", [risk_id]) return _read_state("ppm.risk", risk_id, _RISK_FIELDS) - src/qod_ppm_mcp/server.py:219-223 (registration)The tool is registered as an MCP tool via the @mcp.tool() decorator on line 219.
@mcp.tool() def ppm_risk_start_analysis(risk_id: int) -> dict[str, Any]: """Transition a risk from 'identified' to 'analyzing'.""" client().call_action("ppm.risk", "action_start_analysis", [risk_id]) return _read_state("ppm.risk", risk_id, _RISK_FIELDS) - src/qod_ppm_mcp/server.py:206-217 (schema)The _RISK_FIELDS list defines the schema of fields returned by the tool after the action is executed.
_RISK_FIELDS = [ "name", "state", "risk_type", "probability", "impact", "risk_score", "risk_level", "project_id", "owner_id", ] - src/qod_ppm_mcp/server.py:30-34 (helper)The _read_state helper function reads the current state of a record after the action is performed.
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]