Docs
MCP serverAvailable tools

Get invoice summary

Summarize the invoices sent or received today, over the last 7 days, or this calendar month, ending on the organization's current day. Amounts are before IVA: invoiced is the fiscal base of valid Type I invoices on their CFDI date, credit notes are apart, and settled is PUE invoices plus payment complements on their payment date. PPD invoices count as invoiced, never as settled, so their payments cannot double count them. Payment methods are shares of gross settled cash. Counterparties rank the calendar month, net of its credit notes.

MCP toolget_invoice_summary

Purpose

Summarize recent invoicing, settlement, payment methods, and top counterparties.

Use when
You need what was invoiced and settled recently, as on the invoices page.
Do not use when
You need a past fiscal month or year, receipt sales, or an account balance.
Required permissions
analytics:read
Side effects
None
Idempotency
Idempotent

Input schema

JSON Schema
{  "type": "object",  "properties": {    "direction": {      "description": "Invoices sent to customers or received from suppliers; defaults to sent",      "allOf": [        {          "enum": [            "sent",            "received"          ]        }      ]    },    "period": {      "description": "The organization's current day, the 7 days ending on it, or its calendar month so far; defaults to last_7_days",      "allOf": [        {          "enum": [            "today",            "last_7_days",            "month"          ]        }      ]    }  },  "$schema": "http://json-schema.org/draft-07/schema#",  "additionalProperties": false}

Output schema

JSON Schema
{  "type": "object",  "properties": {    "data": {      "type": "object",      "properties": {        "dateFrom": {          "$ref": "#/definitions/__schema0"        },        "dateTo": {          "$ref": "#/definitions/__schema0"        },        "invoiced": {          "type": "object",          "properties": {            "total": {              "type": "number"            },            "count": {              "type": "number"            },            "pue": {              "type": "number"            },            "ppd": {              "type": "number"            }          },          "required": [            "total",            "count",            "pue",            "ppd"          ],          "additionalProperties": false        },        "creditNotes": {          "type": "number"        },        "settled": {          "type": "number"        },        "paymentMethods": {          "type": "array",          "items": {            "type": "object",            "properties": {              "paymentMethod": {                "enum": [                  "cash",                  "card",                  "transfer",                  "credit",                  "other"                ]              },              "share": {                "type": "number"              }            },            "required": [              "paymentMethod",              "share"            ],            "additionalProperties": false          }        },        "counterparties": {          "type": "object",          "properties": {            "month": {              "type": "string",              "pattern": "^\\d{4}-\\d{2}$"            },            "items": {              "type": "array",              "items": {                "type": "object",                "properties": {                  "name": {                    "type": "string"                  },                  "amount": {                    "type": "number"                  },                  "isOther": {                    "type": "boolean"                  },                  "counterpartyId": {                    "anyOf": [                      {                        "type": "string"                      },                      {                        "type": "null"                      }                    ]                  },                  "share": {                    "type": "number"                  }                },                "required": [                  "name",                  "amount",                  "isOther",                  "counterpartyId",                  "share"                ],                "additionalProperties": false              }            }          },          "required": [            "month",            "items"          ],          "additionalProperties": false        },        "source": {          "const": "invoice_summary"        },        "currency": {          "const": "MXN"        },        "direction": {          "enum": [            "sent",            "received"          ]        },        "period": {          "enum": [            "today",            "last_7_days",            "month"          ]        },        "amountBasis": {          "const": "before_iva"        }      },      "required": [        "dateFrom",        "dateTo",        "invoiced",        "creditNotes",        "settled",        "paymentMethods",        "counterparties",        "source",        "currency",        "direction",        "period",        "amountBasis"      ],      "additionalProperties": false    },    "error": {      "$schema": "http://json-schema.org/draft-07/schema#",      "type": "object",      "properties": {        "code": {          "enum": [            "validation_error",            "unauthenticated",            "forbidden",            "payment_required",            "not_found",            "method_not_allowed",            "conflict",            "idempotency_conflict",            "operation_in_progress",            "recovery_required",            "migration_required",            "rate_limited",            "provider_unavailable",            "internal"          ]        },        "message": {          "type": "string"        },        "details": {          "type": "object",          "properties": {            "document": {              "type": "object",              "properties": {                "documentRef": {                  "type": "string",                  "pattern": "^(invoice|withholding|sales_receipt|declaration|tax_compliance_opinion|sales_receipt_refund):.+$"                },                "editable": {                  "type": "boolean"                }              },              "required": [                "documentRef",                "editable"              ],              "additionalProperties": false            },            "issues": {              "type": "array",              "items": {                "type": "object",                "properties": {                  "path": {                    "type": "array",                    "items": {                      "anyOf": [                        {                          "type": "string"                        },                        {                          "type": "number"                        }                      ]                    }                  },                  "message": {                    "type": "string"                  },                  "code": {                    "type": "string"                  }                },                "required": [                  "path",                  "message"                ],                "additionalProperties": false              }            },            "retryable": {              "type": "boolean"            },            "retryAfterSeconds": {              "type": "integer",              "exclusiveMinimum": 0,              "maximum": 9007199254740991            },            "reason": {              "type": "string"            },            "balanceMinor": {              "type": "integer",              "minimum": 0,              "maximum": 9007199254740991            },            "topUpUrl": {              "type": "string"            }          },          "additionalProperties": false        }      },      "required": [        "code",        "message"      ],      "additionalProperties": false    }  },  "$schema": "http://json-schema.org/draft-07/schema#",  "additionalProperties": false,  "definitions": {    "__schema0": {      "type": "string",      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"    }  },  "oneOf": [    {      "required": [        "data"      ]    },    {      "required": [        "error"      ]    }  ]}

Related workflow

See the canonical workflows in the introduction

Related tools