Skip to main content

What You’ll Learn

  • Defining a @tool with crewai.tools that executes Python in a Declaw sandbox
  • Creating a CrewAI Agent, Task, and Crew
  • Demo mode that exercises the sandbox tool directly without needing an OpenAI key

Prerequisites

  • Declaw instance running and DECLAW_API_KEY / DECLAW_DOMAIN set
  • OPENAI_API_KEY (optional — the example runs in demo mode without it)
This example is available in Python. TypeScript support coming soon.

Code Walkthrough

1. Define the Declaw sandbox tool

Use the crewai.tools @tool decorator with a display name as the first argument:
CrewAI uses the docstring as the tool’s description when presenting it to the LLM. Keep it concise and accurate.

2. Create an Agent with the tool

3. Define a Task and run the Crew

4. Demo mode (no API key needed)

Run the sandbox tool directly to verify it works before hooking it up to CrewAI:

Expected Output

In demo mode: