Skip to main content
Glama
erp-mafia

Fortnox MCP Server

by erp-mafia

Invoice Summary Analytics

fortnox_invoice_summary
Read-onlyIdempotent

Calculate invoice totals, counts, and averages for any date range. Filter by status or customer, group by customer or month, and get revenue breakdowns for actionable financial insights.

Instructions

Calculate summary statistics for invoices over a period.

Answers questions like:

  • "What was my total revenue this month?"

  • "How many invoices did we send last quarter?"

  • "What's the average invoice amount this year?"

  • "Show me revenue breakdown by customer"

Args:

  • period ('today' | 'yesterday' | 'this_week' | 'last_week' | 'this_month' | 'last_month' | 'this_quarter' | 'last_quarter' | 'this_year' | 'last_year'): Date period to analyze

  • from_date (string): Start date YYYY-MM-DD (ignored if period specified)

  • to_date (string): End date YYYY-MM-DD (ignored if period specified)

  • filter ('cancelled' | 'fullypaid' | 'unpaid' | 'unpaidoverdue' | 'unbooked'): Filter by invoice status

  • customer_number (string): Filter by specific customer

  • group_by ('customer' | 'month' | 'status'): Group statistics by dimension

  • include_details (boolean): Include individual invoice list (default: false)

  • response_format ('markdown' | 'json'): Output format

Returns: For JSON: { period, date_range, summary: { count, total, average, min, max, ... }, groups?: [...], invoices?: [...] } For Markdown: Formatted summary with totals and optional breakdown

Examples:

  • Monthly revenue: period="this_month"

  • Revenue by customer this year: period="this_year", group_by="customer"

  • Unpaid invoice totals: filter="unpaid"

Error Handling:

  • Returns truncation warning if >10,000 invoices

  • Returns "Error: ..." if API call fails

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filterNoFilter invoices by status before calculating summary
periodNoDate period to analyze (e.g., 'this_month', 'last_quarter'). If not specified, analyzes all invoices.
to_dateNoEnd date for analysis (YYYY-MM-DD). Ignored if period is specified.
group_byNoGroup summary statistics by this dimension
from_dateNoStart date for analysis (YYYY-MM-DD). Ignored if period is specified.
customer_numberNoFilter by specific customer number
include_detailsNoInclude list of individual invoices in the response
response_formatNoOutput format: 'markdown' or 'json'markdown
Behavior5/5

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

The description adds significant behavioral details beyond the annotations: it warns about truncation for >10,000 invoices, notes that from_date/to_date are ignored when period is specified, describes error handling ('Returns "Error: ..." if API call fails'), and outlines the return format for both JSON and Markdown. These enrich the read-only, idempotent nature already declared by annotations without contradiction.

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 well-organized with clear sections: purpose, example questions, Args, Returns, Examples, and Error Handling. It front-loads the core purpose in the first sentence. However, the Args section largely duplicates the input schema, which adds redundancy and length. The extra examples and error handling justify some length, but the duplication keeps it from a perfect score.

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?

This is a complex tool with 8 parameters and no output schema. The description compensates admirably by detailing the return structure for JSON, describing the Markdown format, explaining truncation and error handling, and providing parameter combination examples. It covers the essential behavioral and output aspects that the schema and annotations do not, making it complete enough for an agent to invoke the tool confidently.

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 repeats most parameter details already in the schema, adding little new semantic meaning. It does provide useful combination examples (e.g., group_by='customer' with period='this_year') that illustrate parameter interplay, but this is more about usage context than fundamentally new parameter semantics. Thus, it meets the baseline without exceeding it.

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 the tool's purpose: 'Calculate summary statistics for invoices over a period.' It uses a specific verb and resource, and the example questions further clarify that it answers analytical queries about totals, counts, averages, and breakdowns. This distinguishes it from sibling tools like fortnox_list_invoices (which lists raw invoices) and fortnox_unpaid_report (which focuses specifically on unpaid invoices).

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 provides clear context on when to use this tool through example questions and examples of parameter combinations (e.g., 'Monthly revenue: period="this_month"', 'Revenue by customer this year: period="this_year", group_by="customer"'). However, it does not explicitly name alternative tools or state when not to use it, so it stops short of full exclusion guidance. Still, the context is strong enough for an agent to infer appropriate usage.

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/erp-mafia/fortnox-mcp'

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