gws 0.6.0: drafts.create rejects valid --params with 'expected a map'; works in 0.15.0+

Open
#821 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
rust
Domain
cli

Research direction

Start by comparing the parameter handling for gmail users drafts create between @googleworkspace/cli 0.6.0 and 0.15.0, using the reproduction commands in the issue. Check whether the behavior is already fixed in the newer release; done means documenting the fix or deciding whether a backport or upgrade-only resolution is appropriate.

Written by the indexing model from the issue text.

Description

Bug Description

In gws 0.6.0, calling gmail users drafts create via the MCP server (or CLI) rejects any --params JSON shape with:

Invalid --params JSON: invalid type: string "{\"userId\":\"me\"}", expected a map at line 1 column 21

The identical params shape works fine for other Gmail endpoints in the same version — messages.list, messages.get, threads.get all accept --params '{"userId":"me", ...}' without issue. Only drafts.create rejects it.

When the call comes from an MCP wrapper (Claude Code's tool-use bridge), the error also surfaces as Request body failed schema validation: $: Expected object when --params is omitted entirely, suggesting the params parser is required and is parsing the value as a string instead of deserializing it as a map.

Repro

npm install -g @googleworkspace/[email protected]
gws gmail users drafts create --params '{"userId":"me"}' --json '{"message":{"raw":"<base64url-mime>"}}'
# → Invalid --params JSON: invalid type: string ..., expected a map

Same params shape works fine on other endpoints:

gws gmail users messages list --params '{"userId":"me","q":"in:inbox","maxResults":5}'
# → works

Status in newer versions

Verified on @googleworkspace/[email protected] (the highest version that still runs on Ubuntu 22.04 / GLIBC 2.35 — 0.22.x requires GLIBC 2.39): the same call passes --params deserialization and progresses to the auth layer (where it then fails because 0.15.0 cannot read 0.6.0's encrypted token cache, an unrelated migration concern).

So the bug is fixed somewhere between 0.6.0 and 0.15.0. This issue is mostly a paper trail / upgrade prompt for anyone still pinned to 0.6.0.

Environment

  • @googleworkspace/[email protected] (installed via npm install -g)
  • Ubuntu 22.04 / GLIBC 2.35 / Node v20.19.5
  • Used as the MCP server in Claude Code (gws mcp -s drive,gmail,calendar)

Suggested resolution

If 0.6.0 is no longer supported: close as "upgrade to >= 0.15.0". Otherwise a backport could be considered, though the GLIBC requirement bump in newer versions (0.16+ → GLIBC 2.39) is a separate migration blocker for users on older distros.

— Filed via Claude Code during a paralegal-onboarding outreach session where the drafts_create MCP tool was the last remaining manual step in an otherwise automated pipeline.

Dominant language
Rust
Stars
32.3k
Forks
2k
Avg merge
16h 3m
Merged PRs (30d)
1

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from googleworkspace/cli

All issues in googleworkspace/cli

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.