JSON Schema Generator

Define a function once and get the tool schema each provider expects. The parameter object is shared JSON Schema Draft-07; the wrapper around it is not.

Parameters

{
  "type": "function",
  "function": {
    "name": "get_weather_data",
    "description": "Retrieves the current weather for a specific location.",
    "parameters": {
      "type": "object",
      "properties": {
        "location": {
          "type": "string",
          "description": "The city and state, e.g. San Francisco, CA"
        },
        "unit": {
          "type": "string",
          "description": "Temperature unit",
          "enum": [
            "celsius",
            "fahrenheit"
          ]
        },
        "num_days": {
          "type": "integer",
          "description": "Forecast depth in days"
        }
      },
      "required": [
        "location"
      ]
    }
  }
}

OpenAI wraps the definition in { type: "function", function: … }.

llmtools is a vendor-neutral toolkit for working with large language models — token counting, cost estimation and model comparison, computed in your browser. OpenAI token counts are exact, using the same encoding the model does (o200k_base for GPT-4o, cl100k_base for GPT-4/3.5); Claude and Gemini counts are labelled approximations, since neither publishes a tokenizer that runs client-side. Model pricing is read from OpenRouter’s public catalogue once a day. Nothing you type is ever transmitted anywhere.