Skip to main content
Glama
devabdultech

Hacker News MCP Server

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(),
    });
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure but provides minimal information. It doesn't indicate whether this is a read-only operation (implied by 'Get' but not explicit), what format the submissions are returned in, whether there's pagination, authentication requirements, rate limits, or error conditions. The description adds almost no behavioral context beyond the basic operation.

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 extremely concise - a single four-word phrase that communicates the core function without any wasted words. It's front-loaded with the essential information and contains no unnecessary elaboration or redundant phrasing.

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?

For a tool with no annotations, no output schema, and minimal description, this is incomplete. The description doesn't explain what 'submissions' means in this context, what data is returned, or how this differs from related sibling tools. While the tool has only one parameter (well-documented in schema), the overall context for proper tool selection and usage is inadequate.

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% description coverage, with the single parameter 'id' clearly documented as 'The ID of the user'. The description adds no additional parameter information beyond what the schema provides. According to scoring rules, when schema_description_coverage is high (>80%), the baseline is 3 even with no param info in the description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get a user's submissions' clearly states the verb ('Get') and resource ('user's submissions'), making the basic purpose understandable. However, it doesn't distinguish this tool from sibling tools like 'getUser' or 'getStories' - it's unclear whether submissions are different from stories or comments, or what type of content 'submissions' refers to specifically.

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?

The description provides no guidance on when to use this tool versus alternatives. With sibling tools like 'getUser', 'getStories', 'getComment', and 'search', there's no indication whether this tool retrieves a specific type of content, whether it's more comprehensive than 'getStories', or what distinguishes 'submissions' from other content types. The agent must infer usage from the tool name alone.

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/devabdultech/hn-mcp'

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