googleapis/mcp-toolbox · error
CALL is not allowed when dataset restrictions are in place,
Error message
CALL is not allowed when dataset restrictions are in place, as the called procedure's contents cannot be safely analyzed
What it means
The SQL scanner found a CALL statement while dataset restrictions are active — the contents of the called procedure cannot be statically analyzed, so it might access datasets outside the allowed set.
Source
Thrown at internal/tools/bigquery/bigquerycommon/table_name_parser.go:264
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" {
return 0, fmt.Errorf("unanalyzable statements like '%s %s' are not allowed", strings.ToUpper(lastToken), strings.ToUpper(keyword))
}
case verbCreate, verbAlter, verbDrop, verbSelect, verbInsert, verbUpdate, verbDelete, verbMerge:
if statementVerb == "" {
statementVerb = keyword
}
}
if statementVerb == verbCreate || statementVerb == verbAlter || statementVerb == verbDrop {
if keyword == "schema" || keyword == "dataset" {
return 0, fmt.Errorf("dataset-level operations like '%s %s' are not allowed when dataset restrictions are in place", strings.ToUpper(statementVerb), strings.ToUpper(keyword))
}View on GitHub (pinned to 8cc6e09de2)
Solutions
- Inline the procedure's logic as a plain query
- Only use CALL with tools that have no dataset restrictions
- Audit the procedure and relax restrictions if safe
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at internal/tools/bigquery/bigquerycommon/table_name_parser.go:264 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/640d5a21119edd6a.
Report an issue: GitHub.