This repository was archived by the owner on May 21, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,7 +31,9 @@ server.tool({
3131 } ,
3232 encoding : 'text' ,
3333 } )
34- return uiResource
34+ return {
35+ content : [ uiResource ]
36+ }
3537 } ,
3638} )
3739
@@ -55,6 +57,7 @@ server.resource({
5557 } ,
5658} )
5759
60+
5861// MCP Resource for Kanban Board widget
5962server . resource ( {
6063 uri : 'ui://widget/kanban-board' ,
@@ -116,10 +119,24 @@ server.tool({
116119 const { tasks } = params
117120 try {
118121 const taskData = JSON . parse ( tasks )
119- return `Displayed Kanban board with ${ taskData . length || 0 } tasks at http://localhost:${ PORT } /mcp-use/widgets/kanban-board`
122+ return {
123+ content : [
124+ {
125+ type : 'text' ,
126+ text : `Displayed Kanban board with ${ taskData . length || 0 } tasks at http://localhost:${ PORT } /mcp-use/widgets/kanban-board`
127+ }
128+ ]
129+ }
120130 }
121131 catch ( error ) {
122- return `Error parsing tasks: ${ error instanceof Error ? error . message : 'Invalid JSON' } `
132+ return {
133+ content : [
134+ {
135+ type : 'text' ,
136+ text : `Error parsing tasks: ${ error instanceof Error ? error . message : 'Invalid JSON' } `
137+ }
138+ ]
139+ }
123140 }
124141 } ,
125142} )
@@ -140,10 +157,24 @@ server.tool({
140157 const { todos } = params
141158 try {
142159 const todoData = JSON . parse ( todos )
143- return `Displayed Todo list with ${ todoData . length || 0 } items at http://localhost:${ PORT } /mcp-use/widgets/todo-list`
160+ return {
161+ content : [
162+ {
163+ type : 'text' ,
164+ text : `Displayed Todo list with ${ todoData . length || 0 } items at http://localhost:${ PORT } /mcp-use/widgets/todo-list`
165+ }
166+ ]
167+ }
144168 }
145169 catch ( error ) {
146- return `Error parsing todos: ${ error instanceof Error ? error . message : 'Invalid JSON' } `
170+ return {
171+ content : [
172+ {
173+ type : 'text' ,
174+ text : `Error parsing todos: ${ error instanceof Error ? error . message : 'Invalid JSON' } `
175+ }
176+ ]
177+ }
147178 }
148179 } ,
149180} )
You can’t perform that action at this time.
0 commit comments