# ToolCall v0.4.0 - Table of Contents > Derive LLM tool-call schemas from Elixir @spec and @doc, with a runtime dispatcher. ## Pages - [ToolCall](readme.md) - [Changelog](changelog.md) - [Usage](usage.md) - [Design](design.md) - [Schema projection matrix](projection.md) - [Roadmap](roadmap.md) - [Pitfalls](pitfalls.md) - [Numbers](number-handling.md) ## Modules - [ToolCall](ToolCall.md): Derive LLM tool-call schemas from `@spec` and `@doc`. - [ToolCall.LocalTypeAlgorithm.RefName](ToolCall.LocalTypeAlgorithm.RefName.md): Builds `$defs` names for a local type instantiation. - [ToolCall.TypeExpr.Projection](ToolCall.TypeExpr.Projection.md): Exact set operations on `ToolCall.TypeExpr`, used to lower intersections and negations before they reach `ToolCall.IR.Type`. - Rendering - [ToolCall.Emit](ToolCall.Emit.md): Dispatches IR to a provider-specific schema. - [ToolCall.Emit.Anthropic](ToolCall.Emit.Anthropic.md): Anthropic tool definition (`name` / `description` / `input_schema`). - [ToolCall.Emit.Gemini](ToolCall.Emit.Gemini.md): Gemini function declaration (`FunctionDeclaration`). - [ToolCall.Emit.MCP](ToolCall.Emit.MCP.md): MCP `tools/list` tool object (`name` / `description` / `inputSchema`). - [ToolCall.Emit.OpenAI](ToolCall.Emit.OpenAI.md): OpenAI function-calling schema. - [ToolCall.IR](ToolCall.IR.md): Intermediate representation between Elixir typespecs and wire schemas. - [ToolCall.IR.Field](ToolCall.IR.Field.md): One entry of an object-shaped type. - [ToolCall.IR.Param](ToolCall.IR.Param.md): One positional parameter of a tool function. - [ToolCall.IR.Tool](ToolCall.IR.Tool.md): A compiled tool, as embedded into the defining module. - [ToolCall.IR.Type](ToolCall.IR.Type.md): A node in the value-domain tree. - [ToolCall.Schema.Gemini](ToolCall.Schema.Gemini.md): Target-level schema adaptation that does not require `ToolCall.IR`. - Dispatch and policies - [ToolCall.Approval](ToolCall.Approval.md): Approval policies and pending approval requests. - [ToolCall.Approval.Request](ToolCall.Approval.Request.md): A serializable pending approval. - [ToolCall.Audit](ToolCall.Audit.md): Dispatch audit hooks. - [ToolCall.Audit.Entry](ToolCall.Audit.Entry.md): One dispatch attempt. - [ToolCall.Call](ToolCall.Call.md): A resolved tool call, ready for `ToolCall.Runner.execute/2`. - [ToolCall.Coerce](ToolCall.Coerce.md): Runtime normalisation of decoded JSON arguments into the value domains that typespecs promise. - [ToolCall.PolicyValidation](ToolCall.PolicyValidation.md): A one-shot supervision-tree child that validates module-level policies at application startup. - [ToolCall.Runner](ToolCall.Runner.md): Validates and dispatches a decoded argument map to the tool function. - [ToolCall.Timeout](ToolCall.Timeout.md): Per-invocation timeouts and the timeout policy behaviour. - Extension points - [ToolCall.Providers.MapSet](ToolCall.Providers.MapSet.md): Type provider for MapSet values. - [ToolCall.Providers.Regex](ToolCall.Providers.Regex.md): Type provider for Regex values. - [ToolCall.Providers.Stdlib](ToolCall.Providers.Stdlib.md): Built-in type provider for standard-library scalars and calendar types. - [ToolCall.Providers.URI](ToolCall.Providers.URI.md): Optional provider for `t:URI.t/0`, encoded as a string. - [ToolCall.Providers.Version](ToolCall.Providers.Version.md): Optional provider for `t:Version.t/0`, encoded as a semantic-version string. - [ToolCall.Stream](ToolCall.Stream.md): Aggregates provider streaming deltas into complete tool calls. - [ToolCall.TypeProvider](ToolCall.TypeProvider.md): Resolves custom remote typespecs for `use ToolCall, types: [...]`. - Internals (not public API) - [ToolCall.Builder](ToolCall.Builder.md): Compile-time assembly of ToolCall IR from declarations, docs, defaults, and metadata. - [ToolCall.Codegen](ToolCall.Codegen.md): Compile-time generation of per-tool runner clauses and dispatch helpers. - [ToolCall.Defs](ToolCall.Defs.md): Reachability checks for `$defs` entries referenced by IR types. - [ToolCall.Diagnostic](ToolCall.Diagnostic.md): A structured compile-time diagnostic returned by a function-declaration source. - [ToolCall.Doc](ToolCall.Doc.md): Extracts tool descriptions from `@doc` strings. - [ToolCall.Emit.Schema](ToolCall.Emit.Schema.md): JSON Schema rendering shared by the provider emitters. - [ToolCall.Generated](ToolCall.Generated.md): Helpers for generated typedoc companion modules and schema accessors. - [ToolCall.Graph](ToolCall.Graph.md): Graph helpers for detecting cyclic local type definitions. - [ToolCall.LegacyTypespec](ToolCall.LegacyTypespec.md): Adapter around the legacy Erlang typespec APIs used by ToolCall. - [ToolCall.LocalTypeAlgorithm](ToolCall.LocalTypeAlgorithm.md): Shared local-type expansion algorithm used by AST and, later, `TypeExpr`. - [ToolCall.LocalTypeAlgorithm.Adapter](ToolCall.LocalTypeAlgorithm.Adapter.md): Callbacks required by `ToolCall.LocalTypeAlgorithm`. - [ToolCall.LocalTypeAlgorithm.AstAdapter](ToolCall.LocalTypeAlgorithm.AstAdapter.md): AST adapter for `ToolCall.LocalTypeAlgorithm`. - [ToolCall.LocalTypeAlgorithm.TypeExprAdapter](ToolCall.LocalTypeAlgorithm.TypeExprAdapter.md): `ToolCall.TypeExpr` adapter for `ToolCall.LocalTypeAlgorithm`. - [ToolCall.LocalTypes](ToolCall.LocalTypes.md): AST-facing facade for local type expansion. - [ToolCall.Options](ToolCall.Options.md): Validation for runtime option maps and policy modules. - [ToolCall.Patterns](ToolCall.Patterns.md): Shared regex patterns used by type mapping and coercion. - [ToolCall.ProviderName](ToolCall.ProviderName.md): Validation for provider-compatible tool names. - [ToolCall.Structs](ToolCall.Structs.md): Compile-time introspection of struct fields, field types, defaults, and enforced keys. - [ToolCall.Structs.Resolve](ToolCall.Structs.Resolve.md): Resolves struct markers into closed object IR and hoists recursive structs. - [ToolCall.TypeAst](ToolCall.TypeAst.md): Shared normalization for typespec ASTs before they reach `ToolCall.TypeCompiler`. - [ToolCall.TypeCompiler](ToolCall.TypeCompiler.md): Compiles a declaration's `ToolCall.TypeExpr` values into `ToolCall.IR.Type`. - [ToolCall.TypeExpr](ToolCall.TypeExpr.md): Source-neutral, unresolved type expressions for `ToolCall.TypeCompiler`. - [ToolCall.TypeExpr.Compiler](ToolCall.TypeExpr.Compiler.md): Lowers `ToolCall.TypeExpr` into `ToolCall.IR.Type`. - [ToolCall.TypeExpr.Typespec](ToolCall.TypeExpr.Typespec.md): Translates normalized, local-type-expanded typespec AST into `ToolCall.TypeExpr`. - [ToolCall.TypeSource](ToolCall.TypeSource.md): Internal contract for function-declaration sources. - [ToolCall.TypeSource.Declaration](ToolCall.TypeSource.Declaration.md): A source-neutral function declaration consumed by the builder. - [ToolCall.TypeSource.Param](ToolCall.TypeSource.Param.md): One parameter in a `ToolCall.TypeSource.Declaration`. - [ToolCall.TypeSource.Typespec](ToolCall.TypeSource.Typespec.md): The default `@spec`-backed function-declaration source. - [ToolCall.Typedoc](ToolCall.Typedoc.md): Recovers visible `@typedoc` text from compiled Docs chunks. - [ToolCall.Typespec](ToolCall.Typespec.md): Converts a quoted typespec AST (aliases already expanded) into `ToolCall.IR.Type`. - [ToolCall.Validate](ToolCall.Validate.md): Runtime validation helpers for tool results and IR types. ## Mix Tasks - [mix tool_call.clean](Mix.Tasks.ToolCall.Clean.md): Removes orphaned typedoc companion beams. - [mix tool_call.export](Mix.Tasks.ToolCall.Export.md): Exports the schemas derived by `use ToolCall` as JSON.