The Laminar Playground provides the ability to add tools to your LLM calls. The playground supports configuring custom tools that AI models can call during conversations.

Tool Definition Structure

Tools in the playground have the following structure:

  • JSON object with keys as function names
  • Each function contains two main entries:
    • description - Clear explanation of what the function does
    • parameters - JSON schema defining the input parameters structure
  • Tool choice - Controls when tools are used: none, auto, required, or specific function name

Learn more about tool choice options in the AI SDK documentation.

Example Tool Configuration

{
  "searchDatabase": {
    "description": "Search for information in the company database",
    "parameters": {
      "type": "object",
      "properties": {
        "query": {
          "type": "string",
          "description": "Search query or keywords"
        },
        "category": {
          "type": "string",
          "enum": ["users", "orders", "products"],
          "description": "Database category to search"
        },
        "limit": {
          "type": "number",
          "description": "Maximum number of results to return",
          "default": 10
        }
      },
      "required": ["query", "category"]
    }
  }
}