ADR 010 · Accepted

Tool/Function Calling Design

Status

Accepted (2024-04)

Context

Modern LLMs support tool/function calling for:

  • External data retrieval.

  • Action execution.

  • Structured output generation.

Decision

Support OpenAI-compatible tool format:

Tool calls returned in CompletionResponse::$toolCalls:

  • A typed list<ToolCall> (nullable) of ToolCall value objects — each with the tool id, name and its arguments as an already JSON-decoded associative array (not an encoded string). A full tool-execution runtime was added later in ADR-038.

Consequences

Positive:

  • ●● Industry-standard format.

  • ●● Cross-provider compatibility.

  • ● Flexible tool definitions.

  • ● Type-safe parameters.

Negative:

  • ◑ Complex nested structure.

  • ◑ Provider translation needed.

  • ✕ No automatic execution.

  • ◑ Testing complexity.

Net Score: +5.0 (Positive impact - OpenAI-compatible format ensures broad compatibility)

← All ADRs