Skip to main content
Glama

Diagnose P&L

diagnose_pnl
Read-only

Explains a seller's settled P&L for a period: revenue, fees, COGS and margin overall and per channel, unpaid (unsettled) orders/returns, unmapped SKUs, SKUs with no cost price, why a channel shows zero fees, and the worst-margin SKUs. Covers Amazon, Flipkart, Meesho, Myntra, Snapdeal, JioMart, Shopify, offline; settled orders only.

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": "diagnose_pnl"
  }
}

Input Schema

NameRequiredDescriptionDefault
sinceNoStart date (ISO, e.g. 2026-10-01, IST day). For "this month" send the 1st of the current month; for "last month" send its 1st with until = its last day. Default: 30 days ago.
untilNoEnd date (ISO, inclusive IST day). Default: today.
searchNoOptional SKU / product-name substring to narrow to one product.
channelNoLimit to one channel. Default: all connected channels.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / since / description
      Previous value: -"Start date (ISO, e.g. 2026-10-01, IST day). Default: 30 days ago."New value: +"Start date (ISO, e.g. 2026-10-01, IST day). For \"this month\" send the 1st of the current month; for \"last month\" send its 1st with until = its last day. Default: 30 days ago."
  2. Added

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnlyHint=true, destructiveHint=false, openWorldHint=false), so the description's job is added context. It does that well by disclosing the key coverage constraint ("settled orders only") and the full set of channels analyzed. It does not discuss data freshness, computation caveats, or how unmapped SKUs / missing cost prices affect the resulting numbers.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single dense sentence that front-loads the core purpose and then packs the diagnostic list without filler. Every clause corresponds to something the tool actually reports, and the trailing channel/scope clause closes it efficiently.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return-value documentation is unnecessary, and the description instead supplies the enumeration of diagnostics plus the settled-only and channel-coverage constraints – enough for an agent to call it correctly. The main residual gap is the absence of guidance distinguishing it from get_pnl_summary, which a diagnostic-vs-summary contrast would have resolved.

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 schema already explains the ISO date patterns, the "this month"/"last month" convention, the SKU substring search, and the channel enum, so the baseline of 3 applies. The description adds nothing about parameters – notably it never mentions that the date window is inclusive IST days or that search narrows to a single product.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource ("Explains a seller's settled P&L for a period") and then enumerates exactly what it diagnoses: revenue, fees, COGS, margin, unsettled orders/returns, unmapped SKUs, missing cost prices, zero-fee channels, worst-margin SKUs. An agent immediately understands this is a diagnostic/explanation tool rather than a raw summary. It does not name the closely related sibling get_pnl_summary or get_fee_breakdown, so the boundary with those is left to inference.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied rather than stated: the verb "Explains" and the diagnostic content list signal this is the tool to reach for when numbers need explaining, and "settled orders only" scopes it away from unsettled data. However there is no explicit when-to-use/when-not-to-use statement and no named alternative such as get_pnl_summary, which appears to overlap heavily.

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