-
Notifications
You must be signed in to change notification settings - Fork 191
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Hi there!
It seems from the doc that you have to define upfront what component your tool will return like
server.registerTool(
"get_zoo_animals",
{
title: "get_zoo_animals",
description: "Lists zoo animals and facts about them",
inputSchema: { count: z.number().int().min(1).max(20).optional() },
annotations: {
readOnlyHint: true,
},
_meta: {
"openai/outputTemplate": "ui://widget/widget.html",
},
},
async ({ count = 10 }, _extra) => {
const animals = generateZooAnimals(count);
return {
content: [],
structuredContent: { animals },
};
}
);
But in our use case we would like to be able to decide at runtime which component this tool should return. Is this possible at all currently?
Something like
server.registerTool(
"get_zoo_animals",
{
title: "get_zoo_animals",
description: "Lists zoo animals and facts about them",
inputSchema: { count: z.number().int().min(1).max(20).optional() },
annotations: {
readOnlyHint: true,
},
},
async ({ count = 10 }, _extra) => {
const animals = generateZooAnimals(count);
return {
content: [],
structuredContent: { animals },
_meta: {
"openai/outputTemplate": "ui://widget/widget.html",
},
};
}
);
rinormaloku
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request