You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Parameters do not bind for MySQL custom tools #4084
toolbox version 1.12.0+binary.windows.amd64.c97ca4d
Environment
OS type and version: Windows 11 v.25H2
How are you running Toolbox:
As a downloaded binary (e.g. from curl -o toolbox.exe "https://storage.googleapis.com/mcp-toolbox-for-databases/v%VERSION%/windows/amd64/toolbox.exe")
Database: mysql-8.0.26-winx64
Client
Client: windows command line
Version: Windows 11 command line
Example:
# Windows 11 command line (complex JSON syntax due to error: params must be a valid JSON string):
toolbox --config tools.yaml invoke search-language "{\""language\"": \""en\""}"
# tools.yamlkind: sourcename: datasets-dbtype: mysqlhost: 127.0.0.1port: 3308database: datasetsuser: <user>password: <pass>
---
kind: toolname: search-languagetype: mysql-sqlsource: datasets-dbdescription: >- Retrieves all countries where language as parameter (ex: English) is spoken.statement: | select name , languages from countries_data where languages LIKE CONCAT('%', $1, '%');parameters:
- name: languagetype: stringdescription: "The searched language code (ex: ps,uz,tk,en,sm )"
Expected Behavior
Replace the positional parameter $1 and execute query from tool: search-language.
Current Behavior
Parameter $1 is not replaced with the given value.
Error: tool execution failed: error processing request: unable to execute query: Error 1054 (42S22): Unknown column '$1' in 'where clause'
The error Error 1054 (42S22): Unknown column '$1' in 'where clause' occurs because the mysql-sql tool runner uses MySQL's native prepared statement parameter syntax, which uses ? question mark placeholders rather than PostgreSQL positional placeholders ($1, $2, etc.).
Because $1 is not a MySQL placeholder syntax, MySQL's SQL parser interprets $1 as an unquoted column identifier in the WHERE clause, which fails because no such column exists.
Solution
Change $1 to ? in your statement:
kind: toolname: search-languagetype: mysql-sqlsource: datasets-dbdescription: >- Retrieves all countries where language as parameter (ex: English) is spoken.statement: | select name, languages from countries_data where languages LIKE CONCAT('%', ?, '%');parameters:
- name: languagetype: stringdescription: "The searched language code (ex: ps,uz,tk,en,sm)"
Notes on Parameter Mapping:
In mysql-sql, parameters defined under parameters: are bound sequentially to each ? in the order they are declared in the YAML file.
If you have multiple parameters, ensure their order in the parameters list matches the occurrence order of ? in your statement.
If you ever need dynamic substitutions for table or column identifiers (which prepared statements don't allow), use templateParameters with {{.paramName}} syntax instead.
Activity
UmeshCode1 commentedon Sep 28, 2026
Hi @mihai1git!
The error
Error 1054 (42S22): Unknown column '$1' in 'where clause'occurs because themysql-sqltool runner uses MySQL's native prepared statement parameter syntax, which uses?question mark placeholders rather than PostgreSQL positional placeholders ($1,$2, etc.).Because
$1is not a MySQL placeholder syntax, MySQL's SQL parser interprets$1as an unquoted column identifier in the WHERE clause, which fails because no such column exists.Solution
Change
$1to?in yourstatement:Notes on Parameter Mapping:
mysql-sql, parameters defined underparameters:are bound sequentially to each?in the order they are declared in the YAML file.parameterslist matches the occurrence order of?in yourstatement.templateParameterswith{{.paramName}}syntax instead.duwenxin99 commentedon Sep 29, 2026
Hi @mihai1git, feel free to refer to our doc for a working MySQL example. Thanks @UmeshCode1 for the answer.