Back to Ruflo

ADR-030: MCP Tool Gap Analysis — Old Chat System vs HF Chat UI

ruflo/docs/adr/ADR-030-MCP-TOOL-GAP-ANALYSIS.md

3.6.3012.0 KB
Original Source

ADR-030: MCP Tool Gap Analysis — Old Chat System vs HF Chat UI

Status

Implemented — Phase 1+2 Complete (2026-03-04)

Date

2026-03-04

Context

The custom chat system (extensions-cloudrun/apps/chat-system) has 24+ Cloud Function integrations, 40+ natural language intent patterns, document parsing, semantic search, and rich case context awareness. The HF Chat UI (chat.conveyorclaims.ai) currently exposes only 5 MCP tools with ~15% of available Cloud Function actions. This ADR documents what's missing and prioritizes what to add.

Current State: 5 MCP Tools

ToolRoutes ToActions Exposed
search_workflowsworkflow-searchsearch (query + limit only)
query_databasedb-query-agentnl_query only
manage_caseairtable-agent / case-managerstatus, list, next_steps, update
run_simulationsimulation-agentrun_qlearning only
airtable_queryairtable-agentsearch, list, get, create, update

Gap Analysis

1. Completely Missing Cloud Functions (6 services, 0% exposed)

Cloud FunctionActions AvailableUse CasePriority
embeddings-agentembed, batch, search, store, trajectory, drift, consolidate (14 actions)Semantic search across all data, vector similarityHIGH
research-agentsearch, research, compare, fact_check (4 actions)External knowledge, web search, fact verificationHIGH
suggestion-agentgenerate, quick, data_driven (3 actions)AI-powered settlement suggestions, next-step recommendationsMEDIUM
chat-historycreate, get, list, add_message, search, patterns, drift (15 actions)Persistent conversation learning, cross-session contextMEDIUM
gdrive-workflow-syncsync (scheduled)Manual workflow document sync triggeringLOW
pandadoc-webhookevent handlerDocument lifecycle eventsLOW

2. Partially Exposed Functions (actions hidden)

airtable-agent: 3/11 actions exposed (73% hidden)

ActionExposed?What It Does
queryYesSearch/filter records
get_case_statusYesCase metadata lookup
upsertYesCreate/update records
summarizeNOAI-powered case summary via Gemini (overview, financials, risk assessment, recommendations)
parse_documentNOParse single PDF/image attachment via Gemini Vision API
parse_documentsNOParse ALL attachments from a record (75+ document fields searched)
parse_by_caseNOFind case by number/name then parse all documents
analyzeNOStatistical analysis of table data (numeric stats, categorical distributions)
learnNOPattern detection across records
syncNOSync Airtable data to PostgreSQL
healthN/AHealth check

Impact: The user asking "pull the client insurance policy for C-01748" CANNOT work because parse_by_case and parse_documents are not exposed. The old chat system would find the case, locate the "IC Policy PDF" attachment field, download and parse it via Gemini Vision, and return extracted data (dates, amounts, parties, claims).

db-query-agent: 1/6 actions exposed (83% hidden)

ActionExposed?What It Does
nl_queryYesNatural language → SQL via Gemini
queryNOExecute raw SQL queries
schemaNOGet database table structure
columnsNOList columns for a table
analyticsNO6 predefined reports: case_summary, episode_performance, strategy_performance, daily_activity, carrier_analysis, revenue_forecast

simulation-agent: 1/6 actions exposed (83% hidden)

ActionExposed?What It Does
run_qlearningYesRun Q-learning simulation
get_optimalNOGet pre-trained best strategy for case type
statsNOAggregate simulation statistics
record_episodeNORecord learning episode
find_similarNOFind similar past scenarios

workflow-search: Missing 5 filter parameters

ParameterExposed?What It Does
queryYesSearch text
limitYesMax results
siloNOFilter by workflow silo (1-8)
roleNOFilter by responsible role
chunkTypeNOFilter by content type (step, faq, table, etc.)
minSimilarityNOMinimum similarity threshold
vectorWeightNOWeight between vector vs keyword search

3. Old Chat System Features Not Available in HF Chat UI

FeatureOld Chat SystemHF Chat UIGap
Document parsingparse_documents, parse_by_case, query_case_document — extracts dates, amounts, parties from PDFs/imagesNot availableCRITICAL
Case summarizationAI-generated case overview with financials, risk, recommendationsOnly raw field data returnedHIGH
Semantic searchembeddings-agent with 384d vectors, similarity searchNot availableHIGH
Web search / researchresearch-agent with Google Search grounding, fact-checkingNot availableHIGH
Workflow silo filteringFilter by silo number, role, chunk typeOnly text queryMEDIUM
Analytics reports6 predefined report types (case_summary, revenue_forecast, etc.)Only nl_queryMEDIUM
Simulation strategiesget_optimal, stats, find_similarOnly run_qlearningMEDIUM
Case context detectionAuto-detects case mentions, maintains context across turnsNo context persistenceMEDIUM
Document type queries"what is the RP LOR signed date for C-02161?"Cannot query documentsCRITICAL
AI suggestionsProactive next-step suggestions based on case contextNot availableLOW
Conversation persistencechat-history with learning patternsMongoDB only (no learning)LOW

4. Document Fields the Old System Can Access (75+)

The old chat system searches these Airtable attachment fields when parsing documents:

