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.

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, 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.
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. 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."
  2. 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."
  3. 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."
  4. 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."
  5. 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"
      -]
  6. 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"
  7. 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"
      +}
  8. 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."
  9. 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"
      +}
  10. 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)."
  11. Changed1 schema field changed
    • addedOutput schema / properties / stories / items / description
      Added value: +"A single story or job posting."
  12. 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"
      +]
  13. First observed

TDQS

B3.2/5.0
Behavior2/5

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

readOnlyHint=true already establishes this as a safe read, and the description adds no behavioral context such as rate limits, latency behavior, or pagination caveats. The listed return fields (title, URL, score, author, comment count) largely duplicate what the existing output schema already declares.

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 sentence with zero filler, front-loading the action, the resource, and the valid feed values. Every clause earns its place.

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, readOnly annotation, and full schema coverage, the description only needs to establish purpose and scope, which it does. The one gap is routing guidance against the three sibling tools, which the description leaves implicit.

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 already documents the feed enum, the 100-per-call cap, and offset pagination. The description only restates the enum values, adding no syntax or format detail beyond the schema, so baseline 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?

The description gives a specific verb ('Fetch') and resource ('stories from an HN feed') and enumerates the six valid feeds, so an agent knows exactly what it retrieves. It does not name the siblings (hn_get_thread, hn_get_user, hn_search_content), but the feed-listing scope makes the distinction inferable.

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

Usage Guidelines2/5

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

There is no statement of when to use this versus hn_search_content or hn_get_thread, and no exclusions or prerequisites. The agent must infer from the resource name alone that this is for browsing a curated feed rather than searching or reading a thread.

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.