Tool reference
Each tool except connection_info also takes the argument agent: the agent that runs the call. With 1 agent, the argument is optional. A tool that changes data accepts only the agents that may change data. A recipe runs through run_recipe or run_write_recipe; list_recipes gives the approved recipes.
Your connection
connection_info
Reads data
Show the companies of this connection, with their Odoo and your agents in each.
Find models and fields
odoo_schema_search
Reads data
Search the models and fields of the agent before you choose a model.
| Argument | Type | Required | Description |
|---|---|---|---|
query |
string |
yes | Words to search for. |
limit |
integer |
no | Maximum number of hits. |
odoo_models
Reads data
List the models that the agent can use, per app.
| Argument | Type | Required | Description |
|---|---|---|---|
app |
string |
no | Only the models of this app. |
query |
string |
no | Only the models that match. |
limit |
integer |
no | Maximum number of models. |
offset |
integer |
no | Number of items to skip. |
odoo_fields
Reads data
List the fields of a model that the agent can use.
| Argument | Type | Required | Description |
|---|---|---|---|
model |
string |
yes | Technical name of the model. |
names |
string[] |
no | Only these fields. |
detail |
"compact" | "full" |
no | Full adds values, relations and notes. |
include_technical |
boolean |
no | Also return technical fields. |
limit |
integer |
no | Maximum number of fields. |
offset |
integer |
no | Number of items to skip. |
Read data
odoo_search
Reads data
Search records of a model and return them with the total count.
| Argument | Type | Required | Description |
|---|---|---|---|
model |
string |
yes | Technical name of the model. |
domain |
any[] |
no | Conditions that the records must meet. |
fields |
string[] |
no | Fields to return; empty means all. |
limit |
integer |
no | Maximum number of records; none gives every record. |
offset |
integer |
no | Number of records to skip. |
order |
string |
no | Sort order. |
odoo_read
Reads data
Read records by their ids.
| Argument | Type | Required | Description |
|---|---|---|---|
model |
string |
yes | Technical name of the model. |
ids |
integer[] |
yes | Ids of the records. |
fields |
string[] |
no | Fields to return; empty means all. |
odoo_aggregate
Reads data
Group records and return the aggregates per group.
| Argument | Type | Required | Description |
|---|---|---|---|
model |
string |
yes | Technical name of the model. |
groupby |
string[] |
yes | Fields to group by. |
aggregates |
string[] |
yes | Aggregates as field:function. |
domain |
any[] |
no | Conditions that the records must meet. |
limit |
integer |
no | Maximum number of groups. |
odoo_report
Reads data
Return a report of records as a PDF file.
| Argument | Type | Required | Description |
|---|---|---|---|
report_name |
string |
yes | Technical name of the report. |
ids |
integer[] |
yes | Ids of the records. |
Calculate
odoo_compute
Reads data
Run a short Python script on the data of the agent and return only its result.
| Argument | Type | Required | Description |
|---|---|---|---|
code |
string |
yes | Python script; the variable result is the answer. odoo.search(model, domain, fields, limit=None, offset=0, order=None) returns a dict with records and count, and every record when there is no limit, so do not read in pages. odoo.read(model, ids, fields), odoo.aggregate(model, domain, groupby, aggregates) and odoo.fields(model) read the same data as the tools. The dict inputs holds the inputs; pandas and numpy are available. |
inputs |
object |
no | Values that the script reads as inputs. |
Change data
odoo_create
Reads data
Create 1 or more records and return their ids.
| Argument | Type | Required | Description |
|---|---|---|---|
model |
string |
yes | Technical name of the model. |
values |
object | object[] |
yes | Field values of 1 record, or a list for more records. |
odoo_write
Changes data
Change the fields of records.
| Argument | Type | Required | Description |
|---|---|---|---|
model |
string |
yes | Technical name of the model. |
ids |
integer[] |
yes | Ids of the records. |
values |
object |
yes | Field values. |
odoo_call
Changes data
Run a model method that the agent allows.
| Argument | Type | Required | Description |
|---|---|---|---|
model |
string |
yes | Technical name of the model. |
method |
string |
yes | Name of an allowed model method. |
ids |
integer[] |
no | Ids of the records, if any. |
kwargs |
object |
no | Named arguments. |
odoo_post_message
Reads data
Post a message on a record and return the message id.
| Argument | Type | Required | Description |
|---|---|---|---|
model |
string |
yes | Technical name of the model. |
id |
integer |
yes | Id of the record. |
body |
string |
yes | Message in HTML. |
internal |
boolean |
no | True for an internal note. |
Export and import files
odoo_export
Reads data
Export records to an Excel or CSV file and return a download link.
| Argument | Type | Required | Description |
|---|---|---|---|
model |
string |
yes | Technical name of the model. |
fields |
string[] |
yes | Field paths, such as name, partner_id/name or partner_id/id. |
domain |
any[] |
no | Conditions that the records must meet. |
file_format |
object |
no | xlsx or csv. |
header |
"labels" | "fields" |
no | labels for people; fields for a file to import again. |
order |
string |
no | Sort order. |
limit |
integer |
no | Maximum number of records; none gives every record. |
odoo_import
Changes data
Import a CSV or Excel file with the import of Odoo: every row, or none when 1 row fails.
| Argument | Type | Required | Description |
|---|---|---|---|
model |
string |
yes | Technical name of the model. |
file |
string |
no | CSV text, or an XLSX file in base64; row 1 is the header. |
file_format |
object |
no | csv or xlsx. |
resource_uri |
string |
no | A file of an earlier answer, such as an export. |
fields |
string[] |
no | Field path per column; empty skips a column; none uses the header. |
Recipes
list_recipes
Reads data
List the approved recipes of the agent, with their parameters and the tool that runs them.
run_recipe
Reads data
Run an approved recipe that only reads data, and return its result.
| Argument | Type | Required | Description |
|---|---|---|---|
recipe |
string |
yes | Name of an approved recipe, from list_recipes. |
params |
object |
no | Parameters that match the schema of the recipe. |
run_write_recipe
Changes data
Run an approved recipe that changes data, and return its result.
| Argument | Type | Required | Description |
|---|---|---|---|
recipe |
string |
yes | Name of an approved recipe, from list_recipes. |
params |
object |
no | Parameters that match the schema of the recipe. |
propose_recipe
Reads data
Propose a recipe: a fixed series of tool calls that an admin can publish as 1 tool.
| Argument | Type | Required | Description |
|---|---|---|---|
slug |
string |
yes | Name of the new tool: lowercase, digits, underscores. |
description |
string |
yes | 1 sentence that says what the recipe does. |
parameters_schema |
object |
yes | JSON schema of type object for the input. |
steps |
object[] |
yes | The tool calls in their order. |
output_template |
string |
yes | Template of the result. |