File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
01.advanced-tools/02.problem.structured/src
05.changes/02.problem.resources-list-changed/src Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -384,6 +384,7 @@ export async function initializeTools(agent: EpicMeMCP) {
384384 'If set to > 0, use mock mode and this is the mock wait time in milliseconds' ,
385385 ) ,
386386 } ,
387+ // 🐨 add an outputSchema here with a video that is a videoSchema
387388 } ,
388389 async ( { year = new Date ( ) . getFullYear ( ) , mockTime } ) => {
389390 const entries = await agent . db . getEntries ( )
@@ -460,6 +461,9 @@ function createTagResourceLink(tag: {
460461 }
461462}
462463
464+ // 💣 we now use structuredContent to return the contents of the resources with
465+ // resource links to share the URIs. Feel free to delete the embedded resource
466+ // utilities below.
463467type ResourceContent = CallToolResult [ 'content' ] [ number ]
464468
465469function createEntryEmbeddedResource ( entry : { id : number } ) : ResourceContent {
Original file line number Diff line number Diff line change 11import { invariant } from '@epic-web/invariant'
22import { ResourceTemplate } from '@modelcontextprotocol/sdk/server/mcp.js'
33import { type EpicMeMCP } from './index.ts'
4- import { getVideoBase64 , listVideos } from './video.ts'
4+ import {
5+ getVideoBase64 ,
6+ listVideos ,
7+ // 💰 you'll need this:
8+ // subscribe as subscribeToVideoChanges,
9+ } from './video.ts'
510
611export async function initializeResources ( agent : EpicMeMCP ) {
12+ // 🐨 add a subscription to the database (💰 with agent.db.subscribe) that
13+ // passes a callback which calls agent.server.sendResourceListChanged.
14+
15+ // 🐨 add a subscription to the videos (💰 with subscribeToVideoChanges) that
16+ // passes a callback which calls agent.server.sendResourceListChanged.
17+
718 const tagListResource = agent . server . registerResource (
819 'tags' ,
920 'epicme://tags' ,
You can’t perform that action at this time.
0 commit comments