Skip to main content
Glama

Search Hacker News stories and comments or the front page

hn
Read-only

Hacker News stories or comments from the Algolia search API: keyword search (q) or the current front page (mode=front), optionally since a date. Stories give title, URL, HN link, points, comments, author and time. Comments give their text (400 characters, HTML stripped) and the story title. Up to 50 results. Public data, no key. Related tools on this server, for a different need: hn_search when you need to search Hacker News stories or comments by keyword. Price: $0.002 per successful call, paid with x402 (USDC on Base, Solana and 10 more networks); failed calls are not charged.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "hn"
  }
}

Input Schema

NameRequiredDescriptionDefault
qNoKeywords
modeNofront: the current front page (stories only)
typeNostory (default) or comment
limitNoMax results, 1-50, default 20
sinceNoYYYY-MM-DD: only items from this day on

Output Schema

NameRequiredDescriptionDefault
queryNo
totalNo
sourceNo
resultsNo
returnedNo
checkedAtNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "checkedAt": {},
      +    "query": {},
      +    "results": {},
      +    "returned": {},
      +    "source": {},
      +    "total": {}
      +  },
      +  "type": "object"
      +}
  2. Added

TDQS

A3.9/5.0
Behavior5/5

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

Beyond the readOnlyHint and openWorldHint annotations, the description discloses traits an agent cannot infer elsewhere: a per-call price of $0.002 charged via x402 on specific networks, the rule that failed calls are not charged, that the data is public with no key, the 50-result cap, and that comment text is truncated to 400 characters with HTML stripped. The payment and truncation details are exactly the kind of operational context annotations do not cover.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The definition front-loads the resource and modes, then groups output shape, limits, and pricing into short clauses with no filler. The only wasted content is the hn_search cross-reference, which adds ambiguity rather than value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given an output schema exists, the description need not describe return values, yet it usefully summarizes what stories and comments return. It also covers cost, auth ('no key'), and result caps, which are the things an agent must know before calling. The unresolved overlap with hn_search is the single remaining gap.

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 every parameter (q, mode, type, limit, since) is already documented in the schema, making 3 the baseline. The description restates the q/mode/since semantics and adds the default-type nuance but contributes no syntax or format detail beyond what the schema already gives.

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 names a specific resource and verb ('Hacker News stories or comments from the Algolia search API') and spells out the two modes: keyword search via q, or the current front page via mode=front. This lets an agent distinguish it from generic news tools. It loses a point because the closing routing sentence sends keyword searches to hn_search, which muddles the very capability this tool claims.

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?

It implies when each mode applies ('keyword search (q) or the current front page (mode=front), optionally since a date') and gives useful constraints such as 'Up to 50 results' and 'no key'. However, the guidance 'hn_search when you need to search Hacker News stories or comments by keyword' directly overlaps with this tool's own q parameter, leaving the agent unsure which of the two to call for a keyword query.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources