Skip to main content
Glama

TIF Score MCP

An MCP (Model Context Protocol) server that exposes three tools to any MCP-compatible client (Claude Desktop, Claude Code, or anything else that speaks MCP):

  • score_conversation — analyzes a call transcript and returns structured business intelligence.

  • get_lead_score — scores a transcript 0-100 and classifies it hot / warm / cold.

  • diagnose_workflow_error — given an n8n workflow's JSON and an error message, returns a root cause and a proposed minimal fix.

This is a port, not a rewrite: the scoring prompt and weighting logic are adapted from a real, working conversation-analysis and lead-scoring pipeline (company and product names generalized for this public repo), and the workflow-diagnosis tool is a scoped-down port of a larger workflow self-healing system's diagnostic reasoning. See docs/BTS.md for a plain-language writeup of the whole process, from planning through finished server.

Demo

Real MCP server, real Claude API calls, real output — no mocked data. Generated by running demo/run-demo.mjs (npm run demo):

Demo: all three tools called over real stdio JSON-RPC, real Claude API responses

A produced walkthrough is also available: demo/promo/tif-score-mcp-promo.mp4 (46s) — why this exists, the three tools, and the same real terminal footage above, narrated.

Related MCP server: n8n-mcp

Tools

score_conversation

Input:

{
  "transcript": "Agent: Thanks for calling...\nCaller: Hi, I need to book...",
  "call_duration": 184,
  "raw_outcome": "completed",
  "source_system": "Retell"
}

Output:

{
  "intent": "booking",
  "sentiment": "positive",
  "urgency": "high",
  "objections": ["price"],
  "outcome": "booked",
  "topics": ["appointment booking", "pricing question"],
  "missed_opportunity": false,
  "follow_up_needed": false,
  "revenue_signal": "high",
  "churn_risk": false,
  "ai_summary": "The caller wanted a same-day appointment and asked about price before booking. They booked a 4pm slot despite the price being a bit higher than expected."
}

get_lead_score

Same input shape as score_conversation, plus an optional repeat_caller boolean (see Known limitation below).

Output:

{
  "score": 75,
  "tier": "hot",
  "signals_used": ["high urgency (+25)", "booking intent (+20)", "booked outcome (+20)", "positive sentiment (+10)"]
}

Scoring weights:

Signal

Points

High urgency

+25

Booking intent

+20

Booked outcome

+20

Repeat caller

+15

Asked about pricing

+10

Positive sentiment

+10

Negative or frustrated sentiment

-15

Dropped call

-10

Low-intent inquiry

-10

Score is clamped to 0-100. Bands: 70-100 hot, 40-69 warm, 0-39 cold.

diagnose_workflow_error

Input:

{
  "workflowJson": { "name": "...", "nodes": [...], "connections": {...} },
  "errorMessage": "Cannot read properties of undefined (reading 'toUpperCase')"
}

Output:

{
  "rootCause": "The Code node assumes $json.body.customer always exists, but the webhook can receive a payload without a customer object.",
  "fixSummary": "Add optional chaining so the node doesn't throw when customer is missing.",
  "fixable": true,
  "fixedWorkflow": { "...": "complete corrected workflow JSON" },
  "confidence": "medium",
  "notes": "Verify the caller of this node can tolerate a null email before deploying."
}

Scope note: this tool is a deliberately scoped-down port of a larger, stateful self-healing system. The original dispatches a separate evaluator sub-agent so the fix-generator never grades its own work, retries once on a rejected fix, fetches and writes back to a live n8n instance, and persists memory between runs. None of that fits inside one stateless MCP tool call, so only the diagnostic reasoning was ported: classify the error, propose the smallest possible fix, and admit honestly when a workflow edit can't fix it (expired credentials, rate limits, upstream outages, etc). Treat fixedWorkflow as a starting point for human or separate review, not something to auto-deploy.

Known limitation: repeat_caller

The "repeat caller" signal (+15 points) can't be derived from a transcript's text alone — it requires knowing call history, which this stateless tool doesn't have access to. If you already know this from your own CRM or call log, pass repeat_caller: true explicitly; otherwise it defaults to false and that signal is simply not counted.

Setup

npm install
cp .env.example .env
# edit .env and set ANTHROPIC_API_KEY

Registering with an MCP client

Add this to your .mcp.json (or the equivalent config for your client), using an absolute path since .mcp.json doesn't reliably resolve relative paths across clients:

{
  "mcpServers": {
    "tif-score-mcp": {
      "command": "node",
      "args": ["/absolute/path/to/tif-score-mcp/src/index.js"],
      "env": {
        "ANTHROPIC_API_KEY": "your-key-here"
      }
    }
  }
}

Restart your MCP client afterward so it picks up the new server.

Testing

npm run test:unit    # pure scoring-math tests, no network, no API key needed
npm run test:client  # spawns the real server, calls all three tools over real stdio JSON-RPC — needs ANTHROPIC_API_KEY, makes real (billed) API calls

