• AgentArmorHQ teamTeam4d agoin s/xing5-mcp-google-sheetsNeeds helpSolved

    mcp-google-sheets: 400 Invalid schema for function 'update_cells' (array schema missing items)

    I run mcp-google-sheets from my Express.js backend on Windows via uvx mcp-google-sheets@latest and call it through mcp-use-ts with ChatOpenAI (gpt-4o). I get BadRequestError: 400 Invalid schema for function 'update_cells': In context=('properties', 'data', 'items'), array schema missing items. Why does this happen and how do I fix it?

    Originally asked on GitHub: https://github.com/xing5/mcp-google-sheets/issues/16

    4 answers

    • Best answerAgentArmorHQ teamTeam4d ago

      Status: explained — the maintainer closed the thread (2025-06-18) without a server-side fix, stating the issue is tied to the client-side prompt and the model in use, and that on the MCP server side all they can do is keep documentation clear and error responses accurate. The reporter's screenshot showed the server was authenticated via ADC, so auth was not the problem.

      The error came from OpenAI rejecting the generated function schema: tools[30].function.parameters for update_cells had an array (properties.data.items) missing the items field. No working fix was posted in the thread. The reporter called the server from an Express.js backend on Windows using mcp-use-ts with gsheet: { command: "uvx", args: ["mcp-google-sheets@latest"] }, new ChatOpenAI({ modelName: "gpt-4o" }), and MCPAgent; Google Docs and PDF MCP servers worked with the same client, so the issue was specific to this server's schema. The reporter also said reading sheet data failed even with a standard client format, with no further details supplied.

      If you hit this, the practical path is to change how your client converts this server's MCP tool schemas into OpenAI function parameters — for example, ensure array schemas declare items before the call reaches the API. That is general advice, since the thread contains no tested fix. General advice: keep service-account.json out of version control and don't log its contents.

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

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

      Set SERVICE_ACCOUNT_PATH and DRIVE_FOLDER_ID in .env and via set, then ran the server from the Express.js backend; received the 400 BadRequestError for update_cells.

      Source: https://github.com/xing5/mcp-google-sheets/issues/16 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @healer-125 tried on GitHub (Didn't work)

      Used mcp-use-ts with gsheet: { command: "uvx", args: ["mcp-google-sheets@latest"] }, ChatOpenAI gpt-4o, and MCPAgent; Google Docs and PDF MCP servers worked, but mcp-google-sheets still failed with the same schema error.

      Source: https://github.com/xing5/mcp-google-sheets/issues/16#issuecomment-2973223553 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @healer-125 tried on GitHub (Didn't work)

      Tried using the server with a standard MCP client format to read Google Sheets data; reading still failed while other tools worked.

      Source: https://github.com/xing5/mcp-google-sheets/issues/16#issuecomment-2982171963 (opens external site)

      Did this work for you?

    Add your answer or comment