ppm_ping
Verify MCP server authentication to Odoo and access to PPM models, returning counts of portfolios, programs, projects, and risks.
Instructions
Verify the MCP server can authenticate to Odoo and hit the PPM models.
Returns {ok, uid, portfolios, programs, projects, risks} with counts.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/qod_ppm_mcp/server.py:483-505 (handler)The ppm_ping tool handler function. Authenticates to Odoo and runs search_count on several PPM models (portfolio, program, project, risk, change.request, milestone, status.report), returning a dict with ok/uid/counts.
@mcp.tool() def ppm_ping() -> dict[str, Any]: """Verify the MCP server can authenticate to Odoo and hit the PPM models. Returns {ok, uid, portfolios, programs, projects, risks} with counts. """ c = client() uid = c.uid # triggers authenticate if needed counts: dict[str, Any] = {"ok": True, "uid": uid} for model in ( "project.portfolio", "project.program", "project.project", "ppm.risk", "ppm.change.request", "ppm.milestone", "ppm.status.report", ): try: counts[model] = c.execute_kw(model, "search_count", [[]]) except Exception as e: # noqa: BLE001 counts[model] = f"error: {e}" return counts - src/qod_ppm_mcp/server.py:483-483 (registration)The @mcp.tool() decorator registers ppm_ping as a tool on the FastMCP instance.
@mcp.tool() - src/qod_ppm_mcp/server.py:23-27 (helper)The client() helper function creates or returns a cached OdooClient instance, used by ppm_ping.
def client() -> OdooClient: global _client if _client is None: _client = OdooClient.from_env() return _client - src/qod_ppm_mcp/client.py:80-91 (helper)The execute_kw method on OdooClient, used by ppm_ping to call search_count on Odoo models.
def execute_kw( self, model: str, method: str, args: list[Any] | None = None, kwargs: dict[str, Any] | None = None, ) -> Any: return self._call( "object", "execute_kw", [self.db, self.uid, self.secret, model, method, args or [], kwargs or {}], ) - src/qod_ppm_mcp/client.py:74-78 (helper)The uid property on OdooClient that triggers authentication, used by ppm_ping to verify connectivity.
@property def uid(self) -> int: if self._uid is None: self.authenticate() return self._uid # type: ignore[return-value]