Files
wehub-resource-sync e04ed9c211
CF: Deploy Dev Docs / deploy (push) Has been cancelled
Sync Labels / build (push) Has been cancelled
tests / unit tests (macos-latest) (push) Has been cancelled
tests / unit tests (windows-latest) (push) Has been cancelled
tests / unit tests (ubuntu-latest) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:32:45 +08:00

97 lines
4.1 KiB
YAML

# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
kind: source
name: mysql-source
type: mysql
host: ${MYSQL_HOST:localhost}
port: ${MYSQL_PORT:3306}
database: ${MYSQL_DATABASE}
user: ${MYSQL_USER}
password: ${MYSQL_PASSWORD}
queryParams: ${MYSQL_QUERY_PARAMS:}
queryTimeout: 30s
---
kind: tool
name: execute_sql
type: mysql-execute-sql
source: mysql-source
description: Use this tool to execute SQL.
---
kind: tool
name: list_active_queries
type: mysql-list-active-queries
source: mysql-source
description: Lists top N (default 10) ongoing queries from processlist and innodb_trx, ordered by execution time in descending order. Returns detailed information of those queries in json format, including process id, query, transaction duration, transaction wait duration, process time, transaction state, process state, username with host, transaction rows locked, transaction rows modified, and db schema.
---
kind: tool
name: get_query_plan
type: mysql-get-query-plan
source: mysql-source
description: "Provide information about how MySQL executes a SQL statement. Common use cases include: 1) analyze query plan to improve its performance, and 2) determine effectiveness of existing indexes and evaluate new ones. Pass a single SQL statement in sql_statement; the tool returns its execution plan without running it."
---
kind: tool
name: list_tables
type: mysql-list-tables
source: mysql-source
description: Lists detailed schema information (object type, columns, constraints, indexes, triggers, comment) as JSON for user-created tables (ordinary or partitioned). Filters by a comma-separated list of names. If names are omitted, lists all tables in user schemas.
---
kind: tool
name: list_table_stats
type: mysql-list-table-stats
source: mysql-source
description: Display table statistics including table size, total latency, rows read, rows written, read and write latency for entire instance, a specified database, or a specified table. Specifying a database name or table name filters the output to that specific db or table. Results are limited to 10 by default.
---
kind: tool
name: list_tables_missing_unique_indexes
type: mysql-list-tables-missing-unique-indexes
source: mysql-source
description: Find tables that do not have primary or unique key constraint. A primary key or unique key is the only mechanism that guaranttes a row is unique. Without them, the database-level protection against data integrity issues will be missing.
---
kind: tool
name: list_table_fragmentation
type: mysql-list-table-fragmentation
source: mysql-source
description: List table fragmentation in MySQL, by calculating the size of the data and index files and free space allocated to each table. The query calculates fragmentation percentage which represents the proportion of free space relative to the total data and index size. Storage can be reclaimed for tables with high fragmentation using OPTIMIZE TABLE.
---
kind: tool
name: list_all_locks
type: mysql-list-all-locks
source: mysql-source
description: Lists top N (default 10) locks on the specified database ordered by query execution time in descending order.
---
kind: tool
name: show_query_stats
type: mysql-show-query-stats
source: mysql-source
description: Displays query execution statistics including execution count, total and average latency, max latency, total rows examined, full table scans, and inefficient index usage.
---
kind: toolset
name: data
tools:
- execute_sql
- list_tables
- get_query_plan
- list_active_queries
---
kind: toolset
name: monitor
tools:
- get_query_plan
- list_active_queries
- list_all_locks
- list_table_fragmentation
- list_table_stats
- list_tables_missing_unique_indexes
- show_query_stats