File tree Expand file tree Collapse file tree 5 files changed +33
-5
lines changed
Expand file tree Collapse file tree 5 files changed +33
-5
lines changed Original file line number Diff line number Diff line change @@ -2005,8 +2005,13 @@ async def list_all_resources() -> None:
20052005 print (f " Total resources: { len (all_resources)} " )
20062006
20072007
2008- if __name__ == " __main__" :
2008+ def main ():
2009+ """ Entry point for the pagination client."""
20092010 asyncio.run(list_all_resources())
2011+
2012+
2013+ if __name__ == " __main__" :
2014+ main()
20102015```
20112016
20122017_ Full example: [ examples/snippets/clients/pagination_client.py] ( https://github.com/modelcontextprotocol/python-sdk/blob/main/examples/snippets/clients/pagination_client.py ) _
@@ -2146,8 +2151,13 @@ async def main():
21462151 print (f " Available tools: { [tool.name for tool in tools.tools]} " )
21472152
21482153
2149- if __name__ == " __main__" :
2154+ def run ():
2155+ """ Entry point for the streamable basic client."""
21502156 asyncio.run(main())
2157+
2158+
2159+ if __name__ == " __main__" :
2160+ run()
21512161```
21522162
21532163_ Full example: [ examples/snippets/clients/streamable_basic.py] ( https://github.com/modelcontextprotocol/python-sdk/blob/main/examples/snippets/clients/streamable_basic.py ) _
Original file line number Diff line number Diff line change @@ -37,5 +37,10 @@ async def list_all_resources() -> None:
3737 print (f"Total resources: { len (all_resources )} " )
3838
3939
40- if __name__ == "__main__" :
40+ def main ():
41+ """Entry point for the pagination client."""
4142 asyncio .run (list_all_resources ())
43+
44+
45+ if __name__ == "__main__" :
46+ main ()
Original file line number Diff line number Diff line change @@ -56,5 +56,10 @@ async def main():
5656 await parse_tool_results ()
5757
5858
59- if __name__ == "__main__" :
59+ def run ():
60+ """Entry point for the parsing tool results client."""
6061 asyncio .run (main ())
62+
63+
64+ if __name__ == "__main__" :
65+ run ()
Original file line number Diff line number Diff line change @@ -25,5 +25,10 @@ async def main():
2525 print (f"Available tools: { [tool .name for tool in tools .tools ]} " )
2626
2727
28- if __name__ == "__main__" :
28+ def run ():
29+ """Entry point for the streamable basic client."""
2930 asyncio .run (main ())
31+
32+
33+ if __name__ == "__main__" :
34+ run ()
Original file line number Diff line number Diff line change @@ -21,3 +21,6 @@ completion-client = "clients.completion_client:main"
2121direct-execution-server = " servers.direct_execution:main"
2222display-utilities-client = " clients.display_utilities:main"
2323oauth-client = " clients.oauth_client:run"
24+ pagination-client = " clients.pagination_client:main"
25+ parsing-tool-results-client = " clients.parsing_tool_results:run"
26+ streamable-basic-client = " clients.streamable_basic:run"
You can’t perform that action at this time.
0 commit comments