Skip to content

API Reference — Go

Module github.com/muthuishere/toolnexus/golang (Go 1.23). See the combined API Reference for every symbol shown in six-language synced tabs.

  • CreateToolkit(ctx context.Context, opts Options) (*Toolkit, error)
  • Options fields: McpConfig, SkillsDir, Skills, SkillProvider, SkillsFilter, SkillSampleLimit, Builtins, Agents, ExtraTools, WaitFor.
  • Equivalents: createToolkit (js) · create_toolkit (py) · Toolkit.create (java) · Toolkit.CreateAsync (c#) · Toolnexus.create_toolkit (elixir).
  • LoadSkills(dirs ...string) *SkillSource — back-compat variadic.
  • LoadSkillsWith(opts LoadSkillsOptions) *SkillSource
  • ListSkills(opts LoadSkillsOptions) *SkillInventory.Skills, .Skipped (SkillSkip.Reason; constants SkipMissingName, SkipMalformed, SkipDuplicateName, SkipUnreadable).
  • SkillDef{ Name, Description, Content, Resources, Base }
  • LoadSkillsOptions{ Dirs, Skills, Filter, SampleLimit }
  • SkillProvider func(context.Context) ([]SkillDef, error) (on Options).
  • Equivalents: loadSkills / listSkills (js) · load_skills / list_skills (py) · SkillSource.loadWith / listSkills (java) · SkillSource.LoadWith / ListSkills (c#) · Toolnexus.Skill.load / Toolnexus.Skill.list (elixir).
  • LoadMcp(config any) (*McpSource, error)
  • tk.ToOpenAI() · tk.ToAnthropic() · tk.ToGemini()
  • CreateClient(opts ClientOptions) *Clientclient.Ask(ctx, prompt, tk, id).

Tools you build — native, HTTP, built-ins

Section titled “Tools you build — native, HTTP, built-ins”
  • NativeTool(name, description, schema, fn) · NativeToolReflect[T](name, description, fn) — schema from struct json tags.
  • HTTPTool(opts HTTPToolOptions){ Name, Description, Method, URL, Headers, Query, Body, ResultMode, Timeout }; Timeout ms (0 ⇒ 30000).
  • Builtins toggle → ten built-ins: bash · read · write · edit · grep · glob · webfetch · question · apply_patch · todowrite.
  • Equivalents: defineTool / httpTool (js) · define_tool / http_tool (py) · NativeTool.of / HttpTool.of (java) · NativeTool.Of / HttpTool.Of (c#) · Toolnexus.Native.define_tool / Toolnexus.Http.tool (elixir).
  • agents.New(name, agents.Spec{Does, Tools, Soul, SoulFile, Team, Budget, Model, WaitFor}) *Agent.
  • (a *Agent) Run(agents.Options{LLM: ...}, prompt) (TaskResult, *Runtime).Status, .Text, .TotalTokens.
  • (a *Agent) AsTool(agents.Options) tn.Tool · agents.ComposeSoul(dir) (soul, found).
  • Equivalents: agents.agent / .run / .asTool / composeSoul (js) · agent (py) · Agents.agent (java/elixir) · new Agent (c#).
  • (tk *Toolkit) Serve(addr, ServeOptions{Client, A2A: *A2AConfig, OnTask, MCP, OnCall}) (*ServeHandle, error).
  • Agent{Card, Headers, Timeout, PollEvery} + Options{Agents: []Agent} / tk.AddAgent(ctx, cardURL, opts).
  • Equivalents: tk.serve / tk.addAgent (js) · serve / add_agent (py) · serve / addAgent (java) · ServeAsync / AddAgentAsync (c#) · Toolkit.serve / Toolkit.add_agent (elixir).
  • WaitFor field on Optionsfunc(Request) (Answer, error).
  • Request{ID, Kind, Prompt, URL, Data, ExpiresAt} · Answer{ID, Ok, Data, Reason}.
  • Pending(req Request) ToolResult · AuthRequired(url, prompt) ToolResult · PendingOf(result) *Request.
  • Equivalents: waitFor / pending / authRequired / pendingOf (js) · wait_for / pending (py) · waitFor / ToolResult.pending (java) · WithWaitFor / ToolResult.Pending (c#) · wait_for / ToolResult.pending? (elixir).