Description
When passing a compound filter expression as a single element in the args array to run_gcloud_command, the server appears to split the argument on spaces, causing gcloud to receive them as separate positional arguments.
Steps to Reproduce
Call run_gcloud_command with a gcloud logging read filter:
{
"args": [
"logging",
"read",
"resource.type=cloud_run_revision AND resource.labels.service_name=temporal-ui AND severity>=WARNING",
"--project=my-project",
"--limit=30",
"--format=json(timestamp,severity,textPayload,jsonPayload)"
]
}
Expected Behavior
The filter string should be passed as a single argument to gcloud, equivalent to:
gcloud logging read 'resource.type=cloud_run_revision AND resource.labels.service_name=temporal-ui AND severity>=WARNING' --project=my-project --limit=30 --format=json(...)
Actual Behavior
Error: UnrecognizedArgumentsError: unrecognized arguments:
AND
resource.labels.service_name=temporal-ui
severity>=WARNING (did you mean '--verbosity'?)
The AND and subsequent filter clauses are treated as separate arguments, indicating the single array element was split on spaces somewhere in the execution pipeline.
Environment
@google-cloud/gcloud-mcp v0.5.3
- Client: Claude Code (CLI)
- macOS, Node.js 22
Notes
This likely affects any gcloud subcommand that accepts a positional argument containing spaces (e.g., logging read FILTER, compute instances list --filter=EXPR). Commands with simple args like run services describe work correctly.
Possible cause: the gcloud meta lint-gcloud-commands validation step or the argument passing to child_process.spawn may be joining and re-splitting the args array.
Description
When passing a compound filter expression as a single element in the
argsarray torun_gcloud_command, the server appears to split the argument on spaces, causinggcloudto receive them as separate positional arguments.Steps to Reproduce
Call
run_gcloud_commandwith agcloud logging readfilter:{ "args": [ "logging", "read", "resource.type=cloud_run_revision AND resource.labels.service_name=temporal-ui AND severity>=WARNING", "--project=my-project", "--limit=30", "--format=json(timestamp,severity,textPayload,jsonPayload)" ] }Expected Behavior
The filter string should be passed as a single argument to
gcloud, equivalent to:Actual Behavior
The
ANDand subsequent filter clauses are treated as separate arguments, indicating the single array element was split on spaces somewhere in the execution pipeline.Environment
@google-cloud/gcloud-mcpv0.5.3Notes
This likely affects any
gcloudsubcommand that accepts a positional argument containing spaces (e.g.,logging read FILTER,compute instances list --filter=EXPR). Commands with simple args likerun services describework correctly.Possible cause: the
gcloud meta lint-gcloud-commandsvalidation step or the argument passing tochild_process.spawnmay be joining and re-splitting the args array.