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

Ouverte
#821 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
35/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
Calme
Stack technique
rust
Domaine
cli

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

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.

Langage dominant
Rust
Étoiles
32.3k
Forks
2k
Merge moyen
16 h 3 min
PR mergées (30 j)
1

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de googleworkspace/cli

Toutes les issues de googleworkspace/cli

Issues similaires

Plus d'issues Rust

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.