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 last 30 days, which is not that month.

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 30-day period.
fromNoFirst day of the span, inclusive, as YYYY-MM-DD. Send together with `to`, or omit both to read the default 30-day period.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.2/5.0
Behavior3/5

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

Annotations already declare readOnly, idempotent, closed-world, non-destructive, so the safety profile needs no restating. The description adds genuinely useful semantics beyond that (contribution = gross profit minus ad spend, cogsCoverage is a 0..1 share, marginBasis distinguishes measured from blended/entered margins, targetsSource distinguishes operator targets from Nuira defaults), but it omits the one behavioral caveat the annotations do not cover: the silent 30-day fallback is only disclosed in the parameter paragraph rather than as a risk warning.

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?

Front-loaded with purpose and metrics, then routing, then parameters, so the important content comes first. It runs long and packs the return-field catalogue, target semantics and date rules into one dense paragraph, but with no output schema most of that detail is load-bearing rather than filler.

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 must carry the return shape itself - and it does, naming every field plus the nested targets object and its actual/target/variance/meetsTarget members. Combined with the metric definitions and date-span rules, an agent has everything needed to call and interpret the result.

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% and the two date params are already fully documented there, including the inclusive-YYYY-MM-DD format and the paired from/to rule. The description's param text mostly restates the schema; its only added value is the framing that omitting the dates yields a 30-day window that is not the operator's month.

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?

Opens with 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, targets). It explicitly separates itself from get_contribution_breakdown, so the agent can distinguish the two without reading the schemas.

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 trigger phrases ("Use for profit, margin, P&L, 'are we on target'"), names the alternative for the waterfall case (get_contribution_breakdown), and states a hard routing rule: if the operator named a month, week, or two dates, they MUST be sent here or the tool silently reads the last 30 days. That is a when/when-not rule with the failure mode spelled out.

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