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,
        },
      },
    },
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool retrieves news articles but lacks details on permissions, rate limits, data freshness, or response format. For a read operation with zero annotation coverage, this leaves significant behavioral gaps unaddressed.

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 ('Get recent news articles') and adds a clarifying detail ('optionally filtered by company'). There is no wasted verbiage, making it highly concise and well-structured.

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

Completeness3/5

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

Given the tool's moderate complexity (2 parameters, no output schema, no annotations), the description is minimally adequate. It covers the basic purpose but lacks guidance on usage, behavioral traits, and output details. With no output schema, it should ideally hint at return values, but the simplicity of the tool keeps it at a baseline 3.

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 fully documents both parameters. The description adds marginal value by mentioning optional filtering by company, which aligns with the 'companyId' parameter, but doesn't provide additional syntax or format details beyond what the schema already specifies.

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 verb ('Get') and resource ('recent news articles'), and specifies optional filtering by company. It distinguishes from siblings like 'get_news_by_sentiment' by focusing on recency rather than sentiment analysis. However, it doesn't explicitly contrast with all news-related siblings, keeping it at a 4.

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 like 'get_news_by_sentiment' or other news-related tools. It mentions optional filtering but doesn't explain scenarios where filtering is beneficial or when other tools might be more appropriate, leaving the agent with minimal usage context.

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