Skip to main content
Glama
flyanima

Open Search MCP

by flyanima

market_intelligence_aggregator

Aggregate market intelligence from financial, news, and social sources to analyze topics like companies, industries, or cryptocurrency.

Instructions

Aggregate market intelligence from financial, news, and social sources

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topicYesMarket topic or company to analyze (e.g., "Apple", "AI market", "cryptocurrency")
includeStockNoInclude stock/financial data
includeNewsNoInclude news analysis
includeSocialNoInclude social media sentiment
includeCryptoNoInclude cryptocurrency data if relevant

Implementation Reference

  • Main handler function that performs parallel tool executions for financial (alpha_vantage_symbol_search), news (newsapi_search), social (reddit_post_search), and optional crypto (coingecko_coin_search) data aggregation, processes results into structured intelligence report with summary.
    execute: async (args: any) => {
      try {
        const startTime = Date.now();
        const intelligence: any = {
          topic: args.topic,
          timestamp: new Date().toISOString(),
          financial_data: null,
          news_analysis: null,
          social_sentiment: null,
          crypto_data: null,
          summary: {},
          metadata: {}
        };
    
        const promises = [];
    
        // 金融数据
        if (args.includeStock) {
          const stockTool = registry.getTool('alpha_vantage_symbol_search');
          if (stockTool) {
            promises.push(
              stockTool.execute({ keywords: args.topic })
                .then(result => ({ type: 'financial', data: result }))
                .catch(error => ({ type: 'financial', error: error.message }))
            );
          }
        }
    
        // 新闻分析
        if (args.includeNews) {
          const newsTool = registry.getTool('newsapi_search');
          if (newsTool) {
            promises.push(
              newsTool.execute({ query: args.topic, maxResults: 10 })
                .then(result => ({ type: 'news', data: result }))
                .catch(error => ({ type: 'news', error: error.message }))
            );
          }
        }
    
        // 社交媒体情感
        if (args.includeSocial) {
          const socialTool = registry.getTool('reddit_post_search');
          if (socialTool) {
            promises.push(
              socialTool.execute({ query: args.topic, maxResults: 10 })
                .then(result => ({ type: 'social', data: result }))
                .catch(error => ({ type: 'social', error: error.message }))
            );
          }
        }
    
        // 加密货币数据
        if (args.includeCrypto) {
          const cryptoTool = registry.getTool('coingecko_coin_search');
          if (cryptoTool) {
            promises.push(
              cryptoTool.execute({ query: args.topic })
                .then(result => ({ type: 'crypto', data: result }))
                .catch(error => ({ type: 'crypto', error: error.message }))
            );
          }
        }
    
        // 等待所有数据收集完成
        const results = await Promise.all(promises);
    
        // 处理结果
        for (const result of results) {
          if ('error' in result) {
            intelligence[`${result.type}_data`] = { error: result.error };
            continue;
          }
    
          if (result.data.success) {
            intelligence[`${result.type}_data`] = result.data.data;
          } else {
            intelligence[`${result.type}_data`] = { error: result.data.error };
          }
        }
    
        // 生成摘要
        intelligence.summary = {
          topic: intelligence.topic,
          data_availability: {
            financial: !!intelligence.financial_data && !intelligence.financial_data.error,
            news: !!intelligence.news_data && !intelligence.news_data.error,
            social: !!intelligence.social_data && !intelligence.social_data.error,
            crypto: !!intelligence.crypto_data && !intelligence.crypto_data.error
          },
          key_insights: ['Market intelligence aggregated from multiple sources']
        };
        intelligence.metadata = {
          analysis_time: Date.now() - startTime,
          data_sources: results.filter(r => !('error' in r)).length,
          timestamp: Date.now()
        };
    
        return {
          success: true,
          data: intelligence
        };
    
      } catch (error) {
        return {
          success: false,
          error: error instanceof Error ? error.message : 'Market intelligence aggregation failed'
        };
      }
    }
  • JSON schema defining input parameters: topic (required), includeStock, includeNews, includeSocial, includeCrypto.
    inputSchema: {
      type: 'object',
      properties: {
        topic: {
          type: 'string',
          description: 'Market topic or company to analyze (e.g., "Apple", "AI market", "cryptocurrency")'
        },
        includeStock: {
          type: 'boolean',
          description: 'Include stock/financial data',
          default: true
        },
        includeNews: {
          type: 'boolean',
          description: 'Include news analysis',
          default: true
        },
        includeSocial: {
          type: 'boolean',
          description: 'Include social media sentiment',
          default: true
        },
        includeCrypto: {
          type: 'boolean',
          description: 'Include cryptocurrency data if relevant',
          default: false
        }
      },
      required: ['topic']
    },
  • Registration of the tool via registry.registerTool, including name, description, category, source, inputSchema, and execute handler.
    registry.registerTool({
      name: 'market_intelligence_aggregator',
      description: 'Aggregate market intelligence from financial, news, and social sources',
      category: 'aggregation',
      source: 'multiple',
      inputSchema: {
        type: 'object',
        properties: {
          topic: {
            type: 'string',
            description: 'Market topic or company to analyze (e.g., "Apple", "AI market", "cryptocurrency")'
          },
          includeStock: {
            type: 'boolean',
            description: 'Include stock/financial data',
            default: true
          },
          includeNews: {
            type: 'boolean',
            description: 'Include news analysis',
            default: true
          },
          includeSocial: {
            type: 'boolean',
            description: 'Include social media sentiment',
            default: true
          },
          includeCrypto: {
            type: 'boolean',
            description: 'Include cryptocurrency data if relevant',
            default: false
          }
        },
        required: ['topic']
      },
      execute: async (args: any) => {
        try {
          const startTime = Date.now();
          const intelligence: any = {
            topic: args.topic,
            timestamp: new Date().toISOString(),
            financial_data: null,
            news_analysis: null,
            social_sentiment: null,
            crypto_data: null,
            summary: {},
            metadata: {}
          };
    
          const promises = [];
    
          // 金融数据
          if (args.includeStock) {
            const stockTool = registry.getTool('alpha_vantage_symbol_search');
            if (stockTool) {
              promises.push(
                stockTool.execute({ keywords: args.topic })
                  .then(result => ({ type: 'financial', data: result }))
                  .catch(error => ({ type: 'financial', error: error.message }))
              );
            }
          }
    
          // 新闻分析
          if (args.includeNews) {
            const newsTool = registry.getTool('newsapi_search');
            if (newsTool) {
              promises.push(
                newsTool.execute({ query: args.topic, maxResults: 10 })
                  .then(result => ({ type: 'news', data: result }))
                  .catch(error => ({ type: 'news', error: error.message }))
              );
            }
          }
    
          // 社交媒体情感
          if (args.includeSocial) {
            const socialTool = registry.getTool('reddit_post_search');
            if (socialTool) {
              promises.push(
                socialTool.execute({ query: args.topic, maxResults: 10 })
                  .then(result => ({ type: 'social', data: result }))
                  .catch(error => ({ type: 'social', error: error.message }))
              );
            }
          }
    
          // 加密货币数据
          if (args.includeCrypto) {
            const cryptoTool = registry.getTool('coingecko_coin_search');
            if (cryptoTool) {
              promises.push(
                cryptoTool.execute({ query: args.topic })
                  .then(result => ({ type: 'crypto', data: result }))
                  .catch(error => ({ type: 'crypto', error: error.message }))
              );
            }
          }
    
          // 等待所有数据收集完成
          const results = await Promise.all(promises);
    
          // 处理结果
          for (const result of results) {
            if ('error' in result) {
              intelligence[`${result.type}_data`] = { error: result.error };
              continue;
            }
    
            if (result.data.success) {
              intelligence[`${result.type}_data`] = result.data.data;
            } else {
              intelligence[`${result.type}_data`] = { error: result.data.error };
            }
          }
    
          // 生成摘要
          intelligence.summary = {
            topic: intelligence.topic,
            data_availability: {
              financial: !!intelligence.financial_data && !intelligence.financial_data.error,
              news: !!intelligence.news_data && !intelligence.news_data.error,
              social: !!intelligence.social_data && !intelligence.social_data.error,
              crypto: !!intelligence.crypto_data && !intelligence.crypto_data.error
            },
            key_insights: ['Market intelligence aggregated from multiple sources']
          };
          intelligence.metadata = {
            analysis_time: Date.now() - startTime,
            data_sources: results.filter(r => !('error' in r)).length,
            timestamp: Date.now()
          };
    
          return {
            success: true,
            data: intelligence
          };
    
        } catch (error) {
          return {
            success: false,
            error: error instanceof Error ? error.message : 'Market intelligence aggregation failed'
          };
        }
      }
    });
  • src/index.ts:254-254 (registration)
    Invocation of registerSmartSearchTools(this.toolRegistry) which registers market_intelligence_aggregator and intelligent_research.
    registerSmartSearchTools(this.toolRegistry);        // 2 tools: intelligent_research, market_intelligence_aggregator
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states what the tool does but doesn't describe how it behaves: no information on rate limits, authentication needs, data freshness, output format, or potential side effects. For a tool aggregating multiple data sources, this is a significant gap.

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?

The description is a single, efficient sentence that front-loads the core purpose without unnecessary words. Every part of the sentence contributes to understanding the tool's scope, making it appropriately concise and well-structured.

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

Completeness2/5

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

Given the tool's complexity (aggregating multiple data sources), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what the aggregated output looks like, how data is combined, or any behavioral traits. For a tool with 5 parameters and no structured safety hints, more context is needed.

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?

The description mentions 'financial, news, and social sources,' which loosely maps to parameters like 'includeStock,' 'includeNews,' and 'includeSocial.' However, with 100% schema description coverage, the schema already documents all 5 parameters thoroughly. The description adds minimal value beyond what's in the schema, meeting the baseline for high coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Aggregate market intelligence from financial, news, and social sources.' It specifies the verb ('aggregate') and resource types ('market intelligence'), though it doesn't explicitly differentiate from sibling tools like 'deep_research' or 'intelligent_research' that might have overlapping domains.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention any prerequisites, exclusions, or compare it to sibling tools such as 'search_brave' or 'searx_news_search' that might handle similar data sources. Usage context is implied but not explicit.

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

Install Server

Other Tools

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/flyanima/open-search-mcp'

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