genkit icon indicating copy to clipboard operation
genkit copied to clipboard

Need to include mcp tools in .generate() call

Open ehelbig1 opened this issue 8 months ago • 1 comments

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] The tools exposed by the MCP server appear to be registered in the genkit registry correctly but specific tools still need to be added to each .generate() call on the genkit instance and there's currently no way to access the names of the exposed tools.

Describe the solution you'd like A clear and concise description of what you want to happen. Manually supplying the tool name, a combination of the mcpClient name / tool name, works, but isn't ideal. It would be great if there was a way to directly add the mcpClient to the .generate() method.

ehelbig1 avatar Apr 07 '25 20:04 ehelbig1

cc @apascal07 @pavelgj

chrisraygill avatar Apr 17 '25 22:04 chrisraygill

the way I'm thinking this could be done is doing something like:

await ai.generate({
  prompt: ...,
  tools: 'all'
})

or perhaps it can take a regex:

await ai.generate({
  prompt: ...,
  tools: 'mcp/.*'
})

pavelgj avatar Apr 19 '25 14:04 pavelgj