Tool Controller
Controller for querying available AI tools and tool scopes from custom backoffice elements.
UaiToolController provides a frontend API for querying the available AI tools and tool scopes. Use this to build custom UI for tool selection or to display tool information in your backoffice extensions.
Import
import { UaiToolController, UaiToolScope, UaiToolItem } from "@umbraco-ai/core";Constructor
new UaiToolController(host: UmbControllerHost)host
UmbControllerHost
The controller host (usually this in a Lit element)
Methods
getToolScopes
Gets all available tool scopes.
async getToolScopes(): Promise<{ data?: UaiToolScope[]; error?: unknown }>Returns: Promise resolving to { data?, error? } where data is an array of tool scopes.
getTools
Gets all available tools.
async getTools(): Promise<{ data?: UaiToolItem[]; error?: unknown }>Returns: Promise resolving to { data?, error? } where data is an array of tools.
getToolCountsByScope
Gets the number of tools in each scope, including both backend and frontend tools.
Returns: Promise resolving to a record mapping scope IDs to tool counts. Returns {} on error.
Types
Example
Related
Custom Tools - Creating backend tools
Agent Permissions - Tool permissions for agents
Last updated
Was this helpful?