Implementation:CrewAIInc CrewAI Generate Automation Tool
| Knowledge Sources | |
|---|---|
| Domains | Tools, CrewAI_Platform, Automation |
| Last Updated | 2026-02-11 00:00 GMT |
Overview
Generates complete CrewAI automations from natural language prompts by calling the CrewAI Studio API.
Description
GenerateCrewaiAutomationTool extends BaseTool to provide meta-automation capabilities. It accepts a prompt describing the desired automation and an optional organization_id, then makes a POST request to the CrewAI AMP Studio API endpoint (/crewai_plus/api/v1/studio) with Bearer token authentication. The tool loads its configuration from environment variables: CREWAI_PERSONAL_ACCESS_TOKEN for authentication and CREWAI_PLUS_URL for the base URL (default: https://app.crewai.com). It returns the generated Studio project URL from the API response.
Usage
Use this tool when a CrewAI agent needs to programmatically generate other CrewAI workflows, enabling self-improving systems and rapid automation prototyping based on natural language requirements.
Code Reference
Source Location
- Repository: CrewAI
- File:
lib/crewai-tools/src/crewai_tools/tools/generate_crewai_automation_tool/generate_crewai_automation_tool.py - Lines: 1-71
Signature
class GenerateCrewaiAutomationTool(BaseTool):
name: str = "Generate CrewAI Automation"
description: str = "A tool that leverages CrewAI Studio's capabilities to automatically generate ..."
args_schema: type[BaseModel] = GenerateCrewaiAutomationToolSchema
crewai_enterprise_url: str = ...
personal_access_token: str | None = ...
def _run(self, **kwargs) -> str: ...
Import
from crewai_tools import GenerateCrewaiAutomationTool
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| prompt | str | Yes | Natural language description of the automation to generate |
| organization_id | str | No | CrewAI AMP organization identifier; uses default if not specified |
Outputs
| Name | Type | Description |
|---|---|---|
| _run() returns | str | Message containing the generated CrewAI Studio project URL |
Usage Examples
Basic Usage
from crewai_tools import GenerateCrewaiAutomationTool
tool = GenerateCrewaiAutomationTool()
result = tool.run(
prompt="Generate a CrewAI automation that scrapes a website and stores the data in a database"
)
With Organization ID
from crewai_tools import GenerateCrewaiAutomationTool
tool = GenerateCrewaiAutomationTool(
crewai_enterprise_url="https://app.crewai.com",
personal_access_token="your-token",
)
result = tool.run(
prompt="Build a research agent crew",
organization_id="org-12345",
)