Skip to content

Commit d44f68c

Browse files
committed
added an API for listing tools in serveres/contents/handlers.py
1 parent 2fbfbf6 commit d44f68c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

jupyter_server/services/contents/handlers.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,12 @@ async def post(self, path=""):
423423
self.set_status(201)
424424
self.finish()
425425

426+
class ListToolInfoHandler(APIHandler):
427+
@web.authenticated
428+
async def get(self):
429+
tools = self.serverapp.extension_manager.discover_tools()
430+
self.finish({"discovered_tools": tools})
431+
426432

427433
# -----------------------------------------------------------------------------
428434
# URL to handler mappings
@@ -441,4 +447,6 @@ async def post(self, path=""):
441447
(r"/api/contents%s/trust" % path_regex, TrustNotebooksHandler),
442448
(r"/api/contents%s" % path_regex, ContentsHandler),
443449
(r"/api/notebooks/?(.*)", NotebooksRedirectHandler),
450+
(r"/api/tools", ListToolInfoHandler),
451+
444452
]

0 commit comments

Comments
 (0)