WardrikRest (wardrik_rest v0.1.0-rc.1)
Copy MarkdownTools for agents from an HTTP API's description: one tool per operation, with the API's own sign-in and keys.
{:ok, analytics} =
WardrikRest.API.load(
{WardrikRest.Discovery,
url: "https://analyticsdata.googleapis.com/$discovery/rest?version=v1beta"},
name: "ga4",
base_url: "https://analyticsdata.googleapis.com/",
auth: %{"oauth2" => {:credential, "google"}},
only: ["properties_runReport", "properties_getMetadata"],
read_only: ["properties_runReport"]
)
WardrikCore.start_agent(
agent_id: "agt_marketing",
model: "anthropic:claude-haiku-4-5",
capabilities: [{WardrikRest, apis: [analytics]}],
credentials: {MyApp.Credentials, []}
)- Each tool is named
<api>__<operation>, asga4__properties_runReport, and takes the operation's path, query and body arguments. GETs and the operations given as:read_onlyare read-only; the rest need a person's approval unless the policy allows them.- Answers are labelled
"outside"unless the API is:trusted. - A tool whose schema is over the API's
:max_schema_bytesnames its deeper types instead of listing their fields, and<api>__describegives them.
Descriptions are read by a WardrikRest.Reader. See WardrikRest.Discovery and
WardrikRest.API.
Summary
Functions
Returns the tool for operation of api.
Functions
@spec tool(WardrikRest.API.t(), WardrikRest.Operation.t()) :: WardrikCore.Tool.t()
Returns the tool for operation of api.