Description
When calling MCP tools that have a top-level parameter named body of type object, opencode passes the value as a JSON string instead of a native object. The MCP tool's input validation then fails with:
MCP error -32602: Input validation error: Invalid arguments for tool send-mail: [
{
"code": "invalid_type",
"expected": "object",
"received": "string",
"path": ["body"],
"message": "Expected object, received string"
}
]
This affects all write tools in @softeria/ms-365-mcp-server where the only required parameter is body: object (e.g. send-mail, create-draft-email, create-calendar-event, send-chat-message). Read-only tools with simple scalar parameters (e.g. list-mail-messages, verify-login) work correctly.
Plugins
@softeria/ms-365-mcp-server (latest, type: local / stdio)
OpenCode version
1.15.5
Steps to reproduce
- Add
@softeria/ms-365-mcp-server as a local MCP in opencode.jsonc
- Login with
ms365_login
- Ask the assistant to send an email: "send a test email to myself"
- The tool
ms365_send-mail is called — fails with Expected object, received string on the body parameter
Any MCP tool with a single required parameter of type object named body will reproduce this.
Operating System
Ubuntu 22.04
Terminal
Warp
Description
When calling MCP tools that have a top-level parameter named
bodyof typeobject, opencode passes the value as a JSON string instead of a native object. The MCP tool's input validation then fails with:This affects all write tools in
@softeria/ms-365-mcp-serverwhere the only required parameter isbody: object(e.g.send-mail,create-draft-email,create-calendar-event,send-chat-message). Read-only tools with simple scalar parameters (e.g.list-mail-messages,verify-login) work correctly.Plugins
@softeria/ms-365-mcp-server(latest, type:local/ stdio)OpenCode version
1.15.5Steps to reproduce
@softeria/ms-365-mcp-serveras a local MCP inopencode.jsoncms365_loginms365_send-mailis called — fails withExpected object, received stringon thebodyparameterAny MCP tool with a single required parameter of type
objectnamedbodywill reproduce this.Operating System
Ubuntu 22.04
Terminal
Warp