> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://poly-ai.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://poly-ai.ferndocs.com/_mcp/server.

# Tools

> Add custom logic and API integrations using Python functions.

**This section requires Python familiarity.** If you are a non-technical operator, share this page with your developer. For no-code alternatives, see [FAQs](/agent-studio/knowledge/fa-qs/fa-qs) (actions) or [no-code flows](/agent-studio/flows/no-code/overview).

Functions let your agent perform actions during a conversation — looking up a booking, calling an API, validating input, or writing to a CRM.

If you are looking for a function that only exists inside a single [flow](/agent-studio/flows/overview), visit the [transition functions](/advanced/code-driven-flows/transition-functions) page.

Functions are Python scripts for deterministic logic and API integrations. Use [`conv.log`](/agent-studio/tools/classes-and-objects/log) to write logs visible in **[Conversation review](/agent-studio/conversations/review) → [Diagnosis](/agent-studio/conversations/diagnosis)**.

For detailed guides, explore the subpages below:

## Guides

#### [Create a function](/agent-studio/tools/create-tool)

Set up a function with naming conventions, parameters, and Python code

#### [Libraries](/agent-studio/tools/libraries)

Standard and non-standard libraries available in your functions

#### [Start tool](/agent-studio/tools/start-tool)

Initialize conversation context before the greeting plays

#### [End tool](/agent-studio/tools/end-tool)

Run post-call processing after a conversation ends

#### [Return values](/agent-studio/tools/return-values)

Control agent behavior with string and dictionary returns

#### [Variables](/agent-studio/tools/variables)

Define, update, and persist values across turns

#### [Using tools in topics](/agent-studio/tools/using-tools)

Integrate functions into FAQs

#### [Delay control](/agent-studio/tools/delay-control)

Add filler phrases to avoid silence during slow functions

## Reference

#### [conv object](/agent-studio/tools/classes-and-objects/object)

Conversation states, flows, and telephony attributes

#### [conv.log](/agent-studio/tools/classes-and-objects/log)

Structured diagnostics and PII-scoped logging

#### [conv.utils](/agent-studio/tools/classes-and-objects/utilities)

Built-in helpers for addresses, cities, and structured data

#### [conv.api](/agent-studio/tools/classes-and-objects/api)

Call configured API integrations

#### [ASR biasing](/agent-studio/tools/classes-and-objects/asr-biasing)

Dynamic speech recognition biasing from functions

#### [History](/agent-studio/tools/classes-and-objects/history)

Access conversation turn history

#### [Voice](/agent-studio/tools/classes-and-objects/voice)

Configure TTS voices programmatically

#### [Tool classes](/agent-studio/tools/classes-and-objects/classes)

VoiceWeighting, TTSVoice, and provider classes

#### [Agent memory](/agent-studio/tools/classes-and-objects/agent-memory)

Persistent data across conversations for repeat callers

If you are looking to use functions to enable multi-site configuration – for example, handling enquiries for multiple store or branch locations – visit the [Variants](/agent-studio/knowledge/variants/overview) feature page.

## Best practices

* **Use descriptive names** – Action-oriented names like `book_reservation` or `send_notification` help the LLM understand when to call the function.
* **Write clear descriptions** – Explain what the function does, its parameters, and when it should be triggered.
* **Use meaningful parameter names** – `reservation_date` is clearer than `r_date`.
* **Control triggering** – Define specific [rules](/agent-studio/behavior/general/behavior) to prevent over-triggering or under-triggering.
* **Test thoroughly** – Use [Test Cases and Test Sets](/agent-studio/testing/simulation-tests) to validate function behavior across scenarios.

## Troubleshooting

* **Function not triggering** – Check **Conversation review → Diagnosis** to see if the function was considered. Refine your function description or add clearer rules.
* **Wrong parameters** – Review `conv.log` entries to see what the LLM extracted. Adjust parameter descriptions or add validation.
* **Unexpected behavior** – Simplify function logic and test in isolation before integrating with the agent.