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
Add a schema
Click Add Schema (also in the Tools popover or window settings) and define a JSON Schema for the expected response format.
Run the prompt
The model is instructed to return a response that conforms to the schema. The output panel validates the response and displays it as parsed JSON.
Iterate on the schema
Refine the schema fields and re-run until the model returns the shape you need.
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.