use_trip
Execute a specific LSD trip by providing its identifier to access and process web data through SQL-like queries.
Instructions
Invokes a trip on LSD based on its identifier using the [ACCORDING TO] keywords.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| trip_identifier | Yes |
Implementation Reference
- app.py:66-72 (handler)The core handler function that executes the 'use_trip' tool by connecting to the LSD database and running the SQL query 'ACCORDING TO {trip_identifier}', returning the fetched rows as a list of lists.def use_trip(trip_identifier: str) -> List[Dict[str, str]]: """Invokes a trip on LSD based on its identifier using the [ACCORDING TO] keywords.""" conn = establish_connection() with conn.cursor() as curs: curs.execute(f"ACCORDING TO {trip_identifier}") rows = curs.fetchall() return [list(r) for r in rows]
- app.py:65-65 (registration)The @mcp.tool() decorator registers the 'use_trip' function as an MCP tool.@mcp.tool()
- app.py:66-66 (schema)The function signature defines the input schema (trip_identifier: str) and output schema (List[Dict[str, str]]). Note: return type is actually List[List[str]] based on implementation, but annotated as List[Dict[str, str]].def use_trip(trip_identifier: str) -> List[Dict[str, str]]: