Maxim Logo
How toPrompt Tools

Create a Schema-based Prompt Tool

Schema-based prompt tools provide a structured way to define tools that ensure accurate and schema-compliant outputs. This approach is particularly useful when you need to guarantee that the LLM's responses follow a specific format.

Creating a Schema Tool

Navigate to the Prompt Tools section and click the + button.

Select Schema as the tool type.

Define your schema in the editor. Here's an example schema for a stock price tool:

Function call schema
{
    "type": "function",
    "function": {
        "name": "get-stock-price",
        "parameters": {
            "type": "object",
            "properties": {
                "stock": {
                    "type": "string"
                }
            }
        },
        "description": "this function returns stock value"
    }
}

Click the Save button to create your schema-based tool.

Testing Your Schema Tool

After creating your schema-based tool:

  1. Add it to a prompt configuration
  2. Test if the model correctly identifies when to use it
  3. Verify that the outputs match your schema's structure

On this page