Skip to main content
Glama

Hn Get Stories

hn_get_stories
Read-only

Fetch stories from an HN feed (top, new, best, ask, show, jobs), with title, URL, score, author, and comment count for each story.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "feed": "<feed>"
    },
    "name": "hn_get_stories"
  }
}

Input Schema

NameRequiredDescriptionDefault
feedYesWhich HN feed to fetch. "top" includes jobs. "ask" and "show" are Ask HN / Show HN posts.
countNoNumber of stories to return, at most 100 per call. A larger value is served at 100, and the notice names the offset for the next page. Larger counts take longer.
offsetNoNumber of stories to skip from the start of the feed. Use with count for pagination.

Output Schema

NameRequiredDescriptionDefault
capNoThe count value served: as passed, or 100 when count was above that cap.
feedNoWhich feed was fetched.
errorNoPresent when the call failed. Absent on success.
shownNoNumber of stories returned on this page.
totalNoTotal items in the feed (up to 500 for top/new/best, 200 for ask/show/jobs).
noticeNoAgent guidance: the offset to pass for the next page while more stories remain; how many items on this page were omitted, by kind (deleted, dead, missing); the IDs that failed to load and how to retry them (naming the call's 50-second time budget when it cut them); why a page came back empty (an empty feed, or offset past its end); and when count was served at its per-call cap. Absent on the last page of a non-empty result when nothing on it was omitted or failed.
offsetNoOffset that was applied to this page.
hasMoreNoWhether more stories are available beyond this page.
storiesNoStories from the feed, ordered by HN ranking.
failedIdsNoIDs on this page whose fetch failed after retries or ran past the call's 50-second time budget. They are not deleted or missing and may load on a later call: retry the page with the same offset, or pass an ID to hn_get_thread to fetch that story alone. Absent when every item on the page loaded.
truncatedNoTrue when more stories remain beyond this page (hasMore). Absent on the last page of the feed.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedOutput schema / properties / notice / description
      Previous value: -"Agent guidance: the offset to pass for the next page while more stories remain, the IDs that failed to load and how to retry them (naming the call's 50-second time budget when it cut them), or why a page came back empty — offset past the end of the feed, an empty feed, or every item on the page deleted or flagged — noting when count was served at its per-call cap. Absent on the last page of a non-empty result with no failed IDs."New value: +"Agent guidance: the offset to pass for the next page while more stories remain; how many items on this page were omitted, by kind (deleted, dead, missing); the IDs that failed to load and how to retry them (naming the call's 50-second time budget when it cut them); why a page came back empty (an empty feed, or offset past its end); and when count was served at its per-call cap. Absent on the last page of a non-empty result when nothing on it was omitted or failed."
    • addedOutput schema / properties / stories / items / properties / rank
      Added value: +{
      +  "description": "1-based position in the feed's ranking when fetched: offset plus the story's slot on this page, counted before omitted or failed items drop out. A gap between consecutive ranks marks an item omitted as deleted, dead, or missing, or one in failedIds.",
      +  "type": "number"
      +}
    • changedOutput schema / properties / stories / items / required
      Previous value: -[
      -  "id",
      -  "type"
      -]New value: +[
      +  "rank",
      +  "id",
      +  "type"
      +]
  2. Changed2 schema fields changed
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `upstream_rejected`: The HN API answered with a 4xx status other than 429 — it rejected the request as built. `upstream_rate_limited`: The HN API answered with HTTP 429. `upstream_unavailable`: The HN API answered with a 5xx status. `upstream_html`: The HN API served an HTML error page with a 200 status, which it does under rate limiting or maintenance. `upstream_malformed`: The HN API answered with a 200 status and a body that is not JSON. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `upstream_rejected`: The HN API answered with a 4xx status other than 429 — it rejected the request as built. `upstream_rate_limited`: The HN API answered with HTTP 429. `upstream_unavailable`: The HN API answered with a 5xx status. `upstream_html`: The HN API served an HTML error page with a 200 status, which it does under rate limiting or maintenance. `upstream_malformed`: The HN API answered with a 200 status and a body that is not JSON. `upstream_no_response`: Every item on the page failed, none with HTTP 429, and no answer from the HN API was the most common failure — timed out after retries, could not connect, or ran past this call's 50-second time budget. `retry_deadline_exceeded`: The HN API was too slow to return the feed: its retries ran past this call's 50-second time budget. Other values are possible when a failure originates below the handler."
    • changedOutput schema / properties / error / properties / data / properties / reason / examples
      Previous value: -[
      -  "upstream_rejected",
      -  "upstream_rate_limited",
      -  "upstream_unavailable",
      -  "upstream_html",
      -  "upstream_malformed"
      -]New value: +[
      +  "upstream_rejected",
      +  "upstream_rate_limited",
      +  "upstream_unavailable",
      +  "upstream_html",
      +  "upstream_malformed",
      +  "upstream_no_response",
      +  "retry_deadline_exceeded"
      +]
  3. Changed2 schema fields changed
    • changedOutput schema / properties / failedIds / description
      Previous value: -"IDs on this page whose fetch failed after retries. They are not deleted or missing and may load on a later call: retry the page with the same offset, or pass an ID to hn_get_thread to fetch that story alone. Absent when every item on the page loaded."New value: +"IDs on this page whose fetch failed after retries or ran past the call's 50-second time budget. They are not deleted or missing and may load on a later call: retry the page with the same offset, or pass an ID to hn_get_thread to fetch that story alone. Absent when every item on the page loaded."
    • changedOutput schema / properties / notice / description
      Previous value: -"Agent guidance: the offset to pass for the next page while more stories remain, the IDs that failed to load and how to retry them, or why a page came back empty — offset past the end of the feed, an empty feed, or every item on the page deleted or flagged — noting when count was served at its per-call cap. Absent on the last page of a non-empty result with no failed IDs."New value: +"Agent guidance: the offset to pass for the next page while more stories remain, the IDs that failed to load and how to retry them (naming the call's 50-second time budget when it cut them), or why a page came back empty — offset past the end of the feed, an empty feed, or every item on the page deleted or flagged — noting when count was served at its per-call cap. Absent on the last page of a non-empty result with no failed IDs."
  4. Changed5 schema fields changed
    • changedInput schema / properties / count / description
      Previous value: -"Number of stories to return. Larger counts take longer."New value: +"Number of stories to return, at most 100 per call. A larger value is served at 100, and the notice names the offset for the next page. Larger counts take longer."
    • changedInput schema / properties / count / maximum
      Previous value: -100New value: +1000
    • changedOutput schema / properties / cap / description
      Previous value: -"The count cap that was applied."New value: +"The count value served: as passed, or 100 when count was above that cap."
    • changedOutput schema / properties / notice / description
      Previous value: -"Agent guidance: the offset to pass for the next page while more stories remain, the IDs that failed to load and how to retry them, or why a page came back empty — offset past the end of the feed, an empty feed, or every item on the page deleted or flagged. Absent on the last page of a non-empty result with no failed IDs."New value: +"Agent guidance: the offset to pass for the next page while more stories remain, the IDs that failed to load and how to retry them, or why a page came back empty — offset past the end of the feed, an empty feed, or every item on the page deleted or flagged — noting when count was served at its per-call cap. Absent on the last page of a non-empty result with no failed IDs."
    • changedOutput schema / properties / stories / items / properties / descendants / description
      Previous value: -"Total comment count. Absent for jobs."New value: +"HN's count of live comments in the thread (descendants); dead and deleted comments are not counted. Absent for jobs."
  5. Changed2 schema fields changed
    • addedOutput schema / properties / failedIds
      Added value: +{
      +  "description": "IDs on this page whose fetch failed after retries. They are not deleted or missing and may load on a later call: retry the page with the same offset, or pass an ID to hn_get_thread to fetch that story alone. Absent when every item on the page loaded.",
      +  "items": {
      +    "type": "number"
      +  },
      +  "type": "array"
      +}
    • changedOutput schema / properties / notice / description
      Previous value: -"Agent guidance: the offset to pass for the next page while more stories remain, or why a page came back empty — offset past the end of the feed, an empty feed, or every item on the page deleted or flagged. Absent on the last page of a non-empty result."New value: +"Agent guidance: the offset to pass for the next page while more stories remain, the IDs that failed to load and how to retry them, or why a page came back empty — offset past the end of the feed, an empty feed, or every item on the page deleted or flagged. Absent on the last page of a non-empty result with no failed IDs."
  6. Changed2 schema fields changed
    • changedOutput schema / properties / notice / description
      Previous value: -"Recovery hint when a page is empty — e.g. offset past end of feed or feed has no items. Absent on non-empty result pages."New value: +"Agent guidance: the offset to pass for the next page while more stories remain, or why a page came back empty — offset past the end of the feed, an empty feed, or every item on the page deleted or flagged. Absent on the last page of a non-empty result."
    • changedOutput schema / properties / truncated / description
      Previous value: -"True when the feed was capped by the count parameter."New value: +"True when more stories remain beyond this page (hasMore). Absent on the last page of the feed."
  7. Changed6 schema fields changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedInput schema / additionalProperties
      Added value: +false
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedOutput schema / anyOf
      Added value: +[
      +  {
      +    "not": {
      +      "required": [
      +        "error"
      +      ]
      +    },
      +    "required": [
      +      "stories",
      +      "feed",
      +      "total",
      +      "offset",
      +      "hasMore"
      +    ]
      +  },
      +  {
      +    "required": [
      +      "error"
      +    ]
      +  }
      +]
    • addedOutput schema / properties / error
      Added value: +{
      +  "additionalProperties": {},
      +  "description": "Present when the call failed. Absent on success.",
      +  "properties": {
      +    "code": {
      +      "description": "JSON-RPC error code for this failure.",
      +      "maximum": 9007199254740991,
      +      "minimum": -9007199254740991,
      +      "type": "integer"
      +    },
      +    "data": {
      +      "additionalProperties": {},
      +      "properties": {
      +        "reason": {
      +          "description": "Machine-readable failure mode. Declared by this tool: `upstream_rejected`: The HN API answered with a 4xx status other than 429 — it rejected the request as built. `upstream_rate_limited`: The HN API answered with HTTP 429. `upstream_unavailable`: The HN API answered with a 5xx status. `upstream_html`: The HN API served an HTML error page with a 200 status, which it does under rate limiting or maintenance. `upstream_malformed`: The HN API answered with a 200 status and a body that is not JSON. Other values are possible when a failure originates below the handler.",
      +          "examples": [
      +            "upstream_rejected",
      +            "upstream_rate_limited",
      +            "upstream_unavailable",
      +            "upstream_html",
      +            "upstream_malformed"
      +          ],
      +          "type": "string"
      +        },
      +        "recovery": {
      +          "additionalProperties": {},
      +          "description": "Actionable next step for the caller.",
      +          "properties": {
      +            "hint": {
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "hint"
      +          ],
      +          "type": "object"
      +        },
      +        "retryable": {
      +          "description": "Whether retrying may succeed.",
      +          "type": "boolean"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "message": {
      +      "description": "Human-readable description of what went wrong.",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "code",
      +    "message"
      +  ],
      +  "type": "object"
      +}
    • removedOutput schema / required
      Removed value: -[
      -  "stories",
      -  "feed",
      -  "total",
      -  "offset",
      -  "hasMore"
      -]
  8. Changed3 schema fields changed
    • changedInput schema / properties / count / type
      Previous value: -"number"New value: +"integer"
    • addedInput schema / properties / offset / maximum
      Added value: +9007199254740991
    • changedInput schema / properties / offset / type
      Previous value: -"number"New value: +"integer"
  9. Changed3 schema fields changed
    • addedOutput schema / properties / cap
      Added value: +{
      +  "description": "The count cap that was applied.",
      +  "type": "number"
      +}
    • addedOutput schema / properties / shown
      Added value: +{
      +  "description": "Number of stories returned on this page.",
      +  "type": "number"
      +}
    • addedOutput schema / properties / truncated
      Added value: +{
      +  "description": "True when the feed was capped by the count parameter.",
      +  "type": "boolean"
      +}
  10. Changed2 schema fields changed
    • addedOutput schema / properties / notice
      Added value: +{
      +  "description": "Recovery hint when a page is empty — e.g. offset past end of feed or feed has no items. Absent on non-empty result pages.",
      +  "type": "string"
      +}
    • changedOutput schema / properties / offset / description
      Previous value: -"Offset that was applied to this page (echoes input.offset)."New value: +"Offset that was applied to this page."
  11. Changed1 schema field changed
    • addedOutput schema / properties / stories / items / properties / domain
      Added value: +{
      +  "description": "Bare hostname derived from url (e.g. \"github.com\", with leading \"www.\" stripped). Absent when url is missing or unparseable.",
      +  "type": "string"
      +}
  12. Changed2 schema fields changed
    • changedInput schema / properties / count / description
      Previous value: -"Number of stories to return. Each story is fetched individually — larger counts take longer."New value: +"Number of stories to return. Larger counts take longer."
    • changedOutput schema / properties / offset / description
      Previous value: -"Offset used."New value: +"Offset that was applied to this page (echoes input.offset)."
  13. Changed1 schema field changed
    • addedOutput schema / properties / stories / items / description
      Added value: +"A single story or job posting."
  14. Changed5 schema fields changed
    • changedOutput schema / properties / stories / items / properties / by / description
      Previous value: -"Author username."New value: +"Author username when provided by HN. Omitted when unknown."
    • changedOutput schema / properties / stories / items / properties / score / description
      Previous value: -"Upvote count."New value: +"Upvote count when provided by HN. Omitted when unknown."
    • changedOutput schema / properties / stories / items / properties / time / description
      Previous value: -"Unix timestamp."New value: +"Unix timestamp when provided by HN. Omitted when unknown."
    • changedOutput schema / properties / stories / items / properties / title / description
      Previous value: -"Story title."New value: +"Story title when provided by HN. Omitted when unknown."
    • changedOutput schema / properties / stories / items / required
      Previous value: -[
      -  "id",
      -  "title",
      -  "score",
      -  "by",
      -  "time",
      -  "type"
      -]New value: +[
      +  "id",
      +  "type"
      +]
  15. First observed

TDQS

A3.6/5.0
Behavior3/5

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

The "Fetch" wording is consistent with readOnlyHint=true, so no contradiction. Beyond that the description adds little behavior: no note on rate limits, caching, or that a request over 100 items is silently served at 100 — that important quirk lives only in the schema, not the description.

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?

A single front-loaded sentence with zero filler; the resource, the feed options, and the returned fields come in that order. Nothing needs trimming.

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?

With an output schema present and 100% param coverage, the description need only orient the agent, which it does. It is slightly under-complete on selection guidance versus the sibling search tool, but nothing required for a correct call is missing.

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%, and the schema itself explains feed semantics, the 100-per-call cap, and offset-based pagination in more detail than the description does. The description's feed enumeration merely restates the enum values, so the baseline of 3 applies.

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 a specific verb and resource ("Fetch stories from an HN feed") and enumerates the valid feeds plus the fields returned per story. It is clearly distinct from hn_get_thread and hn_get_user by resource, but it never names hn_search_content or explains why a feed fetch differs from a content search, leaving sibling differentiation to inference.

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?

Usage is only implied by listing the feed values; there is no explicit when-to-use or when-not-to-use framing and no mention of when to prefer hn_search_content. An agent can infer that this is the browse-a-feed tool, but nothing rules out overlap with search.

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.