Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5a54d82

Browse filesBrowse files
fixing the imports for the prompts example (#318)
1 parent 805fb46 commit 5a54d82
Copy full SHA for 5a54d82

File tree

Expand file treeCollapse file tree

1 file changed

+6
-5
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-5
lines changed

‎README.md

Copy file name to clipboardExpand all lines: README.md
+6-5Lines changed: 6 additions & 5 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.