Documentation
¶
Overview ¶
Package tools provides the built-in tool executors that an agent runtime runs inside a sandbox, plus the model-facing input schemas that describe them to the model.
A tool execution error (bad input, missing file, unimplemented tool) is reported to the model via Result.IsError so the model can recover; it is not a session-level error.
Index ¶
Constants ¶
const ( // CMA documents a file-backed preview above 100,000 characters. Mango // applies the same threshold to its projected model-visible UTF-8 text. MaxInlineResultChars = 100_000 ResultPreviewChars = 2_000 )
Variables ¶
This section is empty.
Functions ¶
func ResultPreview ¶
ResultPreview returns the bounded UTF-8 preview used after full output retention.
func Schema ¶
Schema returns the model-facing JSON input_schema for the named tool, or nil if the tool is unknown. Shapes adapt useful public tool conventions to the semantics Mango actually implements.
web_fetch/web_search are declared to the model through their native routing path, but still need legal local schema objects for shared configuration and fallback validation. The real Anthropic API rejects "input_schema":null (400). They therefore get a minimal permissive {"type":"object"} schema. Only a genuinely unknown tool name (not one of the eight built-ins) returns nil.
func SelfHostedSchema ¶
SelfHostedSchema returns the model-facing contract implemented by an Environment worker. Only the worker-owned bash tool has additional lifecycle controls; the transitional Mango-managed executor remains a one-shot process and continues to use Schema.
Types ¶
type Result ¶
Result is the outcome of a tool execution. Content is the wire block array (a list of {type:"text", text:string} maps) fed back to the model.
func ProjectMCPResult ¶
ProjectMCPResult separates a protocol-native MCP result from the content sent to the model. _meta and other control fields remain only in the bounded raw diagnostic value. The control plane cannot write into an operator-owned self-hosted workspace, so binary content is reported as unsupported instead of returning a path the worker could not read.