googleapis/mcp-toolbox · error
querying INFORMATION_SCHEMA views without a dataset prefix i
Error message
querying INFORMATION_SCHEMA views without a dataset prefix is not allowed when dataset restrictions are in place
What it means
The SQL scanner found INFORMATION_SCHEMA as the first identifier in the query (no dataset prefix) while dataset restrictions are active — unprefixed metadata views span the whole project and cannot be scoped to allowed datasets.
Source
Thrown at internal/tools/bigquery/bigquerycommon/table_name_parser.go:252
return 0, fmt.Errorf("EXTERNAL_QUERY is not allowed when dataset restrictions are in place")
}
}
// Check for INFORMATION_SCHEMA
infoSchemaIdx := -1
for idx, part := range parts {
if strings.EqualFold(part, "INFORMATION_SCHEMA") {
infoSchemaIdx = idx
break
}
}
if infoSchemaIdx != -1 {
viewName := parts[len(parts)-1]
if !datasetLevelInformationSchemaViews[strings.ToLower(viewName)] {
return 0, fmt.Errorf("querying non-dataset-level INFORMATION_SCHEMA view %q is not allowed when dataset restrictions are in place", viewName)
}
if infoSchemaIdx == 0 {
return 0, fmt.Errorf("querying INFORMATION_SCHEMA views without a dataset prefix is not allowed when dataset restrictions are in place")
}
if infoSchemaIdx > 2 {
return 0, fmt.Errorf("invalid INFORMATION_SCHEMA query path %q", strings.Join(parts, "."))
}
parts = parts[:infoSchemaIdx+1]
}
if len(parts) == 1 {
keyword := strings.ToLower(parts[0])
switch keyword {
case "call":
return 0, fmt.Errorf("CALL is not allowed when dataset restrictions are in place, as the called procedure's contents cannot be safely analyzed")
case "immediate":
if lastToken == "execute" {
return 0, fmt.Errorf("EXECUTE IMMEDIATE is not allowed when dataset restrictions are in place, as its contents cannot be safely analyzed")
}
case "procedure", "function":
if lastToken == "create" || lastToken == "create or replace" {View on GitHub (pinned to 8cc6e09de2)
Solutions
- Qualify the view with a dataset prefix (dataset.INFORMATION_SCHEMA.TABLES)
- Remove the INFORMATION_SCHEMA query from restricted tools
- Relax dataset restrictions if metadata access is intended
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at internal/tools/bigquery/bigquerycommon/table_name_parser.go:252 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of googleapis/mcp-toolbox@8cc6e09de2 (2026-09-05).
Data as JSON: /api/errors/ae15be218f1b72c1.
Report an issue: GitHub.