File tree Expand file tree Collapse file tree 4 files changed +10
-10
lines changed
docs/content/docs/concepts/resources Expand file tree Collapse file tree 4 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 11import { Hono } from "hono" ;
2- import { registerResources , type Resource } from "muppet" ;
2+ import { registerResources } from "muppet" ;
33
44const app = new Hono ( ) ;
55
66app . post (
77 "/documents" ,
88 registerResources ( ( c ) => {
9- return c . json < Resource [ ] > ( [
9+ return [
1010 {
1111 type : "template" , // This tells muppet that this is a dynamic resource
1212 uri : "https://lorem.{value}" ,
@@ -16,6 +16,6 @@ app.post(
1616 return [ "muppet" , "hono" , "mcps" ] ;
1717 } ,
1818 } ,
19- ] ) ;
19+ ] ;
2020 } ) ,
2121) ;
Original file line number Diff line number Diff line change 11import { Hono } from "hono" ;
2- import { registerResources , type Resource } from "muppet" ;
2+ import { registerResources } from "muppet" ;
33
44const app = new Hono ( ) ;
55
66app . post (
77 "/documents" ,
88 registerResources ( ( c ) => {
9- return c . json < Resource [ ] > ( [
9+ return [
1010 {
1111 type : "template" , // This tells muppet that this is a dynamic resource
1212 uri : "https://lorem.{ending}" ,
1313 name : "Todo list" ,
1414 mimeType : "text/plain" ,
1515 } ,
16- ] ) ;
16+ ] ;
1717 } ) ,
1818) ;
Original file line number Diff line number Diff line change 11import { Hono } from "hono" ;
2- import { registerResources , type Resource } from "muppet" ;
2+ import { registerResources } from "muppet" ;
33
44const app = new Hono ( ) ;
55
66app . post (
77 "/documents" ,
88 registerResources ( ( c ) => {
9- return c . json < Resource [ ] > ( [
9+ return [
1010 {
1111 uri : "https://lorem.ipsum" ,
1212 name : "Todo list" ,
1313 mimeType : "text/plain" ,
1414 } ,
15- ] ) ;
15+ ] ;
1616 } ) ,
1717) ;
Original file line number Diff line number Diff line change @@ -231,7 +231,7 @@ export function createMuppetServer<
231231 throw new Error ( `Unable to find the handler for ${ protocol } protocol!` ) ;
232232 }
233233
234- const contents = handler ( params . uri ) ;
234+ const contents = await handler ( params . uri ) ;
235235
236236 if ( Array . isArray ( contents ) )
237237 return c . json ( {
You can’t perform that action at this time.
0 commit comments