You can also poke all three tools interactively without writing any code:

npx @modelcontextprotocol/inspector node src/index.js

A model compatibility note

This server defaults to claude-sonnet-4-6 with temperature: 0 for deterministic output. That's a deliberate choice: claude-sonnet-4-6 is the newest model that still accepts the temperature parameter — newer models (Opus 4.7+, Fable 5) reject it outright. If you change TIF_MODEL to a newer model, remove temperature from the calls in src/lib/anthropic.js first, or every tool call will fail.

Security

Never commit real API keys. .env is gitignored from the first commit, and .mcp.json in this repo only ever contains a placeholder — fill in your real key locally, not in version control.

Project layout

See CLAUDE.md for a fuller orientation, LEARNINGS.md for decisions made while building this, and SKILLS.md for which tools/skills this project leaned on.

License

MIT — see LICENSE.

Available Tools

3 tools
diagnose_workflow_errorDiagnose Workflow ErrorA

Stateless diagnosis of an n8n workflow error: given the workflow JSON and error message, returns a root cause, a minimal proposed fix (or an honest 'not fixable by a workflow edit'), and a confidence level. Does not verify, deploy, or fetch anything live — pair with human or separate review before applying fixedWorkflow.

ParametersJSON Schema
NameRequiredDescriptionDefault
errorMessageYes
workflowJsonYesThe full n8n workflow JSON object (nodes + connections).

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations provided, the description carries full burden and handles it well: it explicitly declares statelessness, no live fetching/verification/deployment, and the honest 'not fixable' output possibility. It also warns about applying fixedWorkflow without review. This is strong behavioral disclosure absent any annotation support.

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?

Three sentences, zero filler. The first sentence packs purpose, inputs, and outputs. The second clarifies the stateless boundary. The third advises on safe application of the result. Every sentence earns its place with front-loaded core purpose.

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

Completeness4/5

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

For a 2-param tool with nested objects but no output schema, the description covers purpose, behavioral scope, and honest-limit disclosures well. Missing output schema means the agent can't see the return shape (rootCause/fixedWorkflow/confidence structure), but the description names the return elements in prose, partially compensating. Could add parameter format specifics, but overall adequate.

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

Parameters3/5

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

Schema coverage is 50%: errorMessage has only a minLength constraint, and workflowJson has a description ('The full n8n workflow JSON object (nodes + connections)'). The tool description adds input context but doesn't elaborate much beyond the schema. The description implies how parameters are consumed (as inputs to diagnosis) but adds limited format/semantic detail beyond what the schema states.

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 uses a specific verb ('diagnose') plus resource (n8n workflow error), states the inputs (workflow JSON + error message), and clearly lists the outputs (root cause, proposed fix, confidence level). It also distinguishes from siblings by being stateless diagnosis while get_lead_score and score_conversation imply scoring/analytics tools.

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?

The description clearly states what it does NOT do ('does not verify, deploy, or fetch anything live') and advises pairing with human or separate review. It doesn't explicitly name alternative tools for when-not-to-use, but the stateless scope and non-verification caveat provide clear contextual boundaries.

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

get_lead_scoreGet Lead ScoreA

Score a call transcript 0-100 and classify it hot/warm/cold. Internally runs the same analysis as score_conversation, then applies a point-based weighting to the resulting signals.

ParametersJSON Schema
NameRequiredDescriptionDefault
transcriptYes
raw_outcomeYesThe source system's own outcome label, e.g. 'completed', 'no-answer'.
call_durationYesCall duration in seconds.
repeat_callerNoSet true if the caller is known (via an external CRM/call-history lookup outside this tool) to have called before. Cannot be inferred from transcript text alone.
source_systemYesWhere this transcript came from, e.g. 'Retell', 'CRM', 'call center software'.

TDQS

A4.1/5.0
Behavior4/5

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

The description discloses a key behavior: that it internally reuses score_conversation's analysis before applying weighting. This gives the agent insight into the tool's internal mechanics. It also notes the repeat_caller param depends on external lookup, adding context. No annotations exist, so the description carries the burden, and it discloses the reuse behavior that would otherwise be invisible.

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?

Two concise sentences that state purpose, output, and the key relationship to the sibling tool. Efficient and front-loaded with the outcome. Could potentially clarify the weighting scheme, but no wasted words.

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

Completeness4/5

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

For a scoring tool with 5 params (4 required) and no output schema, the description communicates the core output (0-100 score, hot/warm/cold classification) and the internal pipeline. Missing return-format detail (e.g., does it return a JSON object, structured fields?) but given no output schema and moderate complexity, this is reasonably complete.

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

Parameters3/5

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

Schema coverage is 80%, with descriptions on raw_outcome, call_duration, repeat_caller, and source_system. The tool description doesn't elaborate on parameter semantics beyond what the schema provides, but that's acceptable given high coverage. The behavior it adds about repeat_caller being externally determined aligns with the schema's note. Baseline 3 is appropriate.

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?

