Skip to main content
Glama

get_news_by_sentiment

Filter news articles by sentiment (positive, negative, or neutral) to analyze market trends and relationships in the Spanish stock exchange.

Instructions

Get news articles filtered by sentiment

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sentimentYesNews sentiment
limitNoMaximum number of articles

Implementation Reference

  • src/index.ts:245-264 (registration)
    Tool registration in the list of tools returned by ListToolsRequestSchema, including name, description, and input schema.
    {
      name: 'get_news_by_sentiment',
      description: 'Get news articles filtered by sentiment',
      inputSchema: {
        type: 'object',
        properties: {
          sentiment: {
            type: 'string',
            enum: ['positive', 'negative', 'neutral'],
            description: 'News sentiment',
          },
          limit: {
            type: 'number',
            description: 'Maximum number of articles',
            default: 20,
          },
        },
        required: ['sentiment'],
      },
    },
  • Tool execution handler in the CallToolRequestSchema switch statement that delegates to the DatabaseManager's getNewsBySentiment method with parsed input arguments.
    case 'get_news_by_sentiment':
      result = await this.db.getNewsBySentiment((args as any)?.sentiment, (args as any)?.limit || 20);
      break;
  • Helper method in DatabaseManager that fetches news articles filtered by sentiment from the backend API endpoint '/api/news/sentiment'.
    async getNewsBySentiment(sentiment: string, limit: number = 20): Promise<any[]> {
      const data = await this.fetchAPI('/api/news/sentiment', {
        sentiment: sentiment,
        limit: limit
      });
      return data.news || [];
    }
Behavior2/5

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

With no annotations, the description carries full burden but provides minimal behavioral context. It mentions filtering but doesn't disclose source limitations, rate limits, authentication needs, pagination behavior, or what 'Get' entails (e.g., returns metadata vs. full articles). For a tool with no annotations, this is inadequate.

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 with zero waste. It's front-loaded with the core purpose and appropriately sized for a simple filtering tool.

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 no annotations, no output schema, and a simple tool with 2 parameters, the description is incomplete. It lacks behavioral details (e.g., what 'Get' returns, limitations), usage context, and doesn't compensate for the absence of structured fields. It's minimally viable but leaves significant gaps.

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 no additional meaning beyond implying sentiment filtering, which is already clear from the parameter names and schema. Baseline 3 is appropriate as the schema does the heavy lifting.

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 with a specific verb ('Get') and resource ('news articles'), plus the filtering criterion ('by sentiment'). It distinguishes from siblings like 'get_recent_news' by specifying sentiment-based filtering. However, it doesn't explicitly differentiate from all potential news-related tools beyond the provided list.

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?

No guidance is provided on when to use this tool versus alternatives. While 'get_recent_news' is a sibling, the description doesn't mention it or explain when sentiment filtering is preferable. There's no context about prerequisites, timing, or exclusions.

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