Skip to main content
Glama
ccozad

hackernews-mcp

by ccozad

search_hackernews

Search Hacker News stories and comments by query, filter by story type, recency, and sort order to find relevant discussions.

Instructions

Search Hacker News stories and comments via HN's Algolia API.

Use this to find HN discussion on a topic, surface Ask HN / Show HN posts, or pull the most recent items in a time window. Returns a JSON object with a hits array.

Parameters:

  • query (str, required): the search phrase, e.g. "rust async runtime".

  • tag (str): which item kind to search. One of "story" (default), "comment", "ask_hn", "show_hn", or "all".

  • time_range (str): restrict by recency. One of "past_24h", "past_week", "past_month", or "all_time" (default).

  • sort (str): "relevance" (default) ranks by Algolia relevance; "date" returns newest first.

  • limit (int): number of hits to return, 1-50 (default 10).

Each hit has: id, title, url, points, author, num_comments, created_at (ISO8601), and excerpt (a highlighted snippet when Algolia provides one). For comment hits, title/url/points are usually null and the matched text appears in excerpt. An empty search returns {"hits": []} rather than an error.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesThe search phrase.
tagNoWhich item kind to search.story
time_rangeNoRestrict results by recency.all_time
sortNoRanking: relevance or newest-first.relevance
limitNoNumber of hits to return (1-50).
Behavior5/5

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

No annotations are present, so the description fully shoulders the behavioral disclosure. It details the return type ('JSON object with a hits array'), describes each hit's fields (id, title, url, points, author, num_comments, created_at, excerpt), and explains special cases such as comment hits where title/url/points are null and excerpt contains matched text. It also notes that an empty search returns {'hits': []} rather than an error. This comprehensive disclosure compensates well for the absent annotations.

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 concise and well-structured: a two-sentence intro, bullet points for parameters, and a final paragraph about response shape and edge cases. Every sentence contributes meaningful information; there is no redundancy or fluff. The structure is easy to parse for an AI agent.

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 the tool's complexity (5 parameters, no output schema), the description covers all necessary aspects: parameter details, return format, and edge-case behavior (empty search). Minor omission: it does not mention pagination or whether multiple pages can be retrieved. The limit parameter suggests a single page, but explicit clarification would improve completeness.

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

Parameters4/5

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

The input schema has 100% description coverage, so the baseline is 3. The description adds value beyond the schema by providing a concrete example for 'query' (e.g., 'rust async runtime'), reiterating enums with defaults, and clarifying the limit range. While some content mirrors the schema, the examples and additional phrasing enhance understanding for an AI agent.

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 begins with a clear verb+resource: 'Search Hacker News stories and comments via HN's Algolia API.' It further elaborates use cases like 'find HN discussion on a topic, surface Ask HN / Show HN posts, or pull the most recent items,' making the purpose unmistakable. No siblings exist to differentiate, but the description is fully specific.

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

Usage Guidelines4/5

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

The description provides explicit context on when to use the tool (e.g., 'find HN discussion on a topic, surface Ask HN / Show HN posts, or pull the most recent items'). It does not include exclusions or alternatives because no sibling tools exist, but the use cases are clearly stated. Slight room for improvement: could mention that this is read-only and does not mutating Hacker News.

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/ccozad/hackernews-mcp'

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