find_trips
Search for custom web data extraction trips in the LSD database to extend research and functionality through internetdata SDK.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes |
Implementation Reference
- src/trips.ts:30-35 (handler)Core handler function that executes the find_trips logic: searches LSD trips via runLSD, maps to dynamic tools using toToolDefinition, registers them using registerTools, and returns the trip results.export const findTrips = async (server: McpServer, query: string) => { const result = await runLSD(`SEARCH "${query.replaceAll("\"", "'")}"`); registerTools(server, result.map(toToolDefinition)); return result; };
- src/trips.ts:37-49 (registration)Function that registers the 'find_trips' tool on the MCP server, including the input schema { query: z.string() } and the tool handler that invokes findTrips and returns formatted content response.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), }, ], }; }); };
- src/index.ts:16-16 (registration)Top-level call during server setup that triggers registration of the find_trips tool.applyTripsTool(server);
- src/trips.ts:10-28 (helper)Helper utility that transforms an LSD trip database row into a dynamic MCP tool definition for use in findTrips.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), }, ], }; }, }; };