Inja LLM Gateway
Get started

Tools policy

Function tools and the tool union (custom, computer, server) on passthrough vs translation — when the gateway errors vs rebuilds.

How tools are handled so agents never believe a tool was registered when it was dropped.

Summary

Path Behavior
Passthrough (OpenAI → openai / openai_compat) Forward as-is (model rewrite only)
Translate → OpenAI Rebuild full tool union: function, custom, computer, server
Translate → Anthropic / Google function only — other kinds → HTTP 400 with a clear error

Silent skip is intentionally rejected.

Tool kinds

Kind Wire example OpenAI egress Anthropic / Google
function type: "function" + parameters schema yes yes
custom grammar / lark / regex tools yes error
computer computer-use styles yes error
server file_search, web_search, … yes error

Empty type is treated as function. Name is required for function and custom tools.

Function tools (all families)

{
  "type": "function",
  "function": {
    "name": "lookup",
    "description": "Look up a record",
    "parameters": {
      "type": "object",
      "properties": { "id": { "type": "string" } },
      "required": ["id"]
    }
  }
}

Works on passthrough and on translate to Anthropic or Google.

Custom / grammar tools (OpenAI family)

{
  "type": "custom",
  "custom": {
    "name": "date_tool",
    "format": {
      "type": "regex",
      "definition": "[0-9]{4}-[0-9]{2}-[0-9]{2}"
    }
  }
}
  • Passthrough to OpenAI / openai_compat: forwarded.
  • Translate to Claude/Gemini: fails closed — use function tools or stay on OpenAI family.

How it works internally

  1. OpenAI ingress parses tools into the canonical IR.
  2. Router selects upstream kind.
  3. Egress rebuilds vendor JSON, or returns invalid_request_error with the unsupported kind name.

Multi-turn tool loops still rely on thinking/signature fidelity (reasoning_content, Anthropic thinking blocks, Google thoughtSignature) — see Chat field parity.

Practical guidance

  1. Vendor-specific tools → passthrough to that vendor.
  2. OpenAI client → Claude/Gemini → function tools only.
  3. Prefer fail-closed errors over silent drops when debugging agents.

Type to search…

↑↓ navigate↵ selectEsc close