# Example: Basic CRUD Operations
## Connect to Database
```json
{
"tool": "odoo_connect",
"arguments": {
"host": "localhost",
"database": "mydb",
"username": "admin@example.com",
"apiKey": "your-api-key-here",
"port": 8069,
"protocol": "http"
}
}
```
## Create a Customer
```json
{
"tool": "odoo_create",
"arguments": {
"model": "res.partner",
"values": {
"name": "Acme Corporation",
"email": "contact@acme.com",
"phone": "+1-555-0123",
"is_company": true,
"street": "123 Business Ave",
"city": "Tech City",
"zip": "12345",
"country_id": 233,
"customer_rank": 1
}
}
}
```
## Search for Customers
```json
{
"tool": "odoo_search",
"arguments": {
"model": "res.partner",
"domain": [
["customer_rank", ">", 0],
["is_company", "=", true]
],
"limit": 10,
"order": "name ASC"
}
}
```
## Read Customer Details
```json
{
"tool": "odoo_read",
"arguments": {
"model": "res.partner",
"ids": [14],
"fields": ["name", "email", "phone", "street", "city"]
}
}
```
## Update Customer Information
```json
{
"tool": "odoo_write",
"arguments": {
"model": "res.partner",
"ids": [14],
"values": {
"phone": "+1-555-9999",
"email": "newemail@acme.com"
}
}
}
```
## Search and Read in One Call
```json
{
"tool": "odoo_search_read",
"arguments": {
"model": "res.partner",
"domain": [["city", "=", "Tech City"]],
"fields": ["name", "email", "phone"],
"limit": 20
}
}
```
## Delete a Record
```json
{
"tool": "odoo_delete",
"arguments": {
"model": "res.partner",
"ids": [14]
}
}
```