API Reference — Elixir
Package toolnexus (Hex), Elixir ≥ 1.16 / OTP 26. See the combined API Reference for
every symbol shown in six-language synced tabs.
Toolkit
Section titled “Toolkit”Toolnexus.create_toolkit(opts) :: {:ok, toolkit} | {:error, term}— the aggregator.Toolnexus.create_toolkit!/1returns the toolkit or raises.opts(keyword)::mcp_config,:skills_dir,:skills,:skill_provider,:skills_filter,:skill_sample_limit,:builtins,:agents,:extra_tools,:disable_tools,:disable_skills,:wait_for.- Equivalents:
createToolkit(js) ·create_toolkit(py) ·CreateToolkit(go) ·Toolkit.create(java) ·Toolkit.CreateAsync(c#).
Skills
Section titled “Skills”Toolnexus.Skill.load(input) :: %Toolnexus.Skill.Source{}—inputis a path, a list of paths, or an options keyword.Toolnexus.Skill.list(input) :: %{skills: [...], skipped: [...]}— discover + validate; each skip is%{location, reason}with reasonsmissing-name·malformed-frontmatter·duplicate-name·unreadable.- A data skill is a plain map:
%{name, description, content, resources, base}(only:nameand:contentrequired). - Equivalents:
loadSkills/listSkills(js) ·load_skills/list_skills(py) ·LoadSkills/ListSkills(go) ·SkillSource.load/listSkills(java) ·SkillSource.Load/ListSkills(c#).
MCP · Adapters · Client
Section titled “MCP · Adapters · Client”Toolnexus.Mcp.load(config, opts \\ []) :: {:ok, mcp} | {:error, term}—mcp.tools.Toolnexus.Adapters.to_openai(tools)·to_anthropic(tools)·to_gemini(tools).Toolnexus.Client.create(opts) :: %Toolnexus.Client{}→Toolnexus.Client.run(client, prompt, toolkit, opts \\ []),Toolnexus.Client.stream(client, prompt, toolkit, opts \\ []).
Tools you build — native, HTTP, built-ins
Section titled “Tools you build — native, HTTP, built-ins”Toolnexus.Native.define_tool(name:, description:, input_schema?, execute:)—executeisfn args -> endorfn args, ctx -> end.Toolnexus.Http.tool(name:, description:, method:, url:, headers?, query?, body?, result_mode?, timeout?)— note the function istool/1(nothttp_tool);:timeoutin ms.:builtinstoggle → ten built-ins:bash · read · write · edit · grep · glob · webfetch · question · apply_patch · todowrite. (Toolnexus.Builtin.tools/0·load/1.)- Equivalents:
defineTool/httpTool(js) ·define_tool/http_tool(py) ·NativeTool/HTTPTool(go) ·NativeTool.of/HttpTool.of(java) ·NativeTool.Of/HttpTool.Of(c#).
Sub-agents & teams
Section titled “Sub-agents & teams”Toolnexus.Agents.agent(name, does:, uses?, soul?/soul_file?, team?, budget?, model?, wait_for?).Toolnexus.Agents.run(agent, rt_opts, prompt)— result map%{status:, text:, total_tokens:, turns:, is_error:, pending:}.Toolnexus.Agents.as_tool(agent, rt_opts)·Toolnexus.Agents.compose_soul(dir) :: {soul, found}.- Equivalents:
agents.agent/.run/.asTool/composeSoul(js) ·agent(py) ·agents.New(go) ·Agents.agent(java) ·new Agent(c#).
A2A — serve & remote agents
Section titled “A2A — serve & remote agents”Toolnexus.Toolkit.serve(tk, addr, client:, a2a:, mcp?, on_task?, on_call?) :: Toolnexus.Serve.Handle.t()—handle.url·Toolnexus.Serve.stop/1.Toolnexus.A2A.agent(card:, headers?, timeout?, poll_every?)+create_toolkit(agents: [...])/Toolnexus.Toolkit.add_agent(tk, card_url).- Equivalents:
tk.serve/tk.addAgent(js) ·serve/add_agent(py) ·Serve/AddAgent(go) ·serve/addAgent(java) ·ServeAsync/AddAgentAsync(c#).
Suspension & the human loop
Section titled “Suspension & the human loop”:wait_for(toolkit option;fn Request -> Answer).%Toolnexus.Request{id, kind, prompt, url, data, expires_at}(serializesexpiresAt) ·%Toolnexus.Answer{id, ok, data, reason}.Toolnexus.ToolResult.pending?/1detects a suspension; a tool suspends by returning%ToolResult{is_error: true, metadata: %{pending: %Request{}}}.- Equivalents:
waitFor/pending(js) ·wait_for/pending(py) ·WaitFor/Pending(go) ·waitFor/ToolResult.pending(java) ·WithWaitFor/ToolResult.Pending(c#).