built-in-tools.mdx 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. ---
  2. title: "Built-in Tools"
  3. description: "Learn how to use built-in tools in Agency Swarm."
  4. icon: "wrench"
  5. ---
  6. In the latest version, Agency Swarm leverages tools from the [Agents SDK](https://openai.github.io/openai-agents-python/ref/tool/). This provides access to a comprehensive set of production-ready tools maintained by OpenAI.
  7. ## Available Tools
  8. The agents SDK provides the following built-in tools:
  9. ### Hosted Tools
  10. - **`WebSearchTool`** - Lets an agent search the web
  11. - **`FileSearchTool`** - Allows retrieving information from your OpenAI Vector Stores
  12. - **`ComputerTool`** - Allows automating computer use tasks
  13. - **`CodeInterpreterTool`** - Lets the LLM execute code in a sandboxed environment
  14. - **`ImageGenerationTool`** - Generates images from a prompt
  15. - **`LocalShellTool`** - Runs shell commands on your machine
  16. ### Function Tools
  17. - **`FunctionTool`** - Custom function-based tools using the `@function_tool` decorator
  18. ### MCP (Model Context Protocol) Tools
  19. - **`HostedMCPTool`** - Exposes a remote MCP server's tools to the model
  20. **When to use each tool:**
  21. - **Web Search**: Real-time information retrieval, current events, up-to-date data
  22. - **File Search**: Enriching agent knowledge, reducing hallucinations, querying documents
  23. - **Computer Tool**: Automating computer use tasks, UI interactions, testing applications
  24. - **Code Interpreter**: Data analysis, calculations, executing code in a sandboxed environment
  25. - **Image Generation**: Creating visual content, illustrations, design assets from prompts
  26. - **Local Shell**: System administration, file operations, running shell commands
  27. - **Function Tool**: Creating custom tools with specific business logic using Python functions
  28. - **Hosted MCP Tool**: Accessing tools from remote Model Context Protocol servers
  29. ### WebSearchTool Sources (all checked URLs)
  30. ```python
  31. from agency_swarm import Agent, WebSearchTool
  32. agent = Agent(
  33. name="ResearchAgent",
  34. instructions="Search the web and summarize the best sources.",
  35. tools=[WebSearchTool()],
  36. )
  37. ```
  38. Use `include_web_search_sources=False` if you do not want source URLs in web-search tool calls.
  39. For detailed documentation and additional configuration options, refer to the [agents SDK tool documentation](https://openai.github.io/openai-agents-python/ref/tool/).