File tree 1 file changed +6
-5
lines changed
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -238,7 +238,8 @@ async def fetch_weather(city: str) -> str:
238
238
Prompts are reusable templates that help LLMs interact with your server effectively:
239
239
240
240
``` python
241
- from mcp.server.fastmcp import FastMCP, types
241
+ from mcp.server.fastmcp import FastMCP
242
+ from mcp.server.fastmcp.prompts import base
242
243
243
244
mcp = FastMCP(" My App" )
244
245
@@ -249,11 +250,11 @@ def review_code(code: str) -> str:
249
250
250
251
251
252
@mcp.prompt ()
252
- def debug_error (error : str ) -> list[types .Message]:
253
+ def debug_error (error : str ) -> list[base .Message]:
253
254
return [
254
- types .UserMessage(" I'm seeing this error:" ),
255
- types .UserMessage(error),
256
- types .AssistantMessage(" I'll help debug that. What have you tried so far?" ),
255
+ base .UserMessage(" I'm seeing this error:" ),
256
+ base .UserMessage(error),
257
+ base .AssistantMessage(" I'll help debug that. What have you tried so far?" ),
257
258
]
258
259
```
259
260
You can’t perform that action at this time.
0 commit comments