OapiCodemode.Tools.Descriptions (oapi_codemode v0.2.0)

Copy Markdown View Source

Assembles search/execute tool descriptions from registry state. The description IS the documentation — every global the sandbox actually receives must be declared here, with real names, or the model has to guess at them.

Summary

Functions

Description for the execute tool, given Registry.list/1 output.

Description for the search_apis tool, given Registry.list/1 output.

Functions

execute(entries, policy \\ :read_only, search_tool_name \\ "search_apis")

@spec execute([{String.t(), struct()}], :read_only | :all, String.t() | nil) ::
  String.t()

Description for the execute tool, given Registry.list/1 output.

policy is :read_only (default) or :all. Under :all an extra paragraph is appended stating that mutating requests are allowed — a host that registers a second, mutating tool variant (via Tools.definitions/1 with policy: :all and a distinct :execute_tool_name) must not leave the model to assume the read-only default's restrictions still apply.

search_tool_name is the name of the paired search tool, named so the model pairs the right search with the right execute when a host emits several search/execute trios under distinct names — pass nil when no search tool exists for this execute tool to point to (the description then makes no claim that one does).

search(entries)

@spec search([{String.t(), struct()}]) :: String.t()

Description for the search_apis tool, given Registry.list/1 output.