Cannot resolve module for createTool with "moduleResolution": "NodeNext"
Closed this issue · 0 comments
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
1.
Expected behavior
A clear and concise description of what you expected to happen.
Logs
If applicable, add logs to help explain your problem.
Additional context
Add any other context about the problem here.
Hello,
I am having trouble importing createTool and its related types from @modelcontextprotocol/sdk version 1.18.1 when using "type": "module" in package.json and "module": "NodeNext", "moduleResolution": "NodeNext" in my tsconfig.json.
I have tried various import paths like:
@modelcontextprotocol/sdk@modelcontextprotocol/sdk/tool@modelcontextprotocol/sdk/tool/index.js@modelcontextprotocol/sdk/types@modelcontextprotocol/sdk/types.js
None of these seem to work, and I always get a "Cannot find module" or "Module has no exported member" error.
Could you please provide the correct way to import createTool, Tool, and ToolDefinition with this configuration?
Thank you!