Skip to main content
Glama

generate_analyst_report

Generate comprehensive analyst reports for Spanish stock exchange companies, sectors, or market themes with data visualizations and multiple analysis types.

Instructions

Generate a comprehensive analyst report for a company, sector, or market theme

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
subjectYesCompany symbol, sector name, or theme to analyze
report_typeYesType of report to generate
include_chartsNoWhether to include data visualizations (text-based)

Implementation Reference

  • The main handler function that executes the generate_analyst_report tool logic. It generates comprehensive reports based on the subject (company/sector) and report_type, fetching data from DB and other analytics methods.
    async generateAnalystReport(subject: string, reportType: string, includeCharts: boolean = true): Promise<any> {
      try {
        const report = {
          subject: subject,
          report_type: reportType,
          generated_date: new Date().toISOString(),
          executive_summary: '',
          sections: {},
          charts: includeCharts ? [] : null,
          conclusions: [],
          recommendations: []
        };
    
        switch (reportType) {
          case 'company_deep_dive':
            const company = await this.db.getCompanyBySymbol(subject);
            if (!company) throw new Error(`Company ${subject} not found`);
    
            report.sections = {
              company_overview: company,
              financial_metrics: {
                market_cap: company.market_cap,
                pe_ratio: company.price_to_earnings || company.pe_ratio,
                sector: company.sector
              },
              governance_analysis: await this.getCompanyGovernanceAnalysis(company),
              market_position: await this.getCompanyMarketPosition(company),
              risk_assessment: await this.assessInvestmentRisk(subject),
              recent_developments: await this.db.getRecentNews(company.id, 10)
            };
            
            report.executive_summary = this.generateCompanyExecutiveSummary(report.sections);
            break;
    
          case 'sector_overview':
            const sectorCompanies = await this.db.getCompaniesBySector(subject);
            const sectorAnalysis = await this.getSectorCorrelationAnalysis(30);
    
            report.sections = {
              sector_overview: {
                sector_name: subject,
                company_count: sectorCompanies.length,
                total_market_cap: sectorCompanies.reduce((sum, c) => sum + (c.market_cap || 0), 0)
              },
              performance_analysis: sectorAnalysis,
              key_players: sectorCompanies.slice(0, 10),
              market_trends: await this.analyzeTrends('sector_trend', subject, 30),
              competitive_landscape: await this.analyzeSectorCompetition(sectorCompanies)
            };
            break;
    
          // Add other report types as needed
          default:
            throw new Error(`Unknown report type: ${reportType}`);
        }
    
        report.conclusions = this.generateReportConclusions(report);
        report.recommendations = this.generateReportRecommendations(report);
    
        return report;
      } catch (error) {
        throw new Error(`Report generation failed: ${error}`);
      }
    }
  • src/index.ts:458-480 (registration)
    Registers the 'generate_analyst_report' tool in the MCP server's listTools handler, including name, description, and input schema.
      name: 'generate_analyst_report',
      description: 'Generate a comprehensive analyst report for a company, sector, or market theme',
      inputSchema: {
        type: 'object',
        properties: {
          subject: {
            type: 'string',
            description: 'Company symbol, sector name, or theme to analyze',
          },
          report_type: {
            type: 'string',
            enum: ['company_deep_dive', 'sector_overview', 'governance_analysis', 'market_opportunity', 'risk_assessment'],
            description: 'Type of report to generate',
          },
          include_charts: {
            type: 'boolean',
            description: 'Whether to include data visualizations (text-based)',
            default: true,
          },
        },
        required: ['subject', 'report_type'],
      },
    },
  • The dispatch handler in the main CallToolRequestSchema that validates input via args and delegates to the analytics handler.
    case 'generate_analyst_report':
      result = await this.analytics.generateAnalystReport(
        (args as any)?.subject,
        (args as any)?.report_type,
        (args as any)?.include_charts !== false
      );
      break;
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 mentions generating a 'comprehensive' report but lacks details on execution time, data sources, permissions required, rate limits, or output format (e.g., text, PDF). For a tool that likely involves complex data processing, this is a significant gap, leaving the agent with minimal behavioral context.

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 details. Every word earns its place, making it easy for an agent to parse quickly. There is no redundancy or wasted verbiage.

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 complexity of generating analyst reports, lack of annotations, and no output schema, the description is incomplete. It doesn't address behavioral aspects like data sources, processing time, or output format, which are critical for an agent to use the tool effectively. The high schema coverage doesn't compensate for these missing contextual elements.

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 100%, so the schema already documents all parameters (subject, report_type, include_charts). The description adds no additional meaning beyond implying the scope ('company, sector, or market theme'), which is covered by the schema's subject description. Thus, it meets the baseline for high schema coverage without compensating with extra insights.

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: 'Generate a comprehensive analyst report for a company, sector, or market theme.' It specifies the verb ('generate') and resource ('analyst report'), and distinguishes it from siblings like 'get_weekly_reports' (which likely retrieves existing reports) or 'analyze_trends' (which may not produce formal reports). However, it doesn't explicitly differentiate from all siblings, such as 'assess_investment_risk' (which might produce similar outputs), keeping it from a perfect score.

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 prerequisites, context for selection among report types, or comparisons to siblings like 'assess_investment_risk' or 'get_sector_correlation_analysis'. The agent must infer usage from the description alone, which is insufficient for optimal tool selection.

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/anbrme/ibex35-mcp-server'

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