Skip to main content
Glama

get_recent_news

Retrieve recent news articles about Spanish stock exchange companies, 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

  • Core handler function that implements the get_recent_news tool logic by fetching recent news from the API, optionally filtered by company ID.
    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 || []; } }
  • MCP tool dispatcher handler for 'get_recent_news' that extracts parameters and calls the database method.
    case 'get_recent_news': result = await this.db.getRecentNews((args as any)?.companyId, (args as any)?.limit || 20); break;
  • src/index.ts:227-244 (registration)
    Tool registration in the ListToolsRequestSchema handler, including name, description, and input schema definition.
    { 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, }, }, }, },
  • Input schema definition for the get_recent_news tool parameters.
    inputSchema: { type: 'object', properties: { companyId: { type: 'string', description: 'Optional: Company ID to filter by', }, limit: { type: 'number', description: 'Maximum number of articles', default: 20, }, }, },

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