Skip to main content
This guide includes a complete OpenWebUI tool source block you can copy into OpenWebUI. The same implementation is tracked in examples/ai-baseline-openwebui-tool.py. The tool calls POST /v2/sandp_500/query, sends the API key in the X-API-Key header, requests agent_context, prints the metadata dashboard into the OpenWebUI chat, and returns agent_context.text as the model-facing tool result.

Install the Tool

  1. In OpenWebUI, go to Workspace -> Tools.
  2. Create a new tool.
  3. Paste the Python source from the OpenWebUI tool source block below.
  4. Save the tool.
  5. Open the tool settings and configure the valves.

Tool Source

Copy this source into a new OpenWebUI tool. Expand the block to view the full file.
examples/ai-baseline-openwebui-tool.py

Configure Valves

Tool Arguments

The calling model can provide these arguments: If mode or effort is omitted, the tool uses the corresponding valve default.