Skip to main content
Glama

Get entity invoice metrics

mercoa_get_entity_invoice_metrics
Read-only

Get aggregate invoice metrics (totals/counts, grouped by currency) for an entity's payables/receivables — for AP/AR dashboards and aging. GET /entity/{entityId}/invoice-metrics.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
searchNoSearch by vendor name, invoice number, check number, or amount.
statusNoInvoice status filter (e.g. NEW, SCHEDULED, PAID).
endDateNoEnd date filter (ISO 8601).
groupByNoAdditional grouping (e.g. by status).
payerIdNoFilter by payer ID(s).
currencyNoCurrency code(s) to filter on, e.g. USD.
dateTypeNoDate type to filter by (e.g. CREATED_AT, DUE_DATE).
entityIdYesEntity ID or foreign ID.
vendorIdNoFilter by vendor ID(s).
invoiceIdNoFilter by invoice ID(s) or foreign ID(s).
startDateNoStart date filter (ISO 8601).
approverIdNoFilter by assigned approver user ID(s).
returnByDateNoGroup metrics by date, e.g. CREATION_DATE or DUE_DATE.
excludePayablesNoOnly return receivables (exclude payables).
excludeReceivablesNoOnly return payables (exclude receivables).
returnByDateFrequencyNoFrequency for date grouping (e.g. DAILY, MONTHLY).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, signaling a safe read operation. The description adds that the tool returns totals and counts grouped by currency, which provides behavioral context beyond annotations. No contradictions.

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?

The description is a single, informative sentence followed by the endpoint. It is front-loaded with the core purpose and has no wasted words. Highly 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 tool has 16 parameters and no output schema, the description adequately explains the return type (totals/counts grouped by currency) and use case. It could be more specific about the response structure, but it is generally complete for an agent to decide on using it.

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 coverage is 100%, so the baseline is 3. The description mentions grouping by currency, but the input schema already details all parameters, including currency, groupBy, etc. The description does not add significant new meaning beyond the schema.

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 clearly states it gets aggregate invoice metrics (totals/counts, grouped by currency) for an entity's payables/receivables, intended for AP/AR dashboards and aging. This distinguishes it from sibling tools like mercoa_get_invoice (single invoice) and mercoa_find_invoices (list of invoices), providing a specific verb+resource+scope.

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

Usage Guidelines4/5

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

The description indicates usage for aggregate metrics and dashboards, implying it's for summary data. However, it does not explicitly state when not to use it or name alternatives. The context is clear but lacks explicit exclusions.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.