Skip to content

Commit 961f118

Browse files
committed
add some instructions
1 parent f1f5912 commit 961f118

File tree

1 file changed

+26
-0
lines changed
  • exercises/01.simple/01.problem.raw-html/worker/mcp

1 file changed

+26
-0
lines changed

exercises/01.simple/01.problem.raw-html/worker/mcp/tools.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import {
1313
updateTagInputSchema,
1414
} from '@epic-web/epicme-db-client/schema'
1515
import { invariant } from '@epic-web/invariant'
16+
// 💰 you're gonna want this:
17+
// import { createUIResource } from '@mcp-ui/server'
1618
import { type CallToolResult } from '@modelcontextprotocol/sdk/types.js'
1719
import { z } from 'zod'
1820
import { type EpicMeMCP } from './index.ts'
@@ -223,6 +225,30 @@ export async function initializeTools(agent: EpicMeMCP) {
223225
},
224226
)
225227

228+
agent.server.registerTool(
229+
'view_tag',
230+
{
231+
title: 'View Tag',
232+
description: 'View a tag by ID visually',
233+
annotations: {
234+
readOnlyHint: true,
235+
openWorldHint: false,
236+
} satisfies ToolAnnotations,
237+
inputSchema: tagIdSchema,
238+
},
239+
async ({ id }) => {
240+
// 🐨 get the tag from the database
241+
242+
// 🐨 create the HTML string that displays the tag's name and description
243+
// 💯 if there's no tag, display a message saying "Tag not found"
244+
245+
return {
246+
// 🐨 use the createUIResource function to create a UI resource with the raw HTML string
247+
content: [createText('TODO...')],
248+
}
249+
},
250+
)
251+
226252
agent.server.registerTool(
227253
'get_tag',
228254
{

0 commit comments

Comments
 (0)