Client Documentation: Client Estimate, Client Proof of Loss, Client Invoices, Client Damage Reports, Client Inspection Reports, Client Photo Documentation, Client Expert Reports, Client Supporting Documentation, Client Strategy Docs, Client Contractor Documentation, Client Roof Report, Client Shingle Report, Client Weather Report, Client Field Adjuster Photos

Insurance Company Documentation: IC Policy PDF, IC Estimates, IC Payment Summary (SOL), IC Coverage/Ack. Letters, IC Expert Reports, IC Damage Reports, IC Supporting Documentation, IC Estimate & Docs

Legal Documentation: RP LOR, RP Contract, Completed Retainer Agreement, Client Consent Forms, LOR/DL, Demand Letter Draft

Litigation Documentation: Summons, Complaint, S/C Served, Answer, Discovery to/from Defendant, Default Docs, Deposition Docs, Subpoena Docs, Motions, Mediation Docs, Appeal, Voluntary Dismissal, Litigation Documents, Litigation Invoices

Settlement & Appraisal: Settlement Release, Full and Final Release, Insurance Checks, Appraisal Demand Letter, Appraisal Response(s), Appraisal Documents, Umpire Documents

Implementation: Phased MCP Tool Expansion

Phase 1: IMPLEMENTED (2026-03-04) — Document Access + Case Summarization

Added 3 new MCP tools:

ToolRoutes ToTest Result
summarize_caseairtable-agent → summarizeOK — returns case summary with status, financials
parse_case_documentsairtable-agent → parse_by_caseOK — parsed GAF roof report PDF from C-01748
analyze_tableairtable-agent → analyzeOK — returned 25 carrier records with field analysis

Fixes applied:

  • Changed summarize_case default table from "Cases" to "Managed Cases" (has {Client Name} field)
  • Fixed parseByCase in airtable-agent to extract numeric ID from case numbers (e.g., "01748" from "C-01748") for flexible Airtable FIND() matching

Phase 2: IMPLEMENTED (2026-03-04) — Research + Analytics + Enhanced Tools

Added 3 new tools and enhanced 2 existing tools:

ToolRoutes ToTest Result
search_knowledgeembeddings-agent → searchOK — 5 semantic results for "settlement strategy"
web_researchresearch-agent → search/research/compare/fact_checkOK — detailed Florida bad faith law analysis with Google Search grounding
analytics_reportdb-query-agent → analyticsOK — case_summary with 3 case types, revenue_forecast

Enhanced tools:

ToolEnhancementTest Result
search_workflowsAdded silo, role, chunkType, minSimilarity filtersOK — filters pass through to workflow-search
run_simulationAdded get_optimal, find_similar, stats actionsOK — get_optimal returns "conservative" for fire_damage

Fixes applied:

  • Normalize case type spaces to underscores ("fire damage""fire_damage") for DB matching

Phase 3: Remaining (Future)

  • get_suggestions — AI settlement/next-step suggestions (suggestion-agent)
  • conversation_memory — Cross-session learning patterns (chat-history)
  • Enhanced manage_case — create, stats actions
  • get_schema — Database introspection (db-query-agent → schema/columns)

Current State: 11 MCP Tools (2026-03-04)

#ToolCloud FunctionActionsStatus
1search_workflowsworkflow-searchsearch (with silo/role/chunkType/minSimilarity)Live
2query_databasedb-query-agentnl_queryLive
3manage_caseairtable-agent / case-managerstatus, list, next_steps, updateLive
4run_simulationsimulation-agentsimulate, get_optimal, find_similar, statsLive
5airtable_queryairtable-agentsearch, list, get, create, updateLive
6summarize_caseairtable-agentsummarizeLive
7parse_case_documentsairtable-agentparse_by_case, parse_documentLive
8analyze_tableairtable-agentanalyzeLive
9search_knowledgeembeddings-agentsearchLive
10web_researchresearch-agentsearch, research, compare, fact_checkLive
11analytics_reportdb-query-agentanalytics (6 report types)Live

Summary Statistics

MetricOriginal (5 tools)After Phase 1+2 (11 tools)Full Parity
MCP Tools51114+
Actions Exposed11 (~15%)30+ (~42%)50+ (~70%)
Cloud Functions Used5/117/1110/11
Document ParsingNoYesYes
Case SummarizationNoYesYes
Semantic SearchNoYesYes
Web ResearchNoYesYes
Analytics ReportsNoYesYes
Simulation StrategiesPartialFullFull
Workflow FilteringNoYesYes

Test Results (2026-03-04)

All 11 tools verified via API:

1. search_workflows     — OK (silo/role/chunkType filters work)
2. query_database       — OK (NL→SQL via Gemini)
3. manage_case          — OK (C-01748 → "C - 01748 - Sonya Spalding")
4. run_simulation       — OK (get_optimal: conservative for fire_damage, find_similar: episodes found)
5. airtable_query       — OK (case search, table browse)
6. summarize_case       — OK (case summary with status)
7. parse_case_documents — OK (1 doc parsed, GAF roof report PDF)
8. analyze_table        — OK (25 carrier records)
9. search_knowledge     — OK (5 semantic results)
10. web_research        — OK (Google Search grounded answers with citations)
11. analytics_report    — OK (case_summary: 3 case types with stats)
ADRRelationship
ADR-014Old chat system architecture (feature source)
ADR-024Workflow context injection (partially implemented)
ADR-029HF Chat UI deployment (current state)
ADR-031Chat history persistence (MongoDB Atlas)