Skip to main content
Glama
singleflo

io.github.singleflo/odoo-assistant

by singleflo

count_records

Count records in an Odoo model that match a domain, with company and move type filters for reliable numbers.

Instructions

Count the records matching a domain (Odoo search_count).

A count is only as honest as its domain:

  • account.move / account.move.line without a move_type filter is refused — it would count invoices, bills, credit notes and journal entries together and match no figure the user has ever seen.

  • A count answers "how many", never "how much". For an amount, read amount_total_signed (company currency) and never amount_total.

  • On a multi-company instance the count differs per company: pass company_ids or you are reporting one company as the whole business.

Args: model: Odoo model, e.g. "crm.lead". domain: Odoo domain. Omit to count everything the model holds. company_ids: Companies to count in, e.g. [1, 2].

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelYes
domainNo
company_idsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

No annotations are provided, so the description carries full transparency burden. It discloses behavioral traits (e.g., refuses certain domains, counts per company), but does not mention side effects, performance, or immutability. The description adds value beyond what annotations would provide, but lacks a complete behavioral profile.

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?

The description is front-loaded with purpose, uses bullet points for clarity, and is efficient. However, the bullet points could be slightly condensed; some phrases (e.g., 'A count is only as honest as its domain') add style but length. Overall well-structured and concise.

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

Completeness4/5

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

Given the complexity (counting with domain pitfalls), 3 parameters, and presence of an output schema, the description covers key usage scenarios and edge cases. It lacks details on return value (though output schema exists) and specific error conditions, but is largely complete for effective agent use.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must compensate, and it does so excellently. The docstring explains each parameter's semantics, providing examples or clarifying defaults (e.g., 'omit to count everything' for domain, and company_ids for multi-company). It adds meaningful context beyond the schema's type definitions.

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?

The description uses a clear verb 'count' with the resource 'records matching a domain' and explicitly links it to the Odoo `search_count` method. It clearly distinguishes from siblings like `search_read` (which returns records) and establishes its scope as a counting operation.

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?

The description provides explicit guidance on when and when not to use the tool, including warnings about mixing `move_type`, confusing count with sum, and multi-company instances. It effectively helps the agent avoid common mistakes by specifying exclusions and context.

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

Install Server

Other 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/singleflo/odoo-assistant-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server