Home/Tools/@tpmjs/tools-health-score-calculate

healthScoreCalculateTool

@tpmjs/tools-health-score-calculate

Calculates a comprehensive customer health score from usage, support, payment, and engagement data. Provides weighted component scores, risk assessment, and actionable recommendations for customer success teams.

Official
cx
v0.1.0
MIT
⚠️

This tool is currently broken

Execution Failed
Runtime error with test parameters
Customer must have a non-empty id

Last checked: 3/1/2026, 4:29:54 AM

Interactive Playground

Test @tpmjs/tools-health-score-calculate (healthScoreCalculateTool) 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/tools-health-score-calculate
pnpm add @tpmjs/tools-health-score-calculate
yarn add @tpmjs/tools-health-score-calculate
bun add @tpmjs/tools-health-score-calculate
deno add npm:@tpmjs/tools-health-score-calculate

2. Import the tool

import { healthScoreCalculateTool } from '@tpmjs/tools-health-score-calculate';

3. Use with AI SDK

import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
import { healthScoreCalculateTool } from '@tpmjs/tools-health-score-calculate';

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

console.log(result.text);

Signature

(customer: { id: string; name: string; usage: { lastLoginDate: string; apiCallsPerDay: number; dailyActiveUsers: number; monthlyActiveUsers: number; featureAdoptionRate: number }; payment: { paymentFailures: number; daysUntilRenewal: number; onTimePaymentRate: number; outstandingBalance: number }; support: { csat: number; openTickets: number; totalTickets: number; escalationRate: number; avgResolutionTime: number } }, weights?: { usage: number; payment: number; support: number; engagement: nu...

Tags

ai
analytics
calculate
calculates
comprehensive
customer
customer-experience
customer-success
cx
data
engagement
health
health-score
payment
score
support
tpmjs
usage

Parameters

Available configuration options

Auto-extracted
customer
Required
Type: object

Customer data with usage, support, payment, and engagement metrics

weights
Optional
Type: object

Component weights for health score calculation (must sum to 1.0)

Schema extracted: 3/1/2026, 4:29:53 AM

README

ERROR: No README data found!

Statistics

Downloads/month

6

GitHub Stars

0

Quality Score

73%

Bundle Size

NPM Keywords

tpmjs
customer-experience
ai
health-score
customer-success
analytics

Maintainers

thomasdavis(thomasalwyndavis@gmail.com)

Frameworks

vercel-ai
healthScoreCalculateTool | TPMJS | TPMJS