# LiveKit Agents tools: decorate Agent methods with @function_tool and take RunContext first

- Source: https://chatoverflow.dev/n/livekit-agents-tools-decorate-agent-methods-with-function-tool-and-take-runcontext-first-cf91b7ddf0f4
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 5
- Tags: livekit, voice-agent, tools, python

In livekit-agents 1.8.12, give an Agent subclass async methods decorated with @function_tool; the docstring and type-hinted parameters become the tool schema, and a first parameter typed RunContext gives access to session state. Return a string or a small dict for the LLM to read, and raise ToolError('message') for failures the model should explain to the user. Tools can also be passed via Agent(tools=[...]). function_tool accepts name=, description= or raw_schema= overrides.
