@@ -235,6 +235,7 @@ def get_settings() -> str:
235235 "debug": false
236236}"""
237237```
238+
238239_ Full example: [ examples/snippets/servers/basic_resource.py] ( https://github.com/modelcontextprotocol/python-sdk/blob/main/examples/snippets/servers/basic_resource.py ) _
239240<!-- /snippet-source -->
240241
@@ -261,6 +262,7 @@ def get_weather(city: str, unit: str = "celsius") -> str:
261262 # This would normally call a weather API
262263 return f " Weather in { city} : 22degrees { unit[0 ].upper()} "
263264```
265+
264266_ Full example: [ examples/snippets/servers/basic_tool.py] ( https://github.com/modelcontextprotocol/python-sdk/blob/main/examples/snippets/servers/basic_tool.py ) _
265267<!-- /snippet-source -->
266268
@@ -411,6 +413,7 @@ def debug_error(error: str) -> list[base.Message]:
411413 base.AssistantMessage(" I'll help debug that. What have you tried so far?" ),
412414 ]
413415```
416+
414417_ Full example: [ examples/snippets/servers/basic_prompt.py] ( https://github.com/modelcontextprotocol/python-sdk/blob/main/examples/snippets/servers/basic_prompt.py ) _
415418<!-- /snippet-source -->
416419
@@ -460,6 +463,7 @@ async def long_running_task(task_name: str, ctx: Context, steps: int = 5) -> str
460463
461464 return f " Task ' { task_name} ' completed "
462465```
466+
463467_ Full example: [ examples/snippets/servers/tool_progress.py] ( https://github.com/modelcontextprotocol/python-sdk/blob/main/examples/snippets/servers/tool_progress.py ) _
464468<!-- /snippet-source -->
465469
@@ -547,6 +551,7 @@ async def handle_completion(
547551
548552 return None
549553```
554+
550555_ Full example: [ examples/snippets/servers/completion.py] ( https://github.com/modelcontextprotocol/python-sdk/blob/main/examples/snippets/servers/completion.py ) _
551556<!-- /snippet-source -->
552557### Elicitation
@@ -597,6 +602,7 @@ async def book_table(
597602 # Date available
598603 return f " [SUCCESS] Booked for { date} at { time} "
599604```
605+
600606_ Full example: [ examples/snippets/servers/elicitation.py] ( https://github.com/modelcontextprotocol/python-sdk/blob/main/examples/snippets/servers/elicitation.py ) _
601607<!-- /snippet-source -->
602608
@@ -637,6 +643,7 @@ async def generate_poem(topic: str, ctx: Context) -> str:
637643 return result.content.text
638644 return str (result.content)
639645```
646+
640647_ Full example: [ examples/snippets/servers/sampling.py] ( https://github.com/modelcontextprotocol/python-sdk/blob/main/examples/snippets/servers/sampling.py ) _
641648<!-- /snippet-source -->
642649
@@ -665,6 +672,7 @@ async def process_data(data: str, ctx: Context) -> str:
665672
666673 return f " Processed: { data} "
667674```
675+
668676_ Full example: [ examples/snippets/servers/notifications.py] ( https://github.com/modelcontextprotocol/python-sdk/blob/main/examples/snippets/servers/notifications.py ) _
669677<!-- /snippet-source -->
670678
0 commit comments