Skip to main content
Glama
6551Team

OpenNews MCP

by 6551Team

get_high_score_news

Retrieve cryptocurrency news articles filtered by AI-generated quality scores to identify high-impact market information for trading decisions.

Instructions

Get highly-rated news articles (by AI score), sorted by score descending.

Args: min_score: Minimum score threshold (default 70). limit: Maximum results to return (default 10, max 100).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
min_scoreNo
limitNo

Implementation Reference

  • Main implementation of get_high_score_news tool. Fetches news articles, filters them by AI score threshold (min_score), sorts by score descending, and returns the top results. Uses @mcp.tool() decorator for registration.
    @mcp.tool()
    async def get_high_score_news(ctx: Context, min_score: int = 70, limit: int = 10) -> dict:
        """Get highly-rated news articles (by AI score), sorted by score descending.
    
        Args:
            min_score: Minimum score threshold (default 70).
            limit: Maximum results to return (default 10, max 100).
        """
        api = ctx.request_context.lifespan_context.api
        limit = clamp_limit(limit)
        try:
            fetch_limit = min(limit * 3, MAX_ROWS)
            result = await api.search_news(limit=fetch_limit, page=1)
            raw = result.get("data", [])
    
            filtered = [it for it in raw
                         if (it.get("aiRating") or {}).get("score", 0) >= min_score]
            filtered.sort(
                key=lambda x: (x.get("aiRating") or {}).get("score", 0),
                reverse=True,
            )
            data = filtered[:limit]
            return make_serializable({
                "success": True, "min_score": min_score,
                "data": data, "count": len(data),
            })
        except Exception as e:
            return {"success": False, "error": str(e) or repr(e)}
  • Tool registration via @mcp.tool() decorator, which registers get_high_score_news as an available MCP tool.
    @mcp.tool()
  • clamp_limit helper function used by get_high_score_news to validate and constrain the user-provided limit parameter to [1, MAX_ROWS].
    def clamp_limit(limit: int) -> int:
        """Clamp user-supplied limit to [1, MAX_ROWS]."""
        return min(max(1, limit), MAX_ROWS)
  • make_serializable helper function used by get_high_score_news to recursively convert non-JSON-serializable types (datetime, Decimal, bytes) into JSON-compatible formats.
    def make_serializable(obj):
        """Recursively convert non-JSON-serializable types."""
        if obj is None:
            return None
        if isinstance(obj, dict):
            return {k: make_serializable(v) for k, v in obj.items()}
        if isinstance(obj, (list, tuple)):
            return [make_serializable(item) for item in obj]
        if isinstance(obj, (datetime, date)):
            return obj.isoformat()
        if isinstance(obj, Decimal):
            return float(obj)
        if isinstance(obj, bytes):
            return obj.decode("utf-8", errors="replace")
        return obj
  • search_news API client method called by get_high_score_news to fetch news articles from the REST API endpoint POST /open/news_search.
    async def search_news(
        self,
        coins: Optional[list[str]] = None,
        query: Optional[str] = None,
        engine_types: Optional[dict[str, list[str]]] = None,
        has_coin: bool = False,
        limit: int = 20,
        page: int = 1,
    ) -> dict:
        """POST /open/news_search — 搜索新闻文章"""
        body: dict[str, Any] = {"limit": limit, "page": page}
        if coins:
            body["coins"] = coins
        if query:
            body["q"] = query
        if engine_types:
            body["engineTypes"] = engine_types
        if has_coin:
            body["hasCoin"] = has_coin
    
        resp = await self._request("POST", f"{self.base_url}/open/news_search", json=body)
        return resp.json()
Behavior3/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 describes the sorting behavior ('sorted by score descending') and output constraints ('maximum results to return'), which are useful. However, it does not cover aspects like rate limits, authentication needs, error handling, or the format of returned articles, leaving gaps for a tool with no annotation support.

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 front-loaded with the core purpose in the first sentence, followed by a structured 'Args:' section that efficiently details parameters without redundancy. Every sentence adds value, and there is no wasted text, 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 has 2 parameters, no annotations, and no output schema, the description does a good job covering parameter semantics and basic behavior. However, it lacks details on return values (e.g., article fields), error cases, or performance considerations, which would be needed for full completeness in this context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 0%, so the description must fully compensate. It provides clear semantics for both parameters: min_score ('Minimum score threshold') with a default value, and limit ('Maximum results to return') with default and max values. This adds essential meaning beyond the bare schema, effectively documenting all parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Get highly-rated news articles'), identifies the resource ('news articles'), and specifies the rating mechanism ('by AI score') and sorting order ('sorted by score descending'). This distinguishes it from siblings like get_latest_news (which likely sorts by time) or search_news (which likely filters by keywords).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for retrieving high-scoring articles, but does not explicitly state when to use this tool versus alternatives like get_latest_news or search_news. It provides default values and limits, which offer some contextual guidance, but lacks explicit comparisons or exclusions for sibling tools.

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/6551Team/opennews-mcp'

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