Update tool code, debug errors usingDocumentation Index
Fetch the complete documentation index at: https://docs.poly.ai/llms.txt
Use this file to discover all available pages before exploring further.
conv.log, rotate API credentials, and fix integration issues without taking the agent offline.
Quick reference
| I need to… | Action |
|---|---|
| Update tool code | Edit in Function Editor → Save → Test in Agent Chat |
| Debug a tool error | Analytics > Conversations → Diagnosis → check logs |
| Update API credentials | Workspace homepage > Secrets tab → Edit → Save |
| Add logging | Use conv.log.info() in code |
| Fix tool not triggering | Review KB action or rules → clarify description |
| Update API integration | Configure > APIs → edit endpoint |
Updating tool code
- Go to Build > Tools and select the tool
- Edit the Python function in the Function Editor
- Save, then test in Agent Chat
- Review logs in Conversation Review → Diagnosis
- Publish when satisfied
Example: updating an API endpoint
Debugging
Using conv.log
Common debugging steps
- Review Diagnosis logs for the failing tool
- Reproduce the issue in Agent Chat
- Check tool inputs – are parameters being passed correctly?
- Validate external APIs directly (Postman, curl)
- Review the tool description – is it clear when the tool should trigger?
Common errors
| Error | Likely cause | Fix |
|---|---|---|
| Tool not triggering | Unclear description or KB action | Simplify description; clarify when to call it |
| Wrong parameters | LLM misunderstanding | Improve parameter names and descriptions |
| Timeout | Slow API or complex logic | Add delay controls; optimize code |
| Auth failures | Expired credentials | Update secrets |
| Import errors | Missing library | Check available libraries |
Managing secrets
When API keys or credentials change:- Go to the Secrets tab on the workspace homepage
- Find and edit the secret
- Save, then test all tools using it
- Rotate credentials every 90 days
- Use descriptive names (
stripe_live_api_key, notkey1) - Test all dependent tools after rotation
Managing API integrations
Configure per-environment endpoints in Configure > APIs:- Sandbox – test/staging endpoints
- Pre-release – UAT endpoints
- Live – production endpoints
Optimizing performance
If tools are slow:- Add delay controls with filler phrases (“Let me check that for you.”)
- Cache frequently-accessed data
- Reduce unnecessary API calls
- Simplify logic and remove unnecessary processing
Improving tool triggering
If the agent isn’t calling your tool when expected:- Simplify the description – make it clear when to call the tool
- Update KB actions – ensure topics reference the tool correctly
- Check for conflicts – ensure other tools aren’t being called instead
Related pages
- Tools overview – tool capabilities
- Secrets – credential management
- conv.log reference – structured logging
- Delay controls – managing latency
- Test sets – automated regression testing to verify tool changes
- Alerts API – automated alerts for tool errors, latency, and API failures

