MCPcopy
hub / github.com/upstash/context7 / formatTrust

Function formatTrust

packages/cli/src/utils/prompts.ts:52–57  ·  view source on GitHub ↗
(score: number | undefined)

Source from the content-addressed store, hash-verified

50 * Uses MCP reputation thresholds: >=7 High, >=4 Medium, <4 Low.
51 */
52export function formatTrust(score: number | undefined): string {
53 if (score === undefined || score < 0) return pc.dim("-");
54 if (score >= 7) return pc.green("High");
55 if (score >= 4) return pc.yellow("Medium");
56 return pc.red("Low");
57}
58
59/**
60 * Returns the raw trust label string (uncolored) for width calculations.

Callers 3

installCommandFunction · 0.85
searchCommandFunction · 0.85
suggestCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected