Skip to main content
Glama
josuekongolo

CompanyIQ MCP Server

by josuekongolo
TIMEOUT_ISSUE_EXPLAINED.mdβ€’4.2 kB
# MCP Timeout Issue - Understanding & Solution **Error:** "No result received from client-side tool execution" **Root Cause:** Full automation (2-5 minutes) exceeds MCP tool timeout --- ## πŸ” What's Happening ### The Problem: **When you run:** `"Analyze financials for 999059198"` **What it tries to do:** 1. Check database (instant) βœ… 2. No data found 3. Trigger auto-scrape (2-5 minutes) ⚠️ - Launch browser - Find all years - Download 10-13 PDFs - Parse each PDF - Extract data - Save to database **MCP Protocol Timeout:** ~1-2 minutes typically **Result:** Tool times out before completing β†’ "No result received" --- ## βœ… The Solution: Two-Step Approach ### Use Tools Separately: **Step 1: Dedicated Scraping (use once)** ``` "Auto-scrape financials for 999059198" ``` **This tool is DESIGNED for long operations** - Takes 2-5 minutes - Downloads ALL years - Saves to database - **OK to take time** - it's a dedicated operation **Step 2: Fast Analysis (use anytime)** ``` "Analyze financials for 999059198" ``` **This tool is FAST** - Checks database (has data from Step 1!) - Returns instant analysis - No timeout issues --- ## 🎯 The Right Workflow ### For NEW Company (First Time): **Do This:** ``` 1. "Auto-scrape financials for 999059198" β†’ Wait 2-5 minutes (one-time) β†’ ALL years downloaded and saved 2. "Analyze financials for 999059198" β†’ Uses database (instant) β†’ Complete analysis! ``` **Don't Do This:** ``` ❌ "Analyze financials for 999059198" (on empty database) β†’ Tries to auto-scrape inline β†’ Times out β†’ Fails ``` --- ### For EXISTING Company (Has Data): **This Works:** ``` "Analyze financials for 999059198" β†’ Database has data β†’ Instant analysis β†’ NO timeout! ``` --- ## πŸ’‘ Recommendation: Disable Inline Auto-Scrape ### Keep It Simple: **analyze_financials:** - Should be FAST (for instant analysis) - Check database β†’ If has data: Analyze - If NO data β†’ Suggest running auto_scrape first - Don't trigger slow operations inline **auto_scrape_financials:** - Dedicated tool for slow operations - User knows it takes time - Returns when complete - Saves to database **Separation of concerns = Better UX!** --- ## πŸ”§ Quick Fix Option ### Change analyze_financials behavior: **Option A: Disable Inline Scraping (Recommended)** ```typescript // analyze_financials.ts if (financialHistory.length === 0) { return { content: "No data. Run 'Auto-scrape financials for {orgNr}' first" }; } ``` **Benefit:** Fast, reliable, clear user guidance **Option B: Keep Inline Scraping (Current)** ```typescript // Tries to auto-scrape if no data // May timeout for multi-year scraping ``` **Downside:** Timeout issues, confusing errors --- ## βœ… Recommended System Behavior ### Tool Split: **Fast Tools (Instant):** - get_company - search_companies - analyze_financials (with cached data) - analyze_growth (with cached data) - fetch_financials (latest year only) **Slow Tools (2-5 min, explicit):** - **auto_scrape_financials** (downloads ALL years) - build_financial_history (guided process) **User Experience:** - Fast tools: Instant feedback - Slow tools: User knows to wait - Clear separation --- ## 🎯 What I Recommend ### Change `analyze_financials` to: **1. Check database** - Has data β†’ Analyze (instant) - No data β†’ Helpful message **Message:** ``` πŸ“Š No financial data in database for this company. πŸ’‘ TO GET DATA: 1. Quick (3s): "Fetch financials for {orgNr}" (latest year only) 2. Complete (2-5min): "Auto-scrape financials for {orgNr}" (ALL years) 3. Manual (20min): "Build financial history for {orgNr}" (guided) Choose based on how much data you need! ``` **This is:** - βœ… Fast (no timeout) - βœ… Clear (user knows options) - βœ… Flexible (user chooses approach) --- ## 🎊 Summary **Timeout Issue:** Tool takes too long (2-5 min exceeds MCP timeout) **Solution:** - Use `auto_scrape_financials` explicitly for multi-year download - Use `analyze_financials` for instant analysis of cached data - Separate fast and slow operations **Result:** Better user experience, no timeouts! **Should I implement this change?** πŸ€”

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/josuekongolo/companyiq-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server