Skip to main content
Glama
odoo-mcp-server

odoo-mcp-server

Count records

odoo_count
Read-onlyIdempotent

Count records of a specified Odoo model that match a domain and return the model name with the total. Use it when you need only the number and do not want to retrieve records.

Instructions

Count the records of one model that match a domain and return {model, count}. Use it when you need only the number: it reads no records, so it is cheaper than odoo_search. Without a domain it counts every record you can see, archived ones excluded. For counts per group use odoo_aggregate with '__count'; to get the records use odoo_search.

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>"
    },
    "name": "odoo_count"
  }
}

Input Schema

NameRequiredDescriptionDefault
modelYesTechnical model name from odoo_list_models, e.g. 'res.partner' or 'sale.order'.
domainNoOdoo domain: a list of [field, operator, value] conditions, combined with AND unless prefixed by '|' (OR) or '!' (NOT). A dotted path follows a relation to another available model, e.g. 'country_id.code'. Omit or [] to match every record you can see; archived records are left out unless the domain has a condition on active. Example: [["customer_rank", ">", 0], ["country_id.code", "=", "BE"]].

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.1.1
    • changedInput schema / properties / domain / description
      Previous value: -"Odoo domain, e.g. [[\"customer_rank\", \">\", 0], [\"country_id.code\", \"=\", \"BE\"]]."New value: +"Odoo domain: a list of [field, operator, value] conditions, combined with AND unless prefixed by '|' (OR) or '!' (NOT). A dotted path follows a relation to another available model, e.g. 'country_id.code'. Omit or [] to match every record you can see; archived records are left out unless the domain has a condition on active. Example: [[\"customer_rank\", \">\", 0], [\"country_id.code\", \"=\", \"BE\"]]."
    • changedInput schema / properties / model / description
      Previous value: -"Technical model name, e.g. 'res.partner'."New value: +"Technical model name from odoo_list_models, e.g. 'res.partner' or 'sale.order'."
  2. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive), and the description adds real value on top: it reads no records and is therefore cheaper, and it discloses the archived-record exclusion rule. The archived/default-domain nuance is largely mirrored in the domain parameter's schema text, so it is slightly redundant rather than fully additive.

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

Conciseness5/5

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

Three tight sentences with the core action and return shape front-loaded, then the cost/semantics note, then the routing to alternatives. No filler and nothing buried.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a two-parameter, read-only counting tool, the description covers purpose, cost profile, default semantics, and sibling routing, and it declares the return shape in the absence of an output schema. An agent has everything needed to call it correctly.

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 100%, so the schema already documents both model and domain in depth, including the archived-record caveat and the OR/NOT and dotted-path syntax. The description's 'without a domain it counts every record you can see, archived ones excluded' restates the schema's default behaviour rather than adding new meaning, so the baseline of 3 applies.

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

Purpose5/5

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

States a specific verb and resource ('Count the records of one model that match a domain') and even names the return shape {model, count}. It is immediately distinguishable from odoo_search (which returns records) and odoo_aggregate (which groups).

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

Usage Guidelines5/5

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

Gives explicit when-to-use ('you need only the number'), a cost rationale versus odoo_search, and names both alternatives with the conditions that select them: odoo_aggregate with '__count' for per-group counts, odoo_search to get the records.

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