Files
crewAI/docs
Mateus Braga eb281c6d73 fix(tools): fall back to CREWAI_API_URL/CREWAI_BEARER_TOKEN env vars
InvokeCrewAIAutomationTool required crew_api_url and crew_bearer_token
as positional __init__ arguments with no environment-variable fallback,
even though docs.crewai.com documents CREWAI_API_URL/CREWAI_BEARER_TOKEN
as alternatives. It also could not be instantiated with zero arguments,
which blocks CrewAI AMP Studio's "Invoke Amp Automation" internal tool:
the Studio runtime resolves tools by class reference and instantiates
them with no arguments.

- crew_api_url/crew_bearer_token become optional, falling back to
  CREWAI_API_URL/CREWAI_BEARER_TOKEN (explicit args still win), mirroring
  the env-var pattern already used by GenerateCrewaiAutomationTool.
- crew_name/crew_description become optional too, defaulting to the
  tool's existing generic name/description, so
  InvokeCrewAIAutomationTool() never raises at construction time.
- Declare env_vars: list[EnvVar] so the tool catalog surfaces the two
  env vars, matching the sibling tool.
- Raise a clear ValueError at use time when crew_api_url/crew_bearer_token
  are still missing, instead of failing inside `requests` or with the
  previous confusing TypeError about positional arguments.
- Update the tool's README and the edge docs page
  (docs/edge/en/tools/integration/crewaiautomationtool.mdx) so the "Tool
  Arguments" table matches the corrected code.

Fully backward compatible: existing positional/keyword constructor calls
are unchanged. tool.specs.json is left untouched; the
"Generate Tool Specifications" CI workflow regenerates and commits it
automatically once this is pushed.

crewAIInc/crewAI-tools (the previous home of this tool) is archived and
can no longer receive pushes, so this fix targets the actively
maintained copy of the tool under lib/crewai-tools/ instead.
2026-09-11 15:47:12 +00:00
..