Skip to main content
Glama
motherduckdb

mcp-server-motherduck

Official
by motherduckdb

Switch Database Connection

switch_database_connection

Connect to a different DuckDB or MotherDuck database. Use absolute paths for local files, or :memory:, md:, or s3:// paths, and optionally create missing local files.

Instructions

Switch to a different database connection. For local files, use absolute paths only. The new connection respects the server's read-only/read-write mode. For local files, the file must exist unless create_if_not_exists=True (requires read-write mode).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesDatabase path. For local files, must be an absolute path. Also accepts :memory:, md:database_name, or s3:// paths.
create_if_not_existsNoIf True, create the database file if it doesn't exist. Only works in read-write mode.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.8

TDQS

A3.8/5.0
Behavior4/5

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

Annotations only declare readOnlyHint=false, openWorldHint=true and destructiveHint=false. The description adds real behavioral context beyond that: the new connection inherits the server's read/write mode, and creating a missing file is gated on read-write mode. It does not state what happens to the previous connection or whether switching mid-transaction is permitted, so this is strong but not complete.

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 short sentences, purpose first, then constraints in descending order of importance. No filler, no repetition of the title, and the preconditions are front-loaded where an agent will see them.

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 main surprising preconditions (absolute paths, file existence, read-write mode) are covered. The one notable omission is the fate of the previously active connection, which matters for a state-switching tool.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents absolute-path requirements and the create_if_not_exists read-write constraint. The description largely restates those same facts, adding no syntax or format detail beyond the schema; baseline 3 applies.

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 ("Switch to a different database connection"), which no sibling tool does — the siblings are all query/catalog tools. However, it never names or contrasts with any alternative (e.g., list_databases to discover targets), so it is clear but lacks explicit sibling differentiation.

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?

It gives conditional usage rules (absolute paths for local files, create_if_not_exists=True only in read-write mode), which is genuine guidance. But it never says when to prefer this tool or how to find valid targets, leaving the agent to infer that from siblings like list_databases.

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