Tool & Function Calling
Define tool schemas, test model tool-call decisions, and validate structured output formats in the Playground.
Tool & Function Calling
The Playground lets you define tools and structured output schemas, then test how a model decides to call them. This is useful for verifying tool definitions before wiring them into your application.
Testing Tool Calls
Open the Tools popover
Click the Tools button (🔧) in the message actions bar below the message list. The popover shows any tools currently attached to this window.
Add a new tool
Click Add Tool inside the popover. Specify:
- Name — the function name the model will reference.
- Description — natural language description of what the tool does.
- Parameters — a JSON Schema object describing the tool's parameters.
Run the prompt
Write a user message that should trigger the tool and click Run. If the model decides to call the tool, the output panel displays a structured tool call card showing the function name and the arguments the model chose.
Inspect the arguments
Review the tool call card to verify the model extracted the correct arguments from the user message. Adjust the tool description or parameters if needed, then re-run.
Test multi-tool scenarios
Add additional tools using the same flow. Run prompts designed to trigger one, multiple, or no tools to verify the model routes correctly in each case.
Testing Structured Output
You can constrain the model's response format directly from the Playground window toolbar, independently of any attached tools. Click the Text output dropdown and choose:
- Text output — plain text (default)
- JSON output — any valid JSON object
- Structured output — JSON matching a schema you define
For Structured output, a schema editor dialog opens — give the schema a name and build it with the visual builder or paste YAML/JSON, then click Save (the schema name appears next to the output type selector for later edits). Click Run to get a response conforming to the selected format, and refine the schema until the model returns the shape you need. Changes are local to the Playground session until you save the prompt back to the library.
Saving Tools to the Registry
Tools defined in the Playground can be saved to your project's central tool registry so they can be reused in experiments and across other Playground sessions.
Click the Save action on a tool in the Tools popover to persist it to the registry. Saved tools appear in the tool selector and can be referenced by name and version when building prompts.
Tools saved to the registry are versioned. Saving a tool that already exists in the registry creates a new version.