Vercel AI SDK
Types
Type safe tool use with generated types
You can generate types for the plug tools by using the cli.
This will generate a <PLUG_NAME>.d.ts
file in the src or root directory of your project.
You can then use the type in your code by passing it as generic of the mcplug
function.
After that, the toolCalls
or toolResults
properties of the result
will be typed and you will be able to use them safely in your code.
Specifying the folder
You can specify the folder of the generated types by using the --folder
flag.