For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt, and this page is available as Markdown at /next/api/genui/openui/core/interfaces/ToolProvider.md.
Lynx
  • English
  • Interface: ToolProvider

    ToolProvider interface for Query() and Mutation() tool calls. Framework-agnostic — works with MCP, REST, GraphQL, or any backend.

    Example

    // Function map (Renderer normalizes this automatically)
    <Renderer toolProvider={{
      get_users: (args) => fetch(`/api/users`).then(r => r.json()),
    }} />
    
    // MCP client (Renderer wraps extractToolResult automatically)
    <Renderer toolProvider={mcpClient} />

    Methods

    callTool()

    callTool(toolName: string, args: Record<string, unknown>): Promise<unknown>

    Parameters

    ParameterType
    toolNamestring
    argsRecord<string, unknown>

    Returns

    Promise<unknown>

    Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.