{
    "type": "function",          # Always 'function' for custom tools
    "function": {
        "name": "search_knowledge_base",   # Must match your Python function name

        # The description is what the model reads to decide WHEN to use this tool.
        # Be specific. Vague descriptions produce inconsistent tool use.
        "description": "Search the company knowledge base for information about
HR policies, IT procedures, and company guidelines. Use this tool when the
user asks a question that might be covered in internal documentation.",

        "parameters": {
            "type": "object",
            "properties": {
                "query": {
                    "type": "string",
                    # Parameter descriptions guide argument construction.
                    # The model produces better arguments when it knows
                    # the expected format and intent of each parameter.
                    "description": "The search query. Write it as a natural
language question or key phrase, e.g. 'annual leave entitlement' or
'how do I request remote working?'"
                },
                "max_results": {
                    "type": "integer",
                    "description": "Maximum number of results to return (1-10). Default: 3.",
                    "default": 3
                }
            },
            # Only 'query' is required; 'max_results' is optional
            "required": ["query"]
        }
    }
}
