Problem
When MCP clients (e.g. Claude Code) call tools like query_prometheus or list_loki_label_names, the parameters are silently ignored because the tool schemas define camelCase JSON field names (e.g. datasourceUid, startTime, queryType) while many MCP clients normalize parameter names to snake_case before sending them.
The result is that datasourceUid arrives as datasource_uid, doesn't match, defaults to empty string, and the server calls GET /api/datasources/uid/ with no UID — returning a 400 "id is invalid" error.
Steps to reproduce
Call query_prometheus with datasource_uid (snake_case) — the query fails with:
getting Prometheus client: get datasource by uid : [GET /datasources/uid/{uid}][400] getDataSourceByUidBadRequest {"message":"id is invalid"}
Calling the same tool manually with datasourceUid (camelCase) works correctly.
Environment
- mcp-grafana: v0.11.2
- Grafana: 12.3.3
- MCP client: Claude Code 2.1.72
Expected behavior
Tool parameter names should use snake_case (e.g. datasource_uid, start_time, query_type) to be compatible with standard MCP client behavior, or the server should accept both naming conventions.
Problem
When MCP clients (e.g. Claude Code) call tools like
query_prometheusorlist_loki_label_names, the parameters are silently ignored because the tool schemas define camelCase JSON field names (e.g.datasourceUid,startTime,queryType) while many MCP clients normalize parameter names to snake_case before sending them.The result is that
datasourceUidarrives asdatasource_uid, doesn't match, defaults to empty string, and the server callsGET /api/datasources/uid/with no UID — returning a 400 "id is invalid" error.Steps to reproduce
Call
query_prometheuswithdatasource_uid(snake_case) — the query fails with:Calling the same tool manually with
datasourceUid(camelCase) works correctly.Environment
Expected behavior
Tool parameter names should use snake_case (e.g.
datasource_uid,start_time,query_type) to be compatible with standard MCP client behavior, or the server should accept both naming conventions.