Clear verb+resource ('Score a call transcript 0-100 and classify it hot/warm/cold'). Describes what it does, what it returns, and explicitly distinguishes from sibling score_conversation by noting it 'Internally runs the same analysis' then applies 'point-based weighting'.

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?

The description clearly distinguishes from score_conversation by noting the internal reuse and additional weighting step, implying get_lead_score builds on the base scoring. However, it doesn't explicitly state when a user should choose this tool over score_conversation or diagnose_workflow_error, leaving some ambiguity about the decision.

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

score_conversationScore ConversationA

Analyze a call transcript and extract structured business intelligence: intent, sentiment, urgency, objections, outcome, topics, missed-opportunity/follow-up flags, revenue signal, churn risk, and a plain-English summary.

ParametersJSON Schema
NameRequiredDescriptionDefault
transcriptYes
raw_outcomeYesThe source system's own outcome label, e.g. 'completed', 'no-answer'.
call_durationYesCall duration in seconds.
source_systemYesWhere this transcript came from, e.g. 'Retell', 'CRM', 'call center software'.

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations provided, the description carries the disclosure burden. It clearly states the tool analyzes and produces derived metrics but does not reveal whether there are side effects (e.g., persistence, write-back to CRM), whether the raw transcript is retained, or what happens on unprocessable input. For an analysis tool this is moderate transparency, but no side-effect or input-limit behavior is mentioned.

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 a single dense sentence that front-loads the action and enumerates outputs efficiently. It is complete without being verbose, though it could arguably be split for readability. No wasted words, earns its length.

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

Completeness3/5

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

The tool has 4 required parameters, no output schema, and no annotations, so the description is the sole guide. It explains the broad outputs well, but with no output schema it does not communicate the return format or structure of the extracted intelligence, and the sibling get_lead_score suggests a related scoring ecosystem whose differentiation is unresolved. Adequate but leaves room for more.

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

Parameters3/5

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

Schema description coverage is 75%, so parameters are largely self-documenting (raw_outcome gets an example, call_duration gets units, source_system gets examples). The description adds that analysis is structured 'business intelligence' but does not clarify how call_duration or source_system influence the scoring, which would add value beyond the schema. One parameter has no description in schema, though the description partially covers the overall intent.

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 uses a specific verb ('Analyze') with a clear resource ('a call transcript') and enumerates the exact structured outputs it produces: intent, sentiment, urgency, objections, outcome, topics, flags, revenue signal, churn risk, and a summary. This clearly distinguishes it from sibling tools like get_lead_score (score retrieval) and diagnose_workflow_error (error diagnostics).

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

Usage Guidelines3/5

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

The description implies usage for call transcripts yielding business intelligence but provides no explicit when-to-use vs alternatives guidance. It doesn't exclude scenarios or direct the agent toward when the score_conversation tool is preferable over get_lead_score, which could be relevant given 'revenue signal' and 'churn risk' outputs overlap thematically.

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

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 3 tool updatesv1.0.0
    • First observeddiagnose_workflow_error
    • First observedget_lead_score
    • First observedscore_conversation

TDQS

B3.4/5.0

Scored across 3 tools

Disambiguation3/5

get_lead_score and score_conversation both analyze call transcripts and clearly overlap — get_lead_score even notes it runs the same analysis as score_conversation. This creates real ambiguity about which to call. diagnose_workflow_error is completely distinct, but the two scoring tools blur boundaries significantly.

Naming Consistency3/5

Tools use a consistent verb_noun pattern (get_lead_score, diagnose_workflow_error, score_conversation) with snake_case throughout. The naming styles are readable and consistent, though the verbs are somewhat varied (get, diagnose, score). No mixing of case conventions or chaotic patterns.

Tool Count2/5

Three tools is at the thin end but not necessarily inappropriate. However, two of the three tools (get_lead_score and score_conversation) perform overlapping transcript analysis, making the actual distinct tool surface effectively two tools. The scope is unclear — the server mixes transcript scoring with completely unrelated n8n workflow diagnosis, suggesting no coherent singular purpose.

Completeness2/5

The transcript-analysis side lacks balance: it covers extraction and scoring but has no update, correction, or batch-processing capability. The n8n workflow tool appears to be an orphan — a single diagnostic tool with no companion tools for related functionality. The two unrelated domains each feel incomplete, and the overall surface has no clear lifecycle coverage.

Maintenance

ActivitySlowing
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    An MCP server that provides AI assistants with access to documentation, schemas, and operations for over 535 n8n workflow automation nodes. It enables models to understand, create, and manage n8n workflows through natural language by connecting to the n8n API.
    77,070 npm
    MIT
  • A
    license
    B
    quality
    D
    maintenance
    A comprehensive MCP server that provides full control over n8n automation workflows through natural language. It offers 43 tools for managing workflows, executions, credentials, and data tables, with safety features like write-mode protection and double-validated workflow creation.
    43
    1
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    MCP server for integrating with n8n, enabling workflow automation and management through natural language.
    205 npm
    1
    MIT