Skip to main content
Glama

Profit and loss

get_pnl
Read-onlyIdempotent

The headline P&L for the current period, each with previous: netRevenue (without VAT, after returns), cogs, grossProfit, grossMarginPct, adSpend and contribution (gross profit − ad spend: the contribution margin), plus cogsCoverage (share of revenue whose cost is known, 0..1) and marginBasis (measured = real costs; blended or entered = partly or wholly the margin the brand entered). targets compares the period with the brand's targets: contribution margin % and ROAS, each with actual, target, variance (actual − target) and meetsTarget; targetsSource says where the targets came from (operator = the brand set them, catalog or benchmark = Nuira's default for its vertical — say so). Use for profit, margin, P&L, 'are we on target'. For the step-by-step waterfall use get_contribution_breakdown. Optional from and to (inclusive YYYY-MM-DD, both or neither, never after today) read another span instead of the default period. A named month, a week or two dates the operator gave MUST be sent here: without them this reads the default period (the one on the operator's screen, else the last 30 days), which is not that month. When the operator names no period, send neither.

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_pnl"
  }
}

Input Schema

NameRequiredDescriptionDefault
toNoLast day of the span, inclusive, as YYYY-MM-DD; not after today. Send together with `from`, or omit both to read the default period: the one on the operator's screen when the message names it, else the last 30 days.
fromNoFirst day of the span, inclusive, as YYYY-MM-DD. Send together with `to`, or omit both to read the default period: the one on the operator's screen when the message names it, else the last 30 days.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / from / description
      Previous value: -"First day of the span, inclusive, as YYYY-MM-DD. Send together with `to`, or omit both to read the default 30-day period."New value: +"First day of the span, inclusive, as YYYY-MM-DD. Send together with `to`, or omit both to read the default period: the one on the operator's screen when the message names it, else the last 30 days."
    • changedInput schema / properties / to / description
      Previous value: -"Last day of the span, inclusive, as YYYY-MM-DD; not after today. Send together with `from`, or omit both to read the default 30-day period."New value: +"Last day of the span, inclusive, as YYYY-MM-DD; not after today. Send together with `from`, or omit both to read the default period: the one on the operator's screen when the message names it, else the last 30 days."
  2. Added

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive, closed-world, so the safety profile is covered. The description adds real behavioral context beyond that: the default period resolution (operator's screen period, else last 30 days), the inclusive-not-after-today constraint, and how to interpret cogsCoverage, marginBasis and targetsSource (including that catalog/benchmark targets are Nuira defaults and should be said so). No error or failure behavior is described, which keeps it below a 5.

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?

Information-dense with no filler sentences, but the field inventory and interpretive notes for targets dominate the opening and the primary 'use for' routing sentence lands mid-paragraph. Front-loading the routing/period rule would improve scanability; nothing is redundant.

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, so the description carries the return-value burden and does so field by field, including derived metrics (contribution = gross profit − ad spend) and the targets block structure. Period handling and the alternative tool are both covered, leaving nothing an agent needs to call it correctly.

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

Parameters4/5

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

Schema coverage is 100% and both date parameters are already documented in-schema, so the baseline is 3. The description adds the coupling rule (both or neither), the never-after-today bound, and the consequence of omitting them (default period, which is not the named month), giving semantics the schema alone does not state.

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?

States a specific verb+resource (headline P&L for the current period) and enumerates the exact fields returned: netRevenue, cogs, grossProfit, grossMarginPct, adSpend, contribution, cogsCoverage, marginBasis, plus a targets block. It also explicitly names the sibling to use for the waterfall (get_contribution_breakdown), so an agent can separate the two without opening either 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?

Gives explicit use triggers ('profit, margin, P&L, are we on target'), names the alternative for step-by-step detail, and spells out the period decision rule: named month/week/two dates MUST be sent as from/to, no named period means send neither. That is when-to-use plus when-not-to-use with a concrete routing condition.

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