Skip to main content
Glama
Odoo Connect MCP

Odoo Connect MCP

by Tristan439

Totals and groups

aggregate_records
Read-onlyIdempotent

Computes grouped totals, averages, and counts for Odoo records by chosen fields, enabling pivot-style summaries from models like sale.order with optional filters and date grouping.

Instructions

Computes totals/averages/counts grouped by fields (like a pivot table). Example: model "sale.order", group_by ["user_id"], measures ["amount_total:sum"]. Dates can be grouped with ":day", ":week", ":month", ":quarter", ":year".

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "model": "<model>",
      "group_by": "<group_by>"
    },
    "name": "aggregate_records"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNo
modelYesTechnical model name, e.g. "sale.order", "res.partner", "crm.lead"
domainNoOdoo domain, e.g. [["state","=","sale"],["amount_total",">",1000]]. Empty = all records.
group_byYese.g. ["stage_id"] or ["date_order:month"]
measuresNoe.g. ["amount_total:sum", "product_uom_qty:avg"]. A count is always included.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnlyHint, idempotent, non-destructive, closed-world), so the description's job is to add semantics — and it does, by specifying the measure syntax ('amount_total:sum', 'product_uom_qty:avg') and the date-grouping suffixes (':day' through ':year'). It also notes that a count is always included. It does not describe the shape of the returned rows, which is a modest gap for an aggregation tool with no output schema.

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?

Three compact sentences with the core purpose front-loaded, followed by a concrete example and a syntax note. Every sentence carries information; the example is slightly redundant with the schema's own examples but still aids fast comprehension.

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?

For a five-parameter aggregation tool with no output schema, the description covers the key syntax but omits the result shape (how grouped keys and measures appear in each row) and says nothing about the limit parameter's cap of 200 or the three-field maximum on group_by. It is workable but leaves an agent guessing about output structure.

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

Parameters3/5

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

Schema description coverage is 80%, so the schema already explains model, domain, group_by and measures with examples. The description reinforces the measures syntax and adds the full set of date granularity suffixes, which is genuinely useful but largely overlapping with the schema's own '[date_order:month]' example. Baseline 3 is appropriate given the schema does most of the work.

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 states a specific verb and resource: it 'computes totals/averages/counts grouped by fields (like a pivot table)'. The pivot-table analogy makes the operation unambiguous. It does not explicitly distinguish itself from siblings like count_records or read_records, but the aggregation semantics are clear enough to separate it in practice.

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?

Usage is implied rather than stated: the pivot-table framing suggests 'use this when you need grouped aggregates'. There is no explicit when-to-use versus count_records or read_records, and no stated prerequisites or exclusions. An agent can infer the intent but must reason about the alternative itself.

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