Skip to main content
Glama

search_news

Search recent news articles using Lightning Network or Arbitrum ETH micropayments. Pay per query for current information without API keys or subscriptions.

Instructions

Search recent news. Pay with Lightning (payment_hash) or Arbitrum ETH (tx_hash).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
payment_hashNo
tx_hashNo
max_resultsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the search_news tool. Validates payment (either Lightning payment_hash or Arbitrum tx_hash) and returns news results by calling do_news().
    def search_news(query: str, payment_hash: str = "", tx_hash: str = "", max_results: int = 5) -> str:
        """Search recent news. Pay with Lightning (payment_hash) or Arbitrum ETH (tx_hash)."""
        if payment_hash:
            if not check_invoice(payment_hash):
                return "Lightning payment not settled. Call get_invoice first."
        elif tx_hash:
            ok, pid = arb_pay.verify_tx(tx_hash, "search")
            if not ok:
                return "Arbitrum payment not found or already used. Call get_arbitrum_invoice first."
            arb_pay.mark_used(pid)
        else:
            return "Provide payment_hash (Lightning) or tx_hash (Arbitrum)."
        return do_news(query, max_results)
  • Helper function that performs the actual DuckDuckGo news search using the DDGS library. Returns formatted news results with title, URL, and body.
    def do_news(query: str, max_results: int = 5) -> str:
        with DDGS() as ddgs:
            results = list(ddgs.news(query, max_results=max_results))
        if not results:
            return "No news found."
        return "\n---\n".join(f"**{r['title']}**\n{r['url']}\n{r['body']}" for r in results)
  • server.py:126-127 (registration)
    The @mcp.tool() decorator registers the search_news function as an MCP tool with the FastMCP server.
    @mcp.tool()
    def search_news(query: str, payment_hash: str = "", tx_hash: str = "", max_results: int = 5) -> str:
  • Input schema for search_news tool defined via function signature type hints. Parameters: query (str), payment_hash (str, optional), tx_hash (str, optional), max_results (int, optional, default=5). Returns string.
    def search_news(query: str, payment_hash: str = "", tx_hash: str = "", max_results: int = 5) -> str:
        """Search recent news. Pay with Lightning (payment_hash) or Arbitrum ETH (tx_hash)."""
Behavior3/5

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

No annotations provided, so description carries full burden. Discloses the unique payment requirement (Lightning/Arbitrum) which is critical behavioral context. However, lacks details on rate limits, what 'recent' means temporally, error conditions for invalid payments, or whether the operation is idempotent.

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?

Extremely compact two-sentence structure with zero waste. Front-loaded with core purpose, immediately followed by critical payment context. Every word earns its place.

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?

Has output schema (per context signals) so return values need not be explained. However, with 4 parameters and 0% schema coverage, the description inadequately covers the search parameters ('query', 'max_results') and leaves ambiguity about payment optionality despite being a 4-parameter tool.

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 has 0% description coverage, requiring heavy lifting from description. Successfully explains 'payment_hash' (Lightning) and 'tx_hash' (Arbitrum ETH) semantics, but completely omits 'query' (expected format/keywords) and 'max_results' (range/limitations), leaving significant gaps.

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?

States specific verb ('Search') and resource ('recent news'), but fails to distinguish from sibling 'search_web' which may overlap in functionality. The payment method mention adds unique context but doesn't clarify scope differentiation.

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 on when to use this versus 'search_web' or other siblings. Does not clarify whether payment is mandatory (implied by 'Pay with') or optional (suggested by empty string defaults in schema), nor when to use Lightning versus Arbitrum ETH.

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/giskard09/giskard-search'

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