{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/RequiredBeforeExitToolRule",
  "title": "RequiredBeforeExitToolRule",
  "properties": {
    "tool_name": {
      "type": "string",
      "title": "Tool Name",
      "description": "The name of the tool. Must exist in the database for the user's organization."
    },
    "type": {
      "type": "string",
      "const": "required_before_exit",
      "title": "Type",
      "default": "required_before_exit"
    },
    "prompt_template": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Prompt Template",
      "description": "Optional template string (ignored)."
    }
  },
  "additionalProperties": false,
  "type": "object",
  "required": [
    "tool_name"
  ],
  "description": "Represents a tool rule configuration where this tool must be called before the agent loop can exit."
}