Skip to main content
Glama

get_recent_news

Retrieve recent news articles from the Spanish stock exchange, with optional filtering by specific company to analyze market relationships.

Instructions

Get recent news articles, optionally filtered by company

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
companyIdNoOptional: Company ID to filter by
limitNoMaximum number of articles

Implementation Reference

  • MCP tool handler implementation for the 'get_recent_news' tool. Extracts arguments and delegates execution to the DatabaseManager's getRecentNews method.
    case 'get_recent_news': result = await this.db.getRecentNews((args as any)?.companyId, (args as any)?.limit || 20); break;
  • Input schema defining the parameters for the get_recent_news tool: optional companyId (string) and limit (number, default 20).
    inputSchema: { type: 'object', properties: { companyId: { type: 'string', description: 'Optional: Company ID to filter by', }, limit: { type: 'number', description: 'Maximum number of articles', default: 20, }, }, },
  • src/index.ts:227-244 (registration)
    Registration of the 'get_recent_news' tool in the listTools response, including name, description, and input schema.
    { name: 'get_recent_news', description: 'Get recent news articles, optionally filtered by company', inputSchema: { type: 'object', properties: { companyId: { type: 'string', description: 'Optional: Company ID to filter by', }, limit: { type: 'number', description: 'Maximum number of articles', default: 20, }, }, }, },
  • Helper method in DatabaseManager that implements the core logic: fetches recent news from the API endpoint, optionally filtered by company symbol.
    async getRecentNews(companyId?: string, limit: number = 20): Promise<any[]> { if (companyId) { const companies = await this.getAllCompanies(); const company = companies.find(c => c.id === companyId); if (!company) return []; const data = await this.fetchAPI('/api/news/company', { symbol: company.symbol, limit: limit }); return data.news || []; } else { const data = await this.fetchAPI('/api/news', { limit: limit }); return data.news || []; } }

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