Skip to main content
Glama
index.ts795 B
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { z } from "zod"; import readLastLines from "read-last-lines"; export function registerTail(server: McpServer) { server.registerTool("tail", { inputSchema: { file: z.string().describe("File path"), lines: z.number().default(10).describe("Number of lines") }, // VS Code compliance annotations annotations: { title: "Tail", 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}` }] }; } } ); }

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/wrenchpilot/it-tools-mcp'

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