Skip to main content
Glama

LSD MCP Server

by lsd-so
trips.ts1.16 kB
import { McpServer, ToolCallback, } from "@modelcontextprotocol/sdk/server/mcp.js"; import { z } from "zod"; import { runLSD } from "./lsd"; import { registerTools } from "./tools"; const toToolDefinition = ( row: Record<string, any>, ): { name: string; description: string; tool: ToolCallback } => { return { name: row["NAME"], description: row["DESCRIPTION"], tool: async () => { const result = await runLSD(row["STATEMENT"]); return { content: [ { type: "text", text: JSON.stringify(result), }, ], }; }, }; }; export const findTrips = async (server: McpServer, query: string) => { const result = await runLSD(`SEARCH "${query.replaceAll("\"", "'")}"`); registerTools(server, result.map(toToolDefinition)); return result; }; export const applyTripsTool = (server: McpServer) => { server.tool("find_trips", { query: z.string() }, async ({ query }) => { const result = await findTrips(server, query); return { content: [ { type: "text", text: JSON.stringify(result), }, ], }; }); };

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/lsd-so/internetdata-mcp'

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