> ## Documentation Index
> Fetch the complete documentation index at: https://docs.poly.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 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 [Managed Topics](/managed-topics/introduction) (actions) or [no-code flows](/flows/no-code/introduction).

Functions let your agent act, not just talk – look up a booking, call an API, validate input, or write to a CRM.

If you are looking for a function that only exists inside a single [flow](/flows/introduction), visit the [transition functions](/flows/transition-functions) page.

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

For detailed guides, explore the subpages below:

## Guides

<CardGroup cols={2}>
  <Card title="Create a function" icon="plus" href="./how-to-setup">
    Set up a function with naming conventions, parameters, and Python code
  </Card>

  <Card title="Libraries" icon="book" href="./import-library">
    Standard and non-standard libraries available in your functions
  </Card>

  <Card title="Start tool" icon="play" href="./start-tool">
    Initialize conversation context before the greeting plays
  </Card>

  <Card title="End tool" icon="stop" href="./end-tool">
    Run post-call processing after a conversation ends
  </Card>

  <Card title="Return values" icon="reply" href="./return-values">
    Control agent behavior with string and dictionary returns
  </Card>

  <Card title="Variables" icon="database" href="./variables">
    Define, update, and persist values across turns
  </Card>

  <Card title="Using tools in topics" icon="link" href="./using-tools-in-knowledge-base">
    Integrate functions into Managed Topics
  </Card>

  <Card title="Delay control" icon="clock" href="./delay-control">
    Add filler phrases to avoid silence during slow functions
  </Card>
</CardGroup>

## Reference

<CardGroup cols={2}>
  <Card title="conv object" icon="code" href="./classes/conv-object">
    Conversation states, flows, and telephony attributes
  </Card>

  <Card title="conv.log" icon="file-lines" href="./classes/conv-log">
    Structured diagnostics and PII-scoped logging
  </Card>

  <Card title="conv.utils" icon="wrench" href="./classes/conv-utils">
    Built-in helpers for addresses, cities, and structured data
  </Card>

  <Card title="conv.api" icon="plug" href="./classes/conv-api">
    Call configured API integrations
  </Card>

  <Card title="ASR biasing" icon="microphone" href="./classes/asr-from-conv">
    Dynamic speech recognition biasing from functions
  </Card>

  <Card title="History" icon="clock-rotate-left" href="./classes/history">
    Access conversation turn history
  </Card>

  <Card title="Voice" icon="volume-high" href="./classes/voice">
    Configure TTS voices programmatically
  </Card>

  <Card title="Tool classes" icon="cube" href="./classes">
    VoiceWeighting, TTSVoice, and provider classes
  </Card>

  <Card title="Agent memory" icon="brain" href="./classes/agent-memory">
    Persistent data across conversations for repeat callers
  </Card>
</CardGroup>

If you are looking to use functions to enable multi-site configuration – for example, handling enquiries for multiple store or branch locations – visit the [variant management](/variant-management/introduction) 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-settings/rules) to prevent over-triggering or under-triggering.
* **Test thoroughly** – Use [Test Cases and Test Sets](/analytics/test-suite/introduction) 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.
