Prerequisites
The following example requires theanthropic library.
Example
The following agent will write a report on trending startups and products from Hacker News.cookbook/91_tools/hackernews_tools.py
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Fetch top Hacker News stories and user details with HackerNewsTools’ get_top_hackernews_stories and get_user_details functions.
anthropic library.
uv pip install -U anthropic
from agno.agent import Agent
from agno.models.anthropic import Claude
from agno.tools.hackernews import HackerNewsTools
agent = Agent(
model=Claude(id="claude-sonnet-4-5"),
tools=[HackerNewsTools()],
markdown=True,
)
agent.print_response(
"Write a report on trending startups and products.", stream=True
)
| Parameter | Type | Default | Description |
|---|---|---|---|
enable_get_top_stories | bool | True | Enables fetching top stories. |
enable_get_user_details | bool | True | Enables fetching user details. |
all | bool | False | Enables all functionality. |
timeout | int | 30 | Per-request HTTP timeout in seconds. |
| Function | Description |
|---|---|
get_top_hackernews_stories | Retrieves the top stories from Hacker News. Parameters include num_stories to specify the number of stories to return (default is 10). Returns the top stories in JSON format. |
get_user_details | Retrieves the details of a Hacker News user by their username. Parameters include username to specify the user. Returns the user details in JSON format. |
Was this page helpful?