Wardrik.MCPTools (wardrik v0.1.0-rc.1)

Copy Markdown

Gives an agent the tools of the MCP servers it names. Implements WardrikCore.Capability.

Servers are looked up at the start of each turn, so added or removed servers apply from the next turn. For each name, the first match wins:

  1. The owner's server of that name.
  2. The org's, for a person's agent.
  3. The server Wardrik started with, if it serves the agent's org.

With all: true, the agent also gets every server its owners added.

Summary

Functions

Returns the WardrikMCP name of the server name that owner added.

Returns the owners whose servers the agent id can use: its owner, then the org for a person.

Returns the WardrikMCP names of the servers the agent id gets for opts.

Returns the names of Wardrik's own servers that serve the agent id's org.

Functions

key(owner, name)

@spec key(String.t(), String.t()) :: String.t()

Returns the WardrikMCP name of the server name that owner added.

Wardrik.MCPTools.key("acme", "github")
#=> "acme:github"

owners(id)

@spec owners(String.t()) :: [String.t()]

Returns the owners whose servers the agent id can use: its owner, then the org for a person.

picked(mcp, id, opts)

@spec picked(atom(), String.t(), keyword()) :: [String.t()]

Returns the WardrikMCP names of the servers the agent id gets for opts.

served(wardrik, id)

@spec served(Wardrik.t(), String.t()) :: [String.t()]

Returns the names of Wardrik's own servers that serve the agent id's org.

A server serves an org if its :orgs lists it, or it has no :orgs.