Skip to content

ToolsPage

🛈 DocStrings

Tools management page.

Source code in src/mcp_server_llmling/ui/pages/tools.py
class ToolsPage:
    """Tools management page."""

    def __init__(self, server: ConfigInjectionServer) -> None:
        self.server = server
        self.header = Header(server)
        self.tool_list = ToolList(server)

    @ui.page("/tools")
    def render(self) -> None:
        """Render the tools page."""
        self.header.render()

        with ui.column().classes("p-4 w-full gap-4"):
            with ui.row().classes("w-full justify-between items-center"):
                ui.label("Tools").classes("text-2xl")

            # Call the instance method correctly
            self.tool_list.render()  # type: ignore

            with ui.card().classes("w-full mt-4"):
                ui.label("Import Paths").classes("text-lg mb-2")
                current_paths: list[str] = [
                    tool.import_path
                    for tool in self.server.llm_server.runtime._tool_registry.values()
                    if tool.import_path
                ]
                if current_paths:
                    for path in sorted(set(current_paths)):
                        ui.label(f"• {path}").classes("text-sm text-gray-600")
                else:
                    ui.label("No tools configured").classes("text-sm text-gray-600")

render

render() -> None

Render the tools page.

Source code in src/mcp_server_llmling/ui/pages/tools.py
@ui.page("/tools")
def render(self) -> None:
    """Render the tools page."""
    self.header.render()

    with ui.column().classes("p-4 w-full gap-4"):
        with ui.row().classes("w-full justify-between items-center"):
            ui.label("Tools").classes("text-2xl")

        # Call the instance method correctly
        self.tool_list.render()  # type: ignore

        with ui.card().classes("w-full mt-4"):
            ui.label("Import Paths").classes("text-lg mb-2")
            current_paths: list[str] = [
                tool.import_path
                for tool in self.server.llm_server.runtime._tool_registry.values()
                if tool.import_path
            ]
            if current_paths:
                for path in sorted(set(current_paths)):
                    ui.label(f"• {path}").classes("text-sm text-gray-600")
            else:
                ui.label("No tools configured").classes("text-sm text-gray-600")

:fa-brands-github: Show source on GitHub