Skip to main content
Glama
seletz
by seletz

odoo_model_info

Retrieve detailed information about an Odoo model, including its description, database table name, and field definitions, using the specified model name.

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 core handler function for the 'odoo_model_info' tool. Decorated with @mcp.tool() for automatic MCP registration. Generates and executes Odoo shell code to retrieve and print the model's description, table name, and field list.
    @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)

Other Tools

Related 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