Skip to main content
Glama
MariaDB MCP Server

MariaDB MCP Server

by Ophecy

query_database

Executes read-only SQL queries on MariaDB and returns JSON results, enabling schema exploration and data retrieval without destructive commands.

Instructions

Execute a SQL query on the MariaDB database. Returns the results as JSON.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "query": "<query>"
    },
    "name": "query_database"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryYesThe SQL query to execute (SELECT, SHOW, DESCRIBE, etc.)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations, the description carries the full burden and discloses almost nothing: it does not say whether writes are permitted, whether execution is read-only, what row/time limits apply, what permissions are needed, or how errors surface. 'Returns the results as JSON' is the only behavioral detail offered for an arbitrary-SQL execution tool.

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?

Two short, front-loaded sentences with no filler. It is efficient, though the brevity comes partly at the cost of the behavioral detail an agent would want.

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?

For a high-power, unrestricted-SQL tool with no annotations and no output schema, the definition is under-specified: result shape, limits, failure modes, and safety constraints are all absent. What is present is accurate but insufficient for an agent to call it confidently.

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?

There is a single parameter at 100% schema coverage, and the schema already lists example statement types (SELECT, SHOW, DESCRIBE). The description adds no further meaning such as whether multi-statement input or parameter binding is supported, so the 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?

Names a specific verb and resource: execute a SQL query against the MariaDB database, returning JSON. This is clearly distinct in kind from the metadata siblings (describe_table, list_databases, list_tables), though the description never explicitly draws that contrast.

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 when-to-use or when-not-to-use guidance is given. An agent must infer on its own that this is for arbitrary SQL rather than for schema discovery, and nothing says whether DDL/DML is acceptable or whether the metadata siblings should be preferred for exploration.

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