Skip to content

API Reference — C#

Package Toolnexus (NuGet, .NET). See the combined API Reference for every symbol shown in six-language synced tabs.

  • Toolkit.CreateAsync(Toolkit.Options opts)
  • Options: McpConfig, SkillsDir, Skills, SkillProvider, SkillsFilter, SkillSampleLimit, Builtins, Agents, ExtraTools, WaitFor (plus With… fluent setters).
  • Equivalents: createToolkit (js) · create_toolkit (py) · CreateToolkit (go) · Toolkit.create (java) · Toolnexus.create_toolkit (elixir).
  • SkillSource.Load(params string[] dirs) — back-compat.
  • SkillSource.LoadWith(SkillSource.LoadOptions opts)
  • SkillSource.ListSkills(LoadOptions opts) -> SkillInventory.Skills, .Skipped (SkillSkip.Reason; constants SkillSkip.MissingName, Malformed, DuplicateName, Unreadable).
  • record SkillDef(Name, Description, Content, Resources = null, Base = null)
  • LoadOptions { Dirs, Skills, Filter, SampleLimit }
  • SkillProvider is a Func<IEnumerable<SkillDef>>.
  • Equivalents: loadSkills / listSkills (js) · load_skills / list_skills (py) · LoadSkillsWith / ListSkills (go) · SkillSource.loadWith / listSkills (java) · Toolnexus.Skill.load / Toolnexus.Skill.list (elixir).
  • McpSource.LoadAsync(config)
  • Adapters.ToOpenAI(tk) · ToAnthropic(tk) · ToGemini(tk)
  • Client.Create(Client.Options)await client.AskAsync(prompt, tk).

Tools you build — native, HTTP, built-ins

Section titled “Tools you build — native, HTTP, built-ins”
  • NativeTool.Of(name, description, schema, fn) · NativeTool.OfAsync(...)(args, ToolContext) overloads.
  • HttpTool.Of(HttpTool.Options){ Name, Description, Method, Url, Headers, Query, Body, ResultMode, Timeout }; Timeout long? ms.
  • Builtins toggle → ten built-ins: bash · read · write · edit · grep · glob · webfetch · question · apply_patch · todowrite. (BuiltinTools.Create() / .Select(cfg).)
  • Equivalents: defineTool / httpTool (js) · define_tool / http_tool (py) · NativeTool / HTTPTool (go) · NativeTool.of / HttpTool.of (java) · Toolnexus.Native.define_tool / Toolnexus.Http.tool (elixir).
  • new Agent(name, new AgentSpec { Does, Uses, Soul, SoulFile, Team, Budget, Model, WaitFor }).
  • Agent.RunAsync(RuntimeOptions, prompt): Task<AgentResult>.Status, .Text, .TotalTokens.
  • Agent.AsTool(RuntimeOptions): ITool · Home.ComposeSoul(dir): (Soul, Found).
  • Equivalents: agents.agent / .run / .asTool / composeSoul (js) · agent (py) · agents.New (go) · Agents.agent (java/elixir).
  • tk.ServeAsync(addr, new Toolkit.ServeOptions { Client, A2A, OnTask, Mcp, OnCall }): Task<ServeHandle>.
  • new Agent { Card, Headers, Timeout, PollEvery } + Options { Agents } / await tk.AddAgentAsync(cardUrl).
  • Equivalents: tk.serve / tk.addAgent (js) · serve / add_agent (py) · Serve / AddAgent (go) · serve / addAgent (java) · Toolkit.serve / Toolkit.add_agent (elixir).
  • Options.WithWaitFor(Func<Request, Task<Answer>>) (toolkit option).
  • record Request { Id, Kind, Prompt, Url?, Data?, ExpiresAt? } · record Answer { Id, Ok, Data?, Reason? }.
  • ToolResult.Pending(Request) · ToolResult.AuthRequired(url, prompt?) · ToolResult.PendingOf(result): Request?.
  • Equivalents: waitFor / pending / authRequired / pendingOf (js) · wait_for / pending (py) · WaitFor / Pending (go) · waitFor / ToolResult.pending (java) · wait_for / ToolResult.pending? (elixir).