Skip to main content
Glama

run_sql

Execute read-only SQL queries on loaded datasets, with results capped at 100 rows. Use cross-source joins to combine multiple data sources for exploratory analysis.

Instructions

Run arbitrary SQL against the session's DuckDB connection. Read-only by default.

    Cross-source JOINs work because every loaded source is a view in the same
    connection. Rows are capped at `limit` (default 100). Returns rows + schema +
    a `truncated` flag.

    Output size: scales with limit; default ~10–50KB.
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYes
limitNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

No annotations are provided, so the description carries the full burden. It discloses important behaviors: 'Read-only by default,' row cap ('Rows are capped at `limit` (default 100)'), return format ('Returns rows + schema + a `truncated` flag'), and output size ('scales with limit; default ~10–50KB'). This goes beyond minimal but lacks some details like error handling or possibility of overriding read-only, preventing a 5.

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

Conciseness5/5

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

The description is four sentences, front-loaded with the primary purpose. Each sentence adds necessary information: purpose, cross-source capability, limit/return behavior, and output size. No fluff or repetition, making it highly efficient.

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

Completeness4/5

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

For a tool with no annotations and an output schema, the description covers the essential aspects: what it does, read-only behavior, limit handling, and output structure. It omits potential concerns like timeout/error behavior or exact schema of returned rows, but the presence of an output schema reduces the need to detail return values. It is sufficiently complete for an agent to invoke it correctly.

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

Parameters4/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 explains `limit` as a row cap with a default of 100, and `sql` is implicitly defined by the purpose ('Run arbitrary SQL'). The description adds performance context ('Output size: scales with limit'), which is valuable. It does not fully detail SQL syntax or edge cases, but it adequately covers the two parameters.

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

Purpose5/5

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

The description clearly states the function: 'Run arbitrary SQL against the session's DuckDB connection.' It specifies the verb (run), the resource (SQL on DuckDB connection), and the scope (arbitrary), distinguishing it from sibling tools that are targeted for specific analyses. The mention of cross-source JOINs further clarifies its unique capability.

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

Usage Guidelines4/5

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

The description gives clear context for when to use the tool: when arbitrary SQL is needed, especially for cross-source JOINs. It states 'Cross-source JOINs work because every loaded source is a view in the same connection,' which implies a key use case. However, it does not explicitly exclude alternative tools or provide when-not guidance, so it falls short of a 5.

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/charliecpeterson/edamcp'

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