search_trips
Retrieve a list of LSD trips available to the user, detailing their functions and purposes, using a specific query to filter results.
Instructions
Returns a list of objects with LSD trips available to the user and what each of them do.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes |
Input Schema (JSON Schema)
{
"properties": {
"query": {
"title": "Query",
"type": "string"
}
},
"required": [
"query"
],
"title": "search_tripsArguments",
"type": "object"
}
Implementation Reference
- app.py:56-63 (handler)The handler function for the 'search_trips' tool. It connects to the LSD database, executes a SEARCH query with the provided query parameter, fetches the results, and formats them into a list of dictionaries containing trip details (AUTHOR, NAME, DESCRIPTION, STATEMENT, IDENTIFIER). The @mcp.tool() decorator registers this function as an MCP tool.@mcp.tool() def search_trips(query: str) -> List[Dict[str, str]]: """Returns a list of objects with LSD trips available to the user and what each of them do.""" conn = establish_connection() with conn.cursor() as curs: curs.execute(f"SEARCH {query}") rows = curs.fetchall() return [{"AUTHOR": r[0], "NAME": r[1], "DESCRIPTION": r[2], "STATEMENT": r[3], "IDENTIFIER": r[4]} for r in rows]