Skip to content

Commit 5a54d82

Browse files
fixing the imports for the prompts example (modelcontextprotocol#318)
1 parent 805fb46 commit 5a54d82

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

README.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,8 @@ async def fetch_weather(city: str) -> str:
238238
Prompts are reusable templates that help LLMs interact with your server effectively:
239239

240240
```python
241-
from mcp.server.fastmcp import FastMCP, types
241+
from mcp.server.fastmcp import FastMCP
242+
from mcp.server.fastmcp.prompts import base
242243

243244
mcp = FastMCP("My App")
244245

@@ -249,11 +250,11 @@ def review_code(code: str) -> str:
249250

250251

251252
@mcp.prompt()
252-
def debug_error(error: str) -> list[types.Message]:
253+
def debug_error(error: str) -> list[base.Message]:
253254
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?"),
257258
]
258259
```
259260

0 commit comments

Comments
 (0)