Home/Tools/@tpmjs/nps-analysis

npsAnalysisTool

@tpmjs/nps-analysis

Analyzes NPS survey responses to categorize by promoter/passive/detractor and extract themes from comments. Provides NPS score, distribution, and actionable insights.

Official
cx
v0.1.1
MIT

Interactive Playground

Test @tpmjs/nps-analysis (npsAnalysisTool) with AI-powered execution

0/2000 characters

Installation & Usage

Install this tool and use it with the AI SDK

1. Install the package

npm install @tpmjs/nps-analysis
pnpm add @tpmjs/nps-analysis
yarn add @tpmjs/nps-analysis
bun add @tpmjs/nps-analysis
deno add npm:@tpmjs/nps-analysis

2. Import the tool

import { npsAnalysisTool } from '@tpmjs/nps-analysis';

3. Use with AI SDK

import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
import { npsAnalysisTool } from '@tpmjs/nps-analysis';

const result = await generateText({
  model: openai('gpt-4o'),
  tools: { npsAnalysisTool },
  prompt: 'Your prompt here...',
});

console.log(result.text);

AI Agent Integration

How AI agents can use this tool

Use Case

Use this tool to analyze NPS survey results, identify themes from promoters and detractors, and extract actionable insights for product and customer success teams.

Limitations

Theme extraction is keyword-based. For deeper sentiment analysis, consider using an AI model. Requires sufficient response volume for meaningful analysis.

Examples

  • Analyze quarterly NPS survey results
  • Extract themes from detractor comments
  • Compare promoter vs detractor feedback

Signature

(responses: { date: string; score: number; comment: string; respondentId: string }[]) => Promise<unknown>

Tags

analysis
analytics
analyzes
categorize
customer-success
cx
detractor
extract
nps
passive
promoter
responses
survey
themes
tpmjs

Parameters

Available configuration options

Auto-extracted
responses
Required
Type: object[]

NPS survey responses with score (0-10) and optional comment

Schema extracted: 3/1/2026, 4:27:13 AM

README

ERROR: No README data found!

Statistics

Downloads/month

126

GitHub Stars

0

Quality Score

84%

Bundle Size

NPM Keywords

tpmjs
cx
nps
survey
customer-success
analytics

Maintainers

thomasdavis(thomasalwyndavis@gmail.com)

Frameworks

vercel-ai
npsAnalysisTool | TPMJS | TPMJS