Skip to main content
Glama

commerce_margin_analysis

Destructive

Identify profit margin trends and costs across your commerce operations. Use natural language or structured inputs to get actionable margin insights for pricing and performance decisions.

Instructions

Run the commerce domain agent action margin_analysis.

Routes through the platform's domain-agent dispatcher under your JWT, tenant, and company scope.

Args: message: Free-text objective for the action. inputs: Optional JSON string of structured inputs for the action.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputsNo{}
messageNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.4/5.0
Behavior2/5

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

The routing and scoping context (JWT, tenant, company) adds useful behavioral detail beyond what annotations provide. However, annotations flag destructiveHint=true, and the description never discloses what side effects running margin_analysis may have or what it could modify. This is not a direct contradiction, but for a destructive-flagged operation the description under-informs substantially.

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 description is compact and front-loaded, with the verb and resource in the first sentence followed by routing context and a clean Args block. Every sentence earns its place and there is no filler or redundant restatement of the schema.

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

Completeness2/5

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

The tool has an output schema and only two optional parameters, so the routing notes and minimal parameter explanations cover part of the picture. Yet the description omits what margin analysis returns, gives no usage conditions or alternatives, and stays silent on the destructive side effects flagged by annotations. For a domain-agent wrapper among hundreds of siblings, this is under-specified for reliable selection and invocation.

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

Parameters2/5

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

The Args block adds meaning the bare schema lacks: message is a 'Free-text objective' and inputs is an 'Optional JSON string of structured inputs for the action.' However, with 0% schema description coverage, the description needed to document what structured inputs margin_analysis actually accepts or how a message should be phrased for this specific action; it provides only generic wrapper boilerplate that would fit any domain-agent action.

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

Purpose3/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 ('Run the commerce domain agent action margin_analysis') and explains the routing mechanism through the domain-agent dispatcher. However, it never states what margin analysis actually computes or produces, making the purpose semantically circular. It also fails to differentiate this from commerce siblings like commerce_top_products_by_margin or commerce_revenue_by_product, which likely serve overlapping analytical goals.

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 explains how the call is routed (dispatcher under JWT, tenant, and company scope) but gives no guidance on when to invoke this tool versus alternatives. It does not reference the generic dispatch_domain_agent sibling or the more specific commerce_* analysis tools, and offers no conditions, exclusions, or use-case examples. An agent would have to guess when margin_analysis is the right choice.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools