mirror of
https://github.com/langchain-ai/langchainjs-mcp-adapters.git
synced 2026-07-01 12:27:48 -04:00
[BUG] Can't load external tools due to missing schemas #20
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kikoncuo on GitHub (Apr 1, 2025).
Bug Description
When using tools built following the instructions everything works as expected, but when I want to use an NPM tool from a third party the schemas are not being parsed correctly.
Reproduction Steps
Import any external server. IE:
https://www.npmjs.com/package/time-mcp
IE:
Expected Behavior
Schemas to be loaded properly like when other tools load the servers IE:
See cline example:
Actual Behavior
Schemas are broken and LLMs don't know how to call the tools
Environment
Additional Context
Add any other context about the problem here, such as:
Possible Solution
Review how the tools are loaded and how the schemas are parsed. I'll give it a go if someone can confirm
@kikoncuo commented on GitHub (Apr 2, 2025):
I can confirm the python version works as expected using that same MCP server
@benjamincburns commented on GitHub (Apr 3, 2025):
This appears to be a bug in the library that we're using to convert from JSONSchema to zod schema. I've created an issue in that project regarding this.
https://github.com/dmitryrechkin/json-schema-to-zod/issues/3
@benjamincburns commented on GitHub (Apr 7, 2025):
The
json-schema-to-zodpackage was always kind of an ugly hack. The better approach is to make it so LangChainJS can work directly w/ JSONSchema. With any luck I'm hoping to get this merged tomorrow: https://github.com/langchain-ai/langchainjs/pull/7973@benjamincburns commented on GitHub (Apr 9, 2025):
Hi @kikoncuo please try v0.4.1. It should work much better now 😄