UNPKG

it-tools-mcp

Version:

Full MCP 2025-06-18 compliant server with 121+ IT tools, logging, ping, progress tracking, cancellation, and sampling utilities

26 lines (25 loc) 891 B
import { z } from "zod"; import readLastLines from "read-last-lines"; export function registerTail(server) { server.registerTool("tail", { description: "Display the end of a file", inputSchema: { file: z.string().describe("File path"), lines: z.number().default(10).describe("Number of lines") }, // VS Code compliance annotations annotations: { title: "Tail", description: "Display the end of a file", readOnlyHint: false } }, async ({ file, lines }) => { try { const out = await readLastLines.read(file, lines); return { content: [{ type: "text", text: out }] }; } catch (error) { return { content: [{ type: "text", text: `tail failed: ${error instanceof Error ? error.message : error}` }] }; } }); }