Skip to main content
Glama

NPS (revenue-weighted)

analyze_nps
Read-onlyIdempotent

Compute standard and revenue-weighted NPS, rank detractors by MRR at risk to surface when top accounts are unhappy.

Instructions

NPS for the product: the standard −100…100 score AND revenue-weighted NPS (each respondent weighted by their account MRR), plus detractor accounts ranked by MRR-at-risk (highest first). Surfaces when your biggest customers are the unhappy ones even if the headline looks fine. Computed deterministically off survey responses inside window_days (default 90, valid 1–365); returns an empty result when none fall in the window. product_id optional (primary product when omitted). Quantify sentiment after get_product_brain, then dig into a detractor with get_customer_360.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
product_idNoProduct id, from whoami (optional; the org's primary product when omitted).
window_daysNoLookback window in days (optional; default 90, i.e. the last quarter).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.14
  2. Removedv0.1.12
  3. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already establish read-only and idempotent behavior. The description adds valuable behavioral specifics: deterministic computation from survey responses, handling of window_days with default and valid range, and empty result when no responses fall in the window. It also surfaces the business scenario of unhappy high-MRR customers, which goes beyond annotations.

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?

Four dense sentences convey outputs, business value, computation behavior, edge cases, and workflow without filler. Every sentence adds distinct information, and the structure front-loads the primary purpose.

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?

Given the absence of an output schema, the description adequately explains return values (standard NPS, revenue-weighted NPS, detractor accounts). It covers computation method, parameter behavior, edge cases, and integration with adjacent tools, making it complete for an analysis tool with strong annotations.

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 already covers both parameters with descriptions, but the description adds a maximum constraint for window_days (365) that is absent from the schema. It also clarifies how window_days influences computation and restates product_id optionality. This is meaningful supplemental information beyond schema.

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?

The description clearly states the tool computes standard NPS, revenue-weighted NPS, and detractor accounts ranked by MRR-at-risk. This specific verb+resource combination distinguishes it from sibling analysis tools like analyze_funnel and analyze_nrr.

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

Usage Guidelines4/5

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

Provides explicit workflow guidance: quantify sentiment after get_product_brain, then dig into a detractor with get_customer_360. This gives context on when to use the tool in sequence, though it doesn't state explicit 'when-not' conditions or alternatives for exclusion.

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