Available Tools
Heroku provides the following built-in tools for agents:- dyno_run_command - Execute custom commands on your Heroku app
- code_exec_ruby - Execute Ruby code with gem dependencies (learn more)
- code_exec_python - Execute Python code with package dependencies (learn more)
- code_exec_go - Execute Go code with module dependencies (learn more)
- code_exec_node - Execute Node.js code with npm dependencies (learn more)
- pg_psql - Run SQL queries on Heroku Postgres databases (learn more)
- doc_reader - Summarize documentation and surface relevant snippets (learn more)
- pg_vector_query - Perform vector similarity searches with pgvector
Security
Tool Definitions
dyno_run_command
Execute custom commands on your Heroku app. This tool allows agents to run pre-specified commands, making existing code available for LLM use. Use Cases:- Run data processing scripts
- Execute application-specific commands
- Trigger scheduled tasks on-demand
- Run diagnostic or health check commands
cmd(required) - The command to executedescription(required) - Description of what the command doesparameters(optional) - Input schema for command parameters
code_exec_ruby
Execute Ruby code with optional gem dependencies in an isolated environment. Use Cases:- Perform data transformations
- Run Ruby calculations or algorithms
- Test Ruby code snippets
- Process JSON or text data
code(required) - Ruby code to executepackages(optional) - Array of gem names to install
code_exec_python
Execute Python code with optional package dependencies in an isolated environment. Use Cases:- Data analysis and manipulation
- Mathematical computations
- API data processing
- Testing Python algorithms
code(required) - Python code to executepackages(optional) - Array of package names to install via pip
code_exec_go
Execute Go code with optional module dependencies in an isolated environment. Use Cases:- High-performance computations
- Concurrent processing tasks
- System-level operations
- Testing Go algorithms
code(required) - Go code to executepackages(optional) - Array of Go module paths to install
code_exec_node
Execute Node.js code with optional npm package dependencies in an isolated environment. Use Cases:- JavaScript/TypeScript computations
- Async operations and promises
- JSON data manipulation
- Testing Node.js code
code(required) - Node.js code to executepackages(optional) - Array of npm package names to install
pg_psql
Execute SQL queries against Heroku Postgres databases. Works like theheroku pg:psql CLI command.
Use Cases:
- Query database tables and schemas
- Analyze data with SQL aggregations
- Check database statistics and performance
- Retrieve specific records for analysis
query(required) - SQL query to executedb_attachment(optional) - Database config var name (default:DATABASE_URL)
pg_vector_query
Perform vector similarity searches using pgvector on Heroku Postgres databases. Use Cases:- Semantic search over embedded documents
- Find similar records by vector similarity
- Retrieval-augmented generation (RAG)
- Recommendation systems
query_vector(required) - Vector to search for (array of floats)table_name(required) - Table containing vector columnvector_column(required) - Name of the vector columnlimit(optional) - Number of results to return (default: 10)db_attachment(optional) - Database config var name (default:DATABASE_URL)
Runtime Configuration
All Heroku tools support these runtime parameters:target_app_name
string · required Name of the Heroku app where the tool will execute.dyno_size
string · optional · default:"standard-1x"
Dyno size for tool execution. Options: standard-1x, standard-2x, performance-m, performance-l.
ttl_seconds
integer · optional · default:120
Maximum execution time in seconds. Range: 1-120 seconds.
max_calls
integer · optional · default:3
Maximum number of times this tool can be called during the agent loop.
tool_params
object · optional Tool-specific configuration parameters. See individual tool documentation for available options.Best Practices
Security
- Always use follower databases for read-only operations
- Set appropriate
max_callslimits to prevent excessive tool usage - Use
ttl_secondsto prevent long-running operations
Performance
- Choose appropriate
dyno_sizebased on workload - Keep code execution lightweight and focused
- Use database indexes for vector queries
Error Handling
- Provide clear descriptions to help agents understand tool purpose
- Test tools independently before using in agent workflows
- Monitor tool execution logs for errors
Related Resources
Agents API
Learn how to use tools with agents
Working with MCP
Deploy custom MCP tools
pgvector
Set up vector similarity search