googleapis / googleapis/gcloud-mcp
Invalid input: expected record, received array
- Dominant language
- TypeScript
- Stars
- 904
- Forks
- 83
- PR merge metrics
- No merged PRs in 30d
Description
### Server
observability-mcp
### What did you do?
When using `@google-cloud/observability-mcp@latest` with Gemini CLI, certain tool calls (e.g. `list_metric_descriptors`, `list_log_entries`, etc.) are giving below error
{
"error": "MCP tool 'list_metric_descriptors' reported tool error for function call: {\"name\":\"list_metric_descriptors\",\"args\":{\"name\":\"projects/project-xyz\"}}
with response: [{\"functionResponse\":{\"name\":\"list_metric_descriptors\",\"response\":{\"error\":{\"message\":\"[\\n {\\n \\\"expected\\\": \\\"record\\\",\\n
\\\"code\\\": \\\"invalid_type\\\",\\n \\\"path\\\": [\\n \\\"structuredContent\\\"\\n ],\\n \\\"message\\\": \\\"Invalid input: expected record, received
array\\\"\\n }\\n]\",\"isError\":true}}}}]"
}
### What did you see happen?
{
"error": "MCP tool 'list_metric_descriptors' reported tool error for function call: {\"name\":\"list_metric_descriptors\",\"args\":{\"name\":\"projects/project-xyz\"}}
with response: [{\"functionResponse\":{\"name\":\"list_metric_descriptors\",\"response\":{\"error\":{\"message\":\"[\\n {\\n \\\"expected\\\": \\\"record\\\",\\n
\\\"code\\\": \\\"invalid_type\\\",\\n \\\"path\\\": [\\n \\\"structuredContent\\\"\\n ],\\n \\\"message\\\": \\\"Invalid input: expected record, received
array\\\"\\n }\\n]\",\"isError\":true}}}}]"
}
### What did you expect to see?
It should be able to accept the returned content in the given format
Contributor guide
Research direction
Reproduce the issue with observability-mcp using Gemini CLI and the list_metric_descriptors or list_log_entries tool calls shown in the report. Trace how the returned structuredContent is shaped, then verify that the documented array response is accepted without the invalid-type error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend-api-design
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100