Reference implementation for OpenOcta Database Ops Skills. Exposes 9 generic db_* tools for MySQL/TiDB/MariaDB operations including query execution, status monitoring, process management, and slow query analysis.
MySQL MCP Server has 9 tools with adequate naming and mostly complete schemas, but descriptions lack LLM-optimization and several parameter descriptions are minimal. All tools are explicitly registered in fastmcp with input schemas visible. Naming follows verb_noun convention (db_query, db_kill_query, etc.). Descriptions are present for all tools (range 100-250 chars) but lack specificity on error recovery, prerequisites, or downstream composition. Parameter schemas are properly typed (string, integer, boolean) but descriptions are sparse (e.g., 'Only return threads running longer than this many seconds' for min_duration lacks range/boundary clarification). No tool annotations (readOnlyHint, destructiveHint) despite clear risk profiles. Output schemas implied but not formally documented in tool registration.
Get column metadata (schema) for a table. Args: table_name: Fully qualified table name, e.g. 'mydb.users' or just 'users'. database: Optional database to switch to. Returns: JSON array of column definitions.
List current connections (full processlist). Args: min_duration: Only return threads running longer than this many seconds. 0 = return all non-sleep threads. Returns: JSON array of processlist rows.
Retrieve slow query log entries from the last N hours. Requires slow_query_log enabled and logged to mysql.slow_log table. Falls back to the slow query counter if the table is unavailable. Args: hours: Look-back window in hours (default 1). limit: Maximum entries to return (default 20). Returns: JSON array of slow log rows, or the Slow_queries counter if no table.
Get MySQL global status variables, optionally filtered by pattern. Args: pattern: LIKE pattern, e.g. "Threads_%" or "Innodb_row_lock%". Empty = all. Returns: JSON map of {variable_name: value}.
Get MySQL system variables, optionally filtered by pattern. Args: pattern: LIKE pattern, e.g. "max_connections" or "innodb%". Empty = all. Returns: JSON map of {variable_name: value}.
No tool annotations despite explicit risk profiles. db_kill_query and db_query are marked with WRITE and READ_ONLY risk levels in the metadata but no destructiveHint or readOnlyHint is present in tool registration. LLMs cannot infer safety from risk metadata, annotations must be in the tool definition.
Parameter descriptions lack constraint information. min_duration in db_get_processlist states 'Only return threads running longer than this many seconds. 0 = return all non-sleep threads' but does not specify valid range (minimum/maximum). hours and limit in db_get_slow_log lack explicit bounds ('default 1' and 'default 20' are mentioned but min/max not stated). LLMs cannot infer numeric constraints and may pass out-of-bound values.
Inferred effective spec: <=2025-11-25.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | C | 63 | <=2025-11-25 | v2 |
Kill a running query or its entire connection. DISABLED unless MYSQL_ALLOW_KILL=true. This tool is intentionally gated — the skills that use it (replication-lag-resolver, slow-query-kill) enforce a double-confirmation protocol at the agent layer. Args: thread_id: The MySQL thread ID to terminate (from PROCESSLIST.ID). query_only: True = KILL QUERY (keep connection). False = KILL (drop connection). Returns: JSON with success status.
List all databases (schemas) on the server, excluding system databases. Args: pattern: Optional LIKE pattern to filter database names. Returns: JSON array of database names.
List all tables in a given database. Args: database: Database name. Defaults to the MYSQL_DB env var or 'information_schema'. pattern: Optional LIKE pattern to filter table names. Returns: JSON array of table names with row counts.
Execute a read-only SQL query and return rows as JSON. Args: sql: The SQL statement to execute. DDL/DML is blocked by default. database: Optional database to switch to for this query. Returns: JSON with row_count, returned, truncated, and rows.
Output schemas not formally documented in tool definitions. Tool descriptions mention return structure (e.g., 'JSON with row_count, returned, truncated, and rows' for db_query) but this is buried in prose. No structured schema definition visible in the source code showing field names, types, required fields. Agents cannot reliably parse unstructured return descriptions.
Error handling lacks recovery guidance. Code shows SQL blocked patterns and timeout handling but tool descriptions do not explain what errors are possible, how to recover, or what the LLM should do next. E.g., db_query mentions 'DDL/DML is blocked by default' but does not guide: 'If your query was blocked, use db_get_variable to check MYSQL_ALLOW_WRITE setting or contact your DBA.'
Descriptions lack discovery and composition guidance. db_list_databases and db_list_tables do not state when to call them relative to other tools. For instance, db_list_tables states 'Defaults to the MYSQL_DB env var or information_schema' but does not explain: 'Call db_list_databases first if you do not know the target database name.' Missing these hints forces agents to discover correct call sequences through trial-and-error.
MYSQL_MAX_ROWS default (1000) and truncation behavior documented in code but not in tool descriptions. Users/LLMs calling db_query may not know results are truncated at 1000 rows. No pagination parameters (offset/limit) to fetch additional results. Agents cannot reliably iterate over large result sets.