Overview
Tool Name:ui_resource
When an agent calls this tool, it:
- Selects a UI Resource template by name
- Passes context data (extracted from the conversation) to the template
- Renders the Jinja2 template with the data
- Returns the rendered HTML to the user in an iframe
Configuration
Create a UI Resource Tool
- Navigate to AI Studio > Tools
- Click Create Tool
- Select UI Resource as the tool type
- Configure the tool:
- Name: Internal identifier (e.g.,
product_card) - Display Name: User-facing name (e.g.,
Show Product) - Description: What this tool does — helps the AI decide when to call it
- Prompt: Instructions for when the agent should use this tool
- Name: Internal identifier (e.g.,
- In Additional Info, set the template name to the UI Resource template this tool renders
- Define the Input Schema — the data fields the agent will extract from the conversation
- Click Save
- Assign the tool to your agent in AI Studio > Agents > Tools tab
Tool-Specific Settings
Input Schema
Define what data the agent should extract and pass to the template. The field names must match the variables used in your template. Example — a notification card tool:Tool Response Format
The tool returns rendered HTML to the chat widget:Troubleshooting
Template not rendering
Template not rendering
- Check the template name in Additional Info matches exactly
- Verify the template is marked as active in AI Studio > UI Resources
- Ensure the agent passes all required fields defined in the context schema
Content cut off or scrollbars appear
Content cut off or scrollbars appear
- Verify Auto-Resize is enabled in the tool configuration
- Avoid fixed heights in your template CSS
- Use flexible layouts (flexbox, grid)
Agent not using the tool
Agent not using the tool
- Review the tool’s Description and Prompt — make them specific about when to use it
- Verify the tool is assigned to the agent
- Check the input schema matches what the agent can extract from the conversation
Related
- UI Resources — Create and manage templates (syntax, schema, configuration)
- UI Resources Guide — Design patterns, accessibility, and testing
- AI Template Editor — Edit templates with natural language
- Tools Overview — General tool configuration
