Skip to main content
Glama

ppm_create_project_from_template

Clone a project template into a new project for a specific customer, receiving IDs and names for the new project, portfolio, and program.

Instructions

Clone a project template and attach it to a customer (res.partner).

Returns the new project id, name, portfolio_id, and program_id.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
partner_idYes
template_idYes
project_nameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The `@mcp.tool()` decorator registers `ppm_create_project_from_template` as an MCP tool.
    @mcp.tool()
  • The handler function that clones a project template and attaches it to a customer (res.partner). It creates a `ppm.create.project.wizard` record with the given parameters, calls `action_create_project` on it, then reads and returns the new project's state.
    def ppm_create_project_from_template(
        partner_id: int,
        template_id: int,
        project_name: str,
    ) -> dict[str, Any]:
        """Clone a project template and attach it to a customer (res.partner).
    
        Returns the new project id, name, portfolio_id, and program_id.
        """
        wizard_id = client().execute_kw(
            "ppm.create.project.wizard",
            "create",
            [{"partner_id": partner_id, "template_id": template_id, "project_name": project_name}],
        )
        action = client().call_action(
            "ppm.create.project.wizard", "action_create_project", [wizard_id]
        )
        project_id = action.get("res_id") if isinstance(action, dict) else None
        if not project_id:
            raise RuntimeError("Template-create wizard did not return a project id")
        return _read_state(
            "project.project",
            project_id,
            ["id", "name", "partner_id", "portfolio_id", "program_id"],
        )
  • The `_read_state` helper used by the handler to fetch the new project's fields after creation.
    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]
  • The `execute_kw` method on OdooClient used by the handler to create the wizard record.
    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 {}],
        )
  • The `call_action` method on OdooClient used by the handler to invoke `action_create_project` on the wizard.
    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])
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so the description carries the burden. It discloses the action (clone and attach) and return values, but does not mention potential side effects, authentication requirements, or what happens to the template. Adequate but not thorough.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences that efficiently convey purpose and return value. No extraneous information; every sentence adds value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and three required parameters, the description covers the basic purpose and return values but omits context like error cases, required permissions, or the meaning of portfolio_id/program_id. Adequate for a simple operation but incomplete for full agent autonomy.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema has 0% description coverage, and the description does not elaborate on the parameters beyond their names. 'partner_id' is indirectly implied as customer ID, but no explicit mapping or format details. Description fails to compensate for missing schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'clone' and resources 'project template' and 'customer' (res.partner), distinguishing it from sibling tools that perform approvals, exports, or status changes. Unique creation tool.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives, such as directly creating a project without a template. No context on prerequisites or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/wethti/qod-ppm-odoo-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server