Skip to main content
Glama
motherduckdb

mcp-server-motherduck

Official
by motherduckdb

Execute Query

execute_query
Destructive

Run SQL queries on DuckDB or MotherDuck databases. Unqualified table names resolve automatically to the current database and schema.

Instructions

Execute a SQL query on the DuckDB or MotherDuck database. Unqualified table names resolve to current_database() and current_schema() automatically. Fully qualified names (database.schema.table) are only needed when multiple DuckDB databases are attached or when connected to MotherDuck.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesSQL query to execute (DuckDB SQL dialect)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.8

TDQS

A3.7/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true, readOnlyHint=false, and openWorldHint=false, so safety profile is covered. The description adds genuine behavioral context about unqualified name resolution, which is not in the annotations, but it never warns that arbitrary SQL can mutate or drop data — a meaningful omission for a destructive tool.

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?

Three tightly written sentences, front-loaded with the core action, followed by the naming-resolution rules. No filler or repetition.

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?

An output schema exists, so return values need not be explained, and the description adequately covers invocation semantics. It could go further by noting that the tool executes arbitrary statements including writes/DDL, but the destructiveHint annotation already signals that.

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?

With one parameter at 100% schema coverage the baseline is 3, but the description adds real meaning beyond 'SQL query to execute' by explaining how unqualified versus fully qualified table names resolve against current_database()/current_schema(). That directly informs how the agent should author the sql argument.

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

Purpose4/5

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

States a specific verb and resource: 'Execute a SQL query on the DuckDB or MotherDuck database', which is immediately distinguishable from the introspection siblings (list_databases, list_tables, list_columns). It does not explicitly name or contrast with those siblings, so it falls short of a 5.

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

Usage Guidelines3/5

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

The description gives useful conditional guidance about when fully qualified names are needed ('only needed when multiple DuckDB databases are attached or when connected to MotherDuck'), but that is guidance about writing the SQL, not about when to choose this tool over switch_database_connection or the listing tools. Usage context is implied rather than stated.

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