googleapis/mcp-toolbox · error

querying non-dataset-level INFORMATION_SCHEMA view %q is not

Error message

querying non-dataset-level INFORMATION_SCHEMA view %q is not allowed when dataset restrictions are in place

What it means

The SQL scanner found an INFORMATION_SCHEMA reference whose view name is not in the allow-list of dataset-level views while dataset restrictions are active — region/project-level metadata views could leak names of datasets outside the restriction.

Source

Thrown at internal/tools/bigquery/bigquerycommon/table_name_parser.go:249

				for _, part := range parts {
					if strings.EqualFold(part, "EXTERNAL_QUERY") {
						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")

View on GitHub (pinned to 8cc6e09de2)

Solutions

  1. Use a dataset-level INFORMATION_SCHEMA view (e.g. DATASET.TABLES) within an allowed dataset
  2. Remove INFORMATION_SCHEMA queries from restricted tools
  3. 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:249 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/6ed3fe68b9326fee. Report an issue: GitHub.