GitHub

Connect AI Agents to
GitHub

Automate workflows and connect AI agents to GitHub. Metorial is built for developers. Handling OAuth, compliance, observability, and more.

Back to GitHub overview

Querying Specific Items by Identifier

Understanding Item Identifiers

Every piece of content on Hacker News—whether it's a story, comment, poll, or job posting—has a unique numeric identifier. These identifiers are permanent and provide the most direct way to retrieve specific content from the Hacker News MCP Server. You'll often encounter these IDs in URLs (like news.ycombinator.com/item?id=12345678) or when browsing story and comment data.

Querying by ID

To retrieve a specific item, simply ask your AI assistant to fetch it by its identifier. For example:

  • "Get Hacker News item 38000000"
  • "Show me details for HN story with ID 37500000"
  • "Retrieve the comment with identifier 37800000"

The server will return comprehensive information about the requested item, including its type, content, author, timestamp, score, and any associated metadata.

What You'll Receive

The response structure varies depending on the item type:

Stories include the title, URL (if it's a link post), author username, submission time, current score, and the number of comments. You'll also receive the item's descendants count, which indicates total discussion activity.

Comments return the comment text, author, timestamp, and parent item ID. If the comment is part of a thread, you'll see its relationship to other comments through the parent reference.

Polls provide the question text along with references to associated poll options, allowing you to explore voting data and participation.

Practical Applications

Querying by identifier is particularly useful when you:

  • Need to revisit a specific discussion you discovered earlier
  • Want to track how a particular story's score or comment count evolves over time
  • Are analyzing a curated list of items and need detailed information about each
  • Need to verify or fact-check information about a specific submission

Working with Retrieved Data

Once you've retrieved an item, you can explore its connections. Stories contain arrays of comment IDs, allowing you to fetch the entire discussion tree. Comments reference their parent items, enabling you to traverse conversations upward to understand context.

This identifier-based approach is the foundation for more complex queries. You might start by retrieving top stories, extract their IDs, then query each individually for detailed analysis. This pattern gives you precise control over what data you access and how you process it.

Tips for Success

Item IDs are sequential and increase over time, so higher numbers represent newer content. If you're conducting historical research, older IDs will get you earlier submissions. Remember that deleted items may return minimal data, as Hacker News preserves IDs but removes content that has been removed by authors or moderators.

GitHub on Metorial

The GitHub integration lets you search repositories, manage issues and pull requests, create branches, and interact with your GitHub content directly from your workflow without switching to a browser.

Connect anything. Anywhere.

Ready to build with Metorial?

Let's take your AI-powered applications to the next level, together.

About Metorial

Metorial provides developers with instant access to 600+ MCP servers for building AI agents that can interact with real-world tools and services. Built on MCP, Metorial simplifies agent tool integration by offering pre-configured connections to popular platforms like Google Drive, Slack, GitHub, Notion, and hundreds of other APIs. Our platform supports all major AI agent frameworks—including LangChain, AutoGen, CrewAI, and LangGraph—enabling developers to add tool calling capabilities to their agents in just a few lines of code. By eliminating the need for custom integration code, Metorial helps AI developers move from prototype to production faster while maintaining security and reliability. Whether you're building autonomous research agents, customer service bots, or workflow automation tools, Metorial's MCP server library provides the integrations you need to connect your agents to the real world.

Star us on GitHub