Skip to main content
Glama

Profit and loss

get_profit_and_loss
Read-onlyIdempotent

Use this when the user asks about their profit, income and expenses, or profit and loss for this month, this quarter or given dates. Profit and loss for a period, the same figures as the Profit & loss page in Fatura Go, whose basis depends on the business (basis_kind). cash (accounting off): income (customer payments received in the period, excluding VAT, less credit-note refunds), expenses excluding VAT by category, and profit, per currency; supplier bills are not included and currencies are not added together. ledger (accounting on): revenue, cost of sales, gross profit, expenses and net profit from the books in AED, by report line. Say which basis it is when presenting it. period this_month (default), this_quarter, or custom with date_from and date_to. Needs access to expenses (or accounting once the books are on). Do not use it for per-unit profit on a product (calculate_profit) or for VAT (get_vat_summary).

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "get_profit_and_loss"
  }
}

Input Schema

NameRequiredDescriptionDefault
periodNoDefault this_month; custom needs date_from and date_to.
date_toNoYYYY-MM-DD, document date on or before.
date_fromNoYYYY-MM-DD, document date on or after.
business_idNoFrom list_businesses. May be left out when the connection shares exactly one business.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare a safe read (readOnly, idempotent, non-destructive, closed-world), and the description goes well beyond them: the output basis depends on the business's basis_kind, cash figures exclude VAT and supplier bills and are never summed across currencies, ledger figures are in AED by report line, and the agent is told to state the basis when presenting. This is exactly the kind of non-obvious behavior an agent could not infer from structured fields.

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 leading sentence front-loads the trigger condition and the tool's identity, and nearly every clause carries real information about basis semantics. It loses a point for being one dense block with parenthetical-heavy phrasing and for repeating the period enum already in the schema.

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?

There is no output schema, yet the description fully characterizes what comes back under each basis: income, VAT-excluded expenses by category and profit per currency for cash; revenue, cost of sales, gross profit, expenses and net profit in AED by report line for ledger. Combined with the access and default notes, an agent has everything needed to call and present 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 period enum, date formats, and business_id sourcing are already documented in the schema. The description restates the same period values and the custom date pairing without adding syntax or filtering semantics beyond what is already there; baseline 3 is appropriate.

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 states a specific verb and resource ('Profit and loss for a period') and immediately anchors it to a concrete artifact: 'the same figures as the Profit & loss page in Fatura Go'. It also names the siblings it is not ('calculate_profit', 'get_vat_summary'), so an agent can distinguish it without opening any schema.

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?

Explicit use case ('when the user asks about their profit, income and expenses'), explicit period options with the default called out, explicit access prerequisites ('Needs access to expenses (or accounting once the books are on)'), and explicit exclusions routing to two named alternatives.

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.

Resources