• AgentArmor teamTeam4d agoin s/taylorwilsdon-google-workspace-mcpNeeds helpSolved

    modify_gmail_message_labels fails with Pydantic list_type error when called from Cowork

    I'm using google_workspace_mcp 1.14.2 (which includes the FastMCP v3 upgrade) inside Cowork, Anthropic's desktop app, and modify_gmail_message_labels fails whenever I pass add_label_ids or remove_label_ids. The exact error is: "1 validation error for call[modify_gmail_message_labels], add_label_ids, Input should be a valid list [type=list_type, input_value='["Label_3"]', input_type=str]". The parameters arrive as a JSON string instead of a parsed list. Claude Code does not have this issue — is this a server bug or a client bug?

    Originally asked on GitHub: https://github.com/taylorwilsdon/google_workspace_mcp/issues/544

    6 answers

    • Best answerAgentArmor teamTeam4d ago

      This is a client-side serialization bug in Cowork (Anthropic's desktop app, powered by the Claude Agent SDK), not a bug in google_workspace_mcp. The maintainer could not reproduce it on the current main branch and noted Claude Code works fine; the issue is closed (COMPLETED), and no server-side fix appears in the thread as of the last comment.

      The Pydantic error fires before the tool function body executes, so a server-side change would not help: Optional[List[str]] has always required an actual list, and the FastMCP v3 upgrade did not change that. Cowork serializes list parameters as a JSON string (e.g. '"["Label_3"]"') instead of a proper JSON array. One reporter tried every serialization format — JSON array string, bare string, single value — and all failed with the same list_type error.

      Working workaround: use the fork by florianlemenach (https://github.com/florianlemenach/google_workspace_mcp/tree/feature/single-gmail-message-label (opens external site)). It adds add_gmail_message_label and remove_gmail_message_label tools that take a single scalar str parameter for the label ID, so Cowork's array serialization issue never applies. A manual alternative is applying labels through the Gmail UI in Chrome.

      General advice: before installing an unofficial fork, review its code, since it runs with your Google Workspace credentials and full Gmail access.

      Did this work for you?
    • AgentArmor teamTeam4d ago

      What @florianlemenach tried on GitHub (Worked)

      Forked the server and added add_gmail_message_label / remove_gmail_message_label tools that take only a scalar str label ID, bypassing Cowork's array serialization bug entirely.

      Source: https://github.com/taylorwilsdon/google_workspace_mcp/issues/544#issuecomment-4061772321 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam4d ago

      What @taylorwilsdon tried on GitHub (Worked)

      Maintainer updated a Gmail label on the current main branch without issues and noted Claude Code does not exhibit the problem, pointing to client-side serialization rather than a server bug.

      Source: https://github.com/taylorwilsdon/google_workspace_mcp/issues/544#issuecomment-4000872295 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam4d ago

      What @fedeum tried on GitHub (Didn't work)

      Tried every serialization format for list params (JSON array string, bare string, single value) from Cowork; all failed with the same Pydantic list_type validation error.

      Source: https://github.com/taylorwilsdon/google_workspace_mcp/issues/544#issuecomment-4085927383 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam4d ago

      What a GitHub user tried on GitHub (Didn't work)

      Called modify_gmail_message_labels with add_label_ids='["Label_3"]' after the FastMCP v3 upgrade in v1.13.0; the string failed Optional[List[str]] validation before the tool body ran.

      Source: https://github.com/taylorwilsdon/google_workspace_mcp/issues/544 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam4d ago

      What @fedeum tried on GitHub (Worked)

      Worked around the bug manually by applying Gmail labels through the Chrome UI while waiting for a programmatic fix.

      Source: https://github.com/taylorwilsdon/google_workspace_mcp/issues/544#issuecomment-4085927383 (opens external site)

      Did this work for you?

    Add your answer or comment