You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @benjamincburns, I traced the issue to _convertToolToMistralTool(), where tool.schema is passed into zodToJsonSchema. It looks like tool.schema is already a valid JSON Schema object in this case, so wrapping it again causes problems.
``function _convertToolToMistralTool(
tools: ChatMistralAIToolType[]
): MistralAITool[] {
return tools.map((tool) => {
if ("function" in tool) {
return tool as MistralAITool;
}
I’m thinking a simple type check or schema format check could prevent zodToJsonSchema from being applied unnecessarily.
Just wanted to confirm: is the schema always expected to be a Zod schema here, or do we need to support both Zod and pre-defined JSON Schemas?
Happy to open a PR if this is the right direction. Just want to make sure I understand the intention first. 🙏
@marvikomo We'd love to have a PR for this, thanks for volunteering! We would want it to support both, yeah. You can look to other popular providers (e.g. ChatOpenAI, ChatAnthropic) to see how it's done there. Should be fairly straightforward to support
Privileged issue
Issue Content
Blocks use of MCP tools with
ChatMistralAI
- see langchain-ai/langchainjs-mcp-adapters#77The text was updated successfully, but these errors were encountered: