Skip to main content
Glama
devabdultech

Hacker News MCP Server

by devabdultech

getUserSubmissions

Retrieve a Hacker News user's submitted stories and comments to analyze their contributions and activity history on the platform.

Instructions

Get a user's submissions

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe ID of the user

Implementation Reference

  • The core handler logic for the 'getUserSubmissions' tool. Validates the input user ID using UserRequestSchema, queries Algolia API for user's submissions using author tag, formats the hit results into a numbered list with details, and returns as text content.
    case "getUserSubmissions": {
      const validatedArgs = validateInput(UserRequestSchema, args);
      const { id } = validatedArgs;
    
      const results = await algoliaApi.search("", {
        tags: `author_${id}`,
        hitsPerPage: 50,
      });
    
      const hits = results.hits || [];
      const text =
        `Submissions by ${id}:\n\n` +
        hits
          .map(
            (hit: any, index: number) =>
              `${index + 1}. ${hit.title || hit.comment_text}\n` +
              `   ID: ${hit.objectID}\n` +
              `   Points: ${hit.points || 0} | Posted: ${hit.created_at}\n\n`
          )
          .join("");
    
      return {
        content: [{ type: "text", text: text.trim() }],
      };
    }
  • src/index.ts:161-171 (registration)
    Tool registration entry in the ListTools handler, defining the tool name, description, and input schema (object with required 'id' string).
    {
      name: "getUserSubmissions",
      description: "Get a user's submissions",
      inputSchema: {
        type: "object",
        properties: {
          id: { type: "string", description: "The ID of the user" },
        },
        required: ["id"],
      },
    },
  • Zod schema (UserRequestSchema) used for input validation in the getUserSubmissions handler, requiring a string 'id' for the user.
    export const UserRequestSchema = z.object({
      id: z.string(),
    });

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

C2.8/5.0
Behavior2/5

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

No annotations are provided, so the description must carry the full burden of behavioral disclosure. It only states 'Get a user's submissions' without revealing whether the operation is read-only, what side effects occur, any rate limits, or what happens with invalid IDs.

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

Conciseness3/5

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

The description is very short with one sentence. While it is concise, it lacks substance and fails to provide value beyond a basic label. It could be improved by adding more detail without becoming verbose.

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

Completeness2/5

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

Given the tool's simplicity (one parameter, no output schema, no annotations), the description is incomplete. It does not explain what constitutes a 'submission', the expected output format, pagination, or error handling, leaving the agent to guess.

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?

The input schema has 100% coverage for the only parameter 'id', which already has a description. The tool description adds no additional meaning or context beyond the schema, so a baseline score of 3 is appropriate.

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 'Get a user's submissions' uses a specific verb ('Get') and resource ('user's submissions'), clearly indicating what the tool does. However, it does not differentiate from siblings like getComments or getStories, which also retrieve user-related data.

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?

No guidance is provided on when to use this tool versus alternatives. There is no mention of prerequisites, typical use cases, or any justification for selecting this tool over sibling tools like getUser or search.

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