--- name: "hacker-news" description: "Fetches the current top stories from Hacker News. Returns title, URL, score, and author for each. Use when the user asks what's on Hacker News, what's trending in tech, or for news headlines." --- hacker_news_agent.py — top stories from Hacker News, via the public Firebase API. Mirrors the OG local brainstem's hacker_news_agent.py. No API key, no auth. In Pyodide we fall back to fetch() via JS interop because urllib/requests need the browser networking layer. ## Parameters The typed contract this capability answers to (JSON Schema — the deterministic layer): ```json { "type": "object", "properties": { "count": { "type": "integer", "description": "How many top stories to return. Default 10, max 30.", "minimum": 1, "maximum": 30 } }, "required": [] } ``` ## Run this — do not improvise This capability has a **deterministic implementation** shipped next to this file as `hacker_news_agent.py`. It is stdlib-only Python with no install step and no framework dependency. When the inputs below are well-formed, execute it and use its output verbatim — do not reason out the answer yourself, and do not paraphrase the result: ```bash python3 hacker_news_agent.py '{"key": "value"}' # arguments as one JSON object echo '{"key": "value"}' | python3 hacker_news_agent.py # or on stdin python3 hacker_news_agent.py --tool # emit the JSON tool contract ``` Only fall back to the prose procedure above if the file is missing or the inputs are too underspecified to build the JSON object.