Skip to main content
Glama
lsd-so

LSD MCP Server

by lsd-so

run_lsd

Execute LSD SQL queries to access and analyze web data through a database-like structure, enabling interaction with real-world information using stored credentials.

Instructions

Runs LSD SQL using user credentials in .env

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
lsd_sql_codeYes

Implementation Reference

  • app.py:42-50 (handler)
    The handler function for the 'run_lsd' tool. It is registered via the @mcp.tool() decorator. Connects to the LSD database using credentials from environment variables, executes the provided LSD SQL code, fetches the results, and returns them as a list of lists of strings.
    @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 establish a connection to the PostgreSQL database at lsd.so using environment variables for authentication. Retries on failure.
    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()
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It mentions 'using user credentials in .env', hinting at authentication needs, but doesn't disclose behavioral traits such as whether it's read-only or destructive, rate limits, or what the tool actually does beyond running SQL. This leaves significant gaps for a tool that likely executes SQL queries.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with no wasted words. It's appropriately sized and front-loaded, though it could benefit from more detail given the lack of annotations and schema coverage.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of running SQL queries, no annotations, 0% schema coverage, and no output schema, the description is incomplete. It doesn't explain what LSD SQL is, what the tool returns, or any error handling, making it inadequate for safe and effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It doesn't add any meaning to the parameter 'lsd_sql_code' beyond what's implied by the name. No details on syntax, format, or examples are provided, failing to address the coverage gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool 'Runs LSD SQL using user credentials in .env', which provides a verb ('Runs') and resource ('LSD SQL'), but it's vague about what LSD SQL is and doesn't distinguish it from sibling tools like 'view_lsd'. It's not tautological but lacks specificity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'search_trips' or 'view_lsd'. The description mentions user credentials in .env, which implies a context for authentication, but doesn't specify use cases or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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