UNPKG

hn-mcp-server

Version:

Model Context Protocol server for HackerNews API access

93 lines 2.47 kB
/** * get-item MCP Tool * * Retrieves a single HackerNews item by ID with complete nested comment tree. * Uses the items/:id API endpoint. */ import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js"; import { z } from "zod"; /** * Input schema for get-item tool */ export declare const GetItemInputSchema: z.ZodObject<{ itemId: z.ZodString; }, "strip", z.ZodTypeAny, { itemId: string; }, { itemId: string; }>; /** * Output schema for get-item tool (ItemResult with nested children) */ export declare const GetItemOutputSchema: z.ZodObject<{ id: z.ZodString; created_at: z.ZodString; created_at_i: z.ZodNumber; type: z.ZodEnum<["story", "comment", "poll", "pollopt"]>; author: z.ZodString; title: z.ZodNullable<z.ZodString>; url: z.ZodNullable<z.ZodString>; text: z.ZodNullable<z.ZodString>; points: z.ZodNullable<z.ZodNumber>; parent_id: z.ZodNullable<z.ZodNumber>; story_id: z.ZodNumber; options: z.ZodArray<z.ZodNumber, "many">; children: z.ZodArray<z.ZodAny, "many">; }, "strip", z.ZodTypeAny, { text: string | null; options: number[]; type: "story" | "comment" | "poll" | "pollopt"; title: string | null; id: string; created_at: string; created_at_i: number; author: string; url: string | null; points: number | null; parent_id: number | null; story_id: number; children: any[]; }, { text: string | null; options: number[]; type: "story" | "comment" | "poll" | "pollopt"; title: string | null; id: string; created_at: string; created_at_i: number; author: string; url: string | null; points: number | null; parent_id: number | null; story_id: number; children: any[]; }>; /** * Type for validated input */ export type GetItemInput = z.infer<typeof GetItemInputSchema>; /** * Get item handler * * @param input - Input parameters (itemId) * @returns Tool result with complete item including nested comments */ export declare function getItemHandler(input: unknown): Promise<CallToolResult>; /** * Tool metadata for MCP registration */ export declare const getItemTool: { name: string; description: string; inputSchema: { type: string; properties: { itemId: { type: string; description: string; }; }; required: string[]; }; }; //# sourceMappingURL=get-item.d.ts.map