mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-04 10:24:02 +00:00
fix: also name a tool's UI resource with the flat ui/resourceUri key
Some MCP Apps hosts read the earlier flat _meta key; the MCP Apps SDK sends it alongside _meta.ui.resourceUri, and so does the adapter now.
This commit is contained in:
1 parent
5775eb9053
commit
ba751d9433
2 files changed
+9
-1
No files matched your search
@@ -233,6 +233,7 @@ test('resources are listed and read, and tools name their UI resource', async ()
|
||||
});
|
||||
assert.deepEqual((await call('tools/list')).tools[0]._meta, {
|
||||
ui: { resourceUri: 'ui://fixture/view' },
|
||||
'ui/resourceUri': 'ui://fixture/view',
|
||||
});
|
||||
assert.deepEqual((await call('resources/list')).resources, [
|
||||
{
|
||||
|
||||
@@ -40,7 +40,14 @@ export function toMcpTools(catalog, { descriptions = {}, decorate } = {}) {
|
||||
inputSchema: tool.inputSchema,
|
||||
annotations: { title, ...tool.annotations },
|
||||
...(tool.ui
|
||||
? { _meta: { ui: { resourceUri: tool.ui.resourceUri } } }
|
||||
? {
|
||||
// The flat key is the earlier form of the same field, which some
|
||||
// hosts still read; the MCP Apps SDK sends both.
|
||||
_meta: {
|
||||
ui: { resourceUri: tool.ui.resourceUri },
|
||||
'ui/resourceUri': tool.ui.resourceUri,
|
||||
},
|
||||
}
|
||||
: {}),
|
||||
};
|
||||
return decorate
|
||||
|
||||
Reference in new issue
Block a user