{"record":{"id":"53cc237698c0c4c8","repo":"googleapis/mcp-toolbox","slug":"invalid-source-for-q-tool-source-q-is-not-a-com-53cc23","errorCode":null,"errorMessage":"invalid source for %q tool: source %q is not a compatible type","messagePattern":"invalid source for %q tool: source %q is not a compatible type","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/tools/cloudsql/cloudsqlrestorebackup/cloudsqlrestorebackup.go","lineNumber":104,"sourceCode":"func buildParams(project string) parameters.Parameters {\n\tprojectParam := parameters.NewStringParameter(\"target_project\", \"The project ID\")\n\tif project != \"\" {\n\t\tprojectParam = parameters.NewStringParameter(\"target_project\", \"The GCP project ID. This is pre-configured; do not ask for it unless the user explicitly provides a different one.\", parameters.WithStringDefault(project))\n\t}\n\treturn parameters.Parameters{\n\t\tprojectParam,\n\t\tparameters.NewStringParameter(\"target_instance\", \"Cloud SQL instance ID of the target instance. This does not include the project ID.\"),\n\t\tparameters.NewStringParameter(\"backup_id\", \"Identifier of the backup being restored. Can be a BackupRun ID, backup name, or BackupDR backup name. Use the full backup ID as provided, do not try to parse it\"),\n\t\tparameters.NewStringParameter(\"source_project\", \"GCP project ID of the instance that the backup belongs to. Only required if the backup_id is a BackupRun ID.\", parameters.WithStringRequired(false)),\n\t\tparameters.NewStringParameter(\"source_instance\", \"Cloud SQL instance ID of the instance that the backup belongs to. Only required if the backup_id is a BackupRun ID.\", parameters.WithStringRequired(false)),\n\t}\n}\n\n// resolveParams builds the tool's parameters using the source's configured default GCP project.\nfunc (t Tool) resolveParams(source sources.Source) (parameters.Parameters, error) {\n\ts, ok := source.(compatibleSource)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"invalid source for %q tool: source %q is not a compatible type\", t.Cfg.Type, t.Cfg.Source)\n\t}\n\treturn buildParams(s.GetDefaultProject()), nil\n}\n\n// GetParameters returns the tool's parameters, resolved against the source.\nfunc (t Tool) GetParameters(source sources.Source) (parameters.Parameters, error) {\n\treturn t.resolveParams(source)\n}\n\n// Manifest returns the tool's manifest, resolved against the source.\nfunc (t Tool) Manifest(source sources.Source) (tools.Manifest, error) {\n\tallParameters, err := t.resolveParams(source)\n\tif err != nil {\n\t\treturn tools.Manifest{}, err\n\t}\n\treturn tools.Manifest{Description: t.Cfg.Description, Parameters: allParameters.Manifest(), AuthRequired: t.Cfg.AuthRequired}, nil\n}\n","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/cloudsql/cloudsqlrestorebackup/cloudsqlrestorebackup.go#L86-L122","documentation":"The restore-backup tool's ValidateSource guard rejected the configured source because it does not implement compatibleSource — the tool is bound in tools.yaml to a source that is not a Cloud SQL source of the expected kind.","triggerScenarios":"Thrown at internal/tools/cloudsql/cloudsqlrestorebackup/cloudsqlrestorebackup.go:104 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Point the tool's `source` at a compatible Cloud SQL source","Check the source name for typos","Verify the source `type` matches what this tool requires"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8cc6e09de2ad7b8bffc77751799585a1401a48eb","analyzedAt":"2026-09-05T01:10:36.887Z","contentChangedAt":"2026-09-05T01:10:36.887Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}