Skip to main content
Glama
by lsd-so

run_lsd

Execute LSD SQL queries securely using user credentials to transform web data into a structured, queryable format. Simplifies real-world data interactions for Claude AI.

Instructions

Runs LSD SQL using user credentials in .env

Input Schema

NameRequiredDescriptionDefault
lsd_sql_codeYes

Input Schema (JSON Schema)

{ "properties": { "lsd_sql_code": { "title": "Lsd Sql Code", "type": "string" } }, "required": [ "lsd_sql_code" ], "title": "run_lsdArguments", "type": "object" }

Implementation Reference

  • app.py:42-50 (handler)
    The core handler function for the 'run_lsd' tool. It is registered using the @mcp.tool() decorator, which also implies schema from type hints (str input to List[List[str]] output). Connects to LSD database and executes the SQL code.
    @mcp.tool() def run_lsd(lsd_sql_code: str) -> List[List[str]]: """Runs LSD SQL using user credentials in .env""" conn = establish_connection() with conn.cursor() as curs: curs.execute(lsd_sql_code) rows = curs.fetchall() return [list(r) for r in rows]
  • app.py:29-40 (helper)
    Helper function used by run_lsd to recursively establish a PostgreSQL connection to the LSD server using .env credentials.
    def establish_connection(): try: return psycopg2.connect( host="lsd.so", database=os.environ.get("LSD_USER"), user=os.environ.get("LSD_USER"), password=os.environ.get("LSD_API_KEY"), port="5432", ) except Exception as e: sleep(1) return establish_connection()

Other Tools

Related Tools

Latest Blog Posts

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

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