Skip to content

Command linting appears to break SQL commands. #335

@lukaswelinder

Description

@lukaswelinder

Server

gcloud-mcp

What did you do?

Server: gcloud-mcp
Verson: 0.5.0
Using with: Cursor

Running spanner queries doesn't appear to work. I've tried the following:

{
  "args": [
    "spanner",
    "databases",
    "execute-sql",
    "my-db",
    "--instance=my-instance",
    "--project=my-project",
    "--format=json",
    "--sql=SELECT 1"
  ]
}

Trying different formatting/delimeters didn't work either:

// Wrapping in quotes
[
  "--sql=\"SELECT 1\""
]

// Splitting the flag/value
[
  "--sql",
  "SELECT 1"
]

What did you see happen?

Got a variety of error messages like the following:

UnrecognizedArgumentsError: unrecognized arguments: 1
To search the help text of gcloud commands, run:
gcloud help -- SEARCH_TERMS
STDERR:
ERROR: (gcloud.spanner.databases.execute-sql) INVALID_ARGUMENT: Syntax error: Unexpected string literal 
UnrecognizedArgumentsError: unrecognized arguments:
SELECT
1
To search the help text of gcloud commands, run:
gcloud help -- SEARCH_TERMS

From what I could tell debugging, the linting process splits the args on spaces or doubles up the quotes.

What did you expect to see?

I expected the results of the query.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions