run_lsd
Executes code to extract and process web data using the LSD database, enabling research and custom functionality through internetdata SDK integration.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"code": {
"type": "string"
}
},
"required": [
"code"
],
"type": "object"
}
Implementation Reference
- src/lsd.ts:3-9 (handler)Core handler function that executes the provided LSD code using the 'drop.tab().execute()' method from the 'internetdata' library, returning the results as an array of records.export const runLSD = async ( code: string, ): Promise<Array<Record<string, any>>> => { const trip = await drop.tab(); const results = await trip.execute(code); return results; };
- src/run.ts:7-18 (registration)Registers the 'run_lsd' MCP tool with input schema '{ code: z.string() }'. The handler calls runLSD with the code and formats the result as MCP text content with JSON stringified output.server.tool("run_lsd", { code: z.string() }, async ({ code }) => { const result = await runLSD(code); return { content: [ { type: "text", text: JSON.stringify(result), }, ], }; });
- src/run.ts:7-7 (schema)Input schema for the run_lsd tool, defining a single string parameter 'code' validated with Zod.server.tool("run_lsd", { code: z.string() }, async ({ code }) => {