Skip to main content
Glama

Gridly — AI copilot for WooCommerce

Profit margin by product

margin_report
Read-only

Revenue, cost and margin for the products sold in a period. Needs cost prices stored in WooCommerce (its Cost of Goods Sold field or a cost-of-goods plugin). Products without a cost are left out and counted.

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

Input Schema

NameRequiredDescriptionDefault
limitNoHow many rows to return (max 100).
storeNoStore address or id. Leave empty if you have only one store.
periodNotoday, yesterday, this_week, last_week, this_month, last_month, last_7_days, last_30_days, last_90_days, this_year, last_year — or YYYY-MM-DD..YYYY-MM-DD. Uses the store's own timezone.last_30_days

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already declare read-only, open-world, non-destructive behavior, so the safety profile is covered. The description adds valuable operational context beyond annotations: it requires WooCommerce cost-of-goods data and explicitly excludes and counts products without a cost.

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?

Two sentences, no wasted text. The report output is front-loaded, and the prerequisite/exclusion behavior follows immediately.

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?

For a read-only report with full parameter documentation and no output schema, the description covers purpose, required data source, and exclusion behavior. It does not explain the exact response shape or row-level fields, but it is largely complete for invocation.

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 all three parameters are already fully documented. The description does not add syntax, defaults, or format details beyond what the schema provides, so baseline 3 is appropriate.

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 clearly states that this is a product profit-margin report returning revenue, cost, and margin over a period. It distinguishes itself from tools like get_sales_summary or top_products by focusing on per-product margin, but it does not explicitly contrast with those siblings.

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

Usage Guidelines2/5

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

The description gives a prerequisite — cost prices must be stored in WooCommerce — but it does not say when to use this vs. alternatives such as top_products, compare_periods, or get_sales_summary. An agent gets some context but no routing guidance.

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