Skip to main content
Glama
seletz

MCP Odoo Shell

by seletz

odoo_model_info

Retrieve detailed information about Odoo models including field definitions, table names, and descriptions to understand database structure and relationships.

Instructions

Get information about a specific Odoo model.

Retrieves detailed information about the specified model including
its description, database table name, and field definitions.

:param model_name: Name of the Odoo model (e.g., 'res.partner', 'sale.order')
:type model_name: str
:return: Formatted information about the model and its fields
:rtype: str

.. example::
   >>> odoo_model_info('res.partner')
   Model: res.partner
   Description: Partner
   Table: res_partner
   
   Fields:
     name: Char
     email: Char
     phone: Char
     ...

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
model_nameYes

Implementation Reference

  • The handler function decorated with @mcp.tool() that implements the odoo_model_info tool. It generates and executes Odoo shell code to retrieve model information including description, table, and fields.
    @mcp.tool()
    def odoo_model_info(model_name: str) -> str:
        """
        Get information about a specific Odoo model.
        
        Retrieves detailed information about the specified model including
        its description, database table name, and field definitions.
        
        :param model_name: Name of the Odoo model (e.g., 'res.partner', 'sale.order')
        :type model_name: str
        :return: Formatted information about the model and its fields
        :rtype: str
        
        .. example::
           >>> odoo_model_info('res.partner')
           Model: res.partner
           Description: Partner
           Table: res_partner
           
           Fields:
             name: Char
             email: Char
             phone: Char
             ...
        """
        code = f"""
    try:
        model = env['{model_name}']
        print(f"Model: {model_name}")
        print(f"Description: {{model._description}}")
        print(f"Table: {{model._table}}")
        print("\\nFields:")
        for field_name, field in model._fields.items():
            print(f"  {{field_name}}: {{type(field).__name__}}")
    except KeyError:
        print(f"Model '{model_name}' not found")
    except Exception as e:
        print(f"Error: {{e}}")
    """
        return execute_odoo_code(code)
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It describes the tool as a read operation ('Get information', 'Retrieves'), which implies it's non-destructive and likely read-only, but doesn't explicitly state safety aspects like permissions, rate limits, or error handling. The example shows output format, adding some behavioral context, but lacks details on what happens with invalid model names or other edge cases.

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

Conciseness4/5

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

The description is well-structured and appropriately sized. It starts with a clear purpose statement, details what information is retrieved, includes parameter and return type documentation, and provides a helpful example. The example is detailed but necessary for understanding output format. Minor verbosity in the example could be trimmed, but overall it's efficient.

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 the tool's moderate complexity (1 parameter, no output schema, no annotations), the description is somewhat complete but has gaps. It covers purpose, parameter semantics, and output format via example, but lacks behavioral details like error handling or performance characteristics. Without annotations or output schema, more context on what 'Formatted information' entails would be beneficial.

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

Parameters5/5

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

The description adds significant meaning beyond the input schema, which has 0% description coverage. It explains that 'model_name' is the 'Name of the Odoo model' and provides examples ('res.partner', 'sale.order'), clarifying the parameter's purpose and format. This compensates fully for the schema's lack of documentation.

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

Purpose4/5

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

The description clearly states the tool's purpose: 'Get information about a specific Odoo model' and specifies what information is retrieved (description, table name, field definitions). It distinguishes from sibling tools like 'list_odoo_models' (which likely lists models rather than details) and 'execute_odoo_code' (which executes code). However, it doesn't explicitly contrast with siblings in the text itself.

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

Usage Guidelines3/5

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

The description implies usage by providing an example with 'res.partner', suggesting it's for retrieving metadata about Odoo models. It doesn't explicitly state when to use this vs. alternatives like 'list_odoo_models' (for listing models) or 'reset_odoo_shell' (for resetting), leaving the agent to infer from context. No explicit exclusions or prerequisites are mentioned.

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/seletz/mcp-odoo-shell'

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