File tree Expand file tree Collapse file tree 2 files changed +11
-15
lines changed
Expand file tree Collapse file tree 2 files changed +11
-15
lines changed Original file line number Diff line number Diff line change 1- // 💰 you'll use this to get the username of the creator of the app
2- // import { userInfo } from 'node:os'
31import { type EpicMeMCP } from './index.ts'
42
53export async function initializeResources ( agent : EpicMeMCP ) {
6- // 🐨 create a resource called "credits" with the URI epicme://credits
7- // this tool will return a string with the credits for the creators of the app
8- // so set the description to explain that
4+ // 🐨 create a resource called "tags" with the URI epicme://tags
5+ // this tool will return all the tags from the database. Write a description for that.
96 // 🐨 the handler accepts the uri and returns the contents array which should
10- // have an object with mimeType text/plain , text, and uri
11- // 💰 You can use this for the text:
12- // `This app was created by ${userInfo().username} `
7+ // have an object with mimeType application/json , text, and uri
8+ // 💰 You can use this to get the tags
9+ // `await agent.db.getTags() `
1310}
Original file line number Diff line number Diff line change @@ -3,17 +3,16 @@ import { type EpicMeMCP } from './index.ts'
33
44export async function initializeResources ( agent : EpicMeMCP ) {
55 agent . server . resource (
6- 'credits' ,
7- 'epicme://credits' ,
8- {
9- description : 'Credits for the creators of the app' ,
10- } ,
6+ 'tags' ,
7+ 'epicme://tags' ,
8+ { description : 'All tags' } ,
119 async ( uri ) => {
10+ const tags = await agent . db . getTags ( )
1211 return {
1312 contents : [
1413 {
15- mimeType : 'text/plain ' ,
16- text : `This app was created by ${ userInfo ( ) . username } ` ,
14+ mimeType : 'application/json ' ,
15+ text : JSON . stringify ( tags ) ,
1716 uri : uri . toString ( ) ,
1817 } ,
1918 ] ,
You can’t perform that action at this time.
0 commit comments