ToolCall. Emit. Gemini
(ToolCall v0.4.0)
Copy Markdown
Gemini function declaration (FunctionDeclaration).
Gemini's parameters field is a 22-field subset of OpenAPI 3.0, not JSON
Schema: types are the uppercase Type enum, nullability is nullable: true,
and the API rejects every field the subset does not declare. The emitter
renders the shared schema and then:
- uppercases
typeand rewritestype: [T, "null"]asnullable: true; - collapses an
anyOfnull branch intonullable: true; - drops
additionalProperties(Gemini objects are open); - drops
prefixItems(no positional tuples) and keepsminItems/maxItems; - keeps string enums with
format: "enum"and drops non-string enums; - raises for
$defs/$ref, whichparameterscannot express.
The envelope is one declaration: {"name", "description", "parameters"}.
strict is ignored because Gemini has no per-tool flag. When
additionalProperties or recursion must be preserved, send
parametersJsonSchema yourself. See the target matrix in
docs/projection.md.
Summary
Functions
@spec emit(ToolCall.IR.Tool.t(), keyword()) :: map()