liveBook · Manning

Tool decorator

A tool decorator is a programming-language decorator that marks a function as an externally callable tool and can attach metadata or a parameter schema.

How 2 Manning books explain it

Digital Twins in Action

A decorator that marks a Python function as a callable tool for an AI agent.

How it is used
Exposes current inverter output to an agent deciding whether excess solar power can support home climate control.
How deep it goes
Shows a decorated function and its input-and-return documentation, but does not explain decorator internals.
Examples
Uses a local inverter query alongside weather-forecast and home-digital-twin API tools.
What you can do after
Apply it via the Strands SDK to make a documented Python function callable by an agent.

Read how Digital Twins in Action explains tool decorator →

Data Analysis with LLMs

The LangChain tool decorator is a Python decorator that converts a function into a tool with metadata describing its name, parameters, and behavior.

How it is used
Turns custom Python functions into tools that agents can invoke.
How deep it goes
Explains decorator placement, function naming, and type annotations; does not detail decorator internals.
Examples
Uses a currency-conversion function to support analysis of video-game sales across currencies.
What you can do after
Build it from scratch: decorate a typed Python function for use as an agent tool.

Read how Data Analysis with LLMs explains tool decorator →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.