2.5. MCP Tools

Overview

This document describes two MCP (Model Context Protocol) tools designed for intelligent query analysis and research report synthesis. These tools work together to process user queries, break them down into meaningful sub-questions, and generate comprehensive research reports.


Tool 1: Analyze Query Intent[analyze_query_intent]

Description

The Analyze Query Intent tool processes natural language queries to extract structured information. It identifies the language, recognizes relevant company entities, and decomposes the query into three valuable sub-questions for deeper analysis.

Functionality

  • Language Detection: Automatically identifies the language of the input query

  • Entity Recognition: Extracts and identifies company entities with their permanent IDs

  • Query Decomposition: Breaks down the original query into three focused sub-questions, each with:

    • Unique identifier

    • Topic classification

    • Relevant keywords

    • ChatGPT-optimized prompt

    • Search engine query string

Parameters

Request

Parameter Details:

  • query (string, required): The user's natural language question or query

Response

Response Fields:

  • language (string): Detected language code (e.g., "en" for English)

  • entity_id_list (array): List of identified company entities

    • perm_id (string): Permanent identifier for the company

    • name (string): Official company name

  • sub_question_list (array): Three decomposed sub-questions

    • id (string): Unique identifier for the sub-question

    • topic (string): Topic category

    • keywords (string): Comma-separated relevant keywords

    • chatgpt_prompt (string): Optimized prompt for AI analysis

    • search_engine_query (string): Search query string


Tool 2: Synthesize Research Report[synthesize_research_report]

Description

The Synthesize Research Report tool takes the structured output from the Analyze Query Intent tool and generates a comprehensive research report. It analyzes different sources for each sub-question, produces individual reports, and then synthesizes a final consolidated report based on the original query.

Functionality

  • Multi-Question Analysis: Processes each sub-question independently

  • Source Integration: Analyzes multiple data sources and reports

  • Report Synthesis: Combines findings from all sub-questions into a cohesive final report

  • Reference Management: Maintains proper citations and source references

Parameters

Request

Parameter Details:

  • language (string, required): Language code for the report output

  • entity_id_list (array, required): Company entities to research

    • name (string): Company name

    • perm_id (string): Permanent company identifier

  • sub_question_list (array, required): List of sub-questions to analyze (typically 3)

    • id (string): Sub-question identifier

    • topic (string): Topic category

    • keywords (string): Research keywords

    • chatgpt_prompt (string): Analysis prompt

    • search_engine_query (string): Search query

Response

The response is a comprehensive Markdown-formatted research report with the following structure:

Complete Example:


Workflow Integration

These two tools are designed to work in tandem:

  1. Step 1: User submits a query to Analyze Query Intent

  2. Step 2: The tool returns structured data with language, entities, and sub-questions

  3. Step 3: The output from Step 2 is passed as input to Synthesize Research Report

  4. Step 4: A comprehensive research report is generated and returned

Example Workflow


Last updated