Skip to content

Add Tools

Register tools in your agent.yaml so AgentSpec can validate, document, and generate them.

Define a tool

yaml
spec:
  tools:
    - name: search-web
      type: function
      description: "Search the web for current information"
      module: $file:tools/search.py
      function: search_web
      annotations:
        readOnlyHint: true
        destructiveHint: false

Tool fields

FieldRequiredDescription
nameYesUnique tool identifier
typeYesfunction or mcp
descriptionYesHuman-readable description (used in LLM system prompt)
moduleNoPath to the Python/JS module ($file: reference)
functionNoFunction name within the module
annotations.readOnlyHintNoHints the tool does not modify state
annotations.destructiveHintNoHints the tool may destroy data irreversibly

See also

Released under the Apache 2.0 License.