What Tools Are Supported by Qwen-Agent? A Complete Guide to the Built-in Toolbox

Qwen-Agent supports a comprehensive suite of tools including web search, document parsing, code execution, image generation, retrieval-augmented generation, and external API integrations, all extensible through a unified base interface.

The Qwen-Agent framework from the QwenLM organization provides a modular architecture for building AI agents. Understanding what tools are supported by Qwen-Agent is essential for developers looking to create sophisticated workflows that extend beyond simple text generation.

Overview of Qwen-Agent Tools

All tools in Qwen-Agent inherit from a common base class defined in qwen_agent/tools/base.py. This ensures every tool implements a consistent run(**kwargs) signature, allowing agents to invoke them interchangeably. The tools are organized under the qwen_agent/tools/ package and cover everything from information retrieval to code execution.

Built-in Tool Categories

Web Search and Extraction Tools

The framework provides robust capabilities for accessing real-time information through qwen_agent/tools/web_search.py and qwen_agent/tools/web_extractor.py. These enable agents to perform general web queries and extract structured content from specific URLs. Additionally, the qwen_agent/tools/search_tools/ directory contains specialized implementations including keyword search, vector search, and hybrid search for more targeted information retrieval.

Document Parsing and Retrieval

For handling local knowledge bases, Qwen-Agent includes qwen_agent/tools/simple_doc_parser.py and qwen_agent/tools/doc_parser.py to load and process various document formats including PDF, HTML, and TXT files. The qwen_agent/tools/retrieval.py module combines these parsing capabilities with vector stores to fetch relevant document chunks for retrieval-augmented generation (RAG) workflows.

Code Execution and Interpretation

The qwen_agent/tools/code_interpreter.py module provides safe Python execution environments through python_executor.py and code_interpreter_init_kernel.py. This allows agents to perform mathematical calculations, data analysis, and algorithmic reasoning by executing code in isolated kernels.

Multimodal and Vision Tools

Qwen-Agent extends beyond text with qwen_agent/tools/image_search.py for finding relevant images and qwen_agent/tools/image_gen.py for generating visual content. The specialized image_zoom_in_qwen3vl.py tool enables detailed visual analysis by zooming into specific regions using Qwen-3-VL capabilities.

External API Integrations

The framework supports real-world data access through qwen_agent/tools/amap_weather.py for weather information and qwen_agent/tools/mcp_manager.py for managing multi-channel plugins and external service integrations.

Storage and Persistence

The qwen_agent/tools/storage.py module provides mechanisms for persisting tool-generated artifacts, embeddings, and intermediate results across agent sessions.

How to Use Qwen-Agent Tools

Web Search and Content Extraction

from qwen_agent.tools.web_search import WebSearchTool
from qwen_agent.tools.web_extractor import WebExtractorTool

# Search the web for a query

search = WebSearchTool()
results = search.run(query="latest python 3.12 release notes")

# Extract the most relevant page

extractor = WebExtractorTool()
content = extractor.run(url=results[0]["url"])
print(content[:500])   # preview the extracted text

Keyword-Based Document Retrieval

from qwen_agent.tools.search_tools.keyword_search import KeywordSearchTool

kw_tool = KeywordSearchTool(index_path="data/doc_index")
hits = kw_tool.run(keyword="quantum computing")
for hit in hits[:3]:
    print(hit["snippet"])

Running Python Code Safely

from qwen_agent.tools.code_interpreter import CodeInterpreterTool

ci = CodeInterpreterTool()
output = ci.run(code="""
def fib(n):
    a, b = 0, 1
    for _ in range(n):
        a, b = b, a + b
    return a
print(fib(10))
""")
print(output)   # → 55

Generating Images

from qwen_agent.tools.image_gen import ImageGenTool

gen = ImageGenTool()
img_path = gen.run(prompt="A futuristic city skyline at sunset, photorealistic")
print(f"Image saved to {img_path}")

Extending the Toolbox with Custom Tools

All tools inherit from the abstract base class in qwen_agent/tools/base.py, which enforces a uniform run(**kwargs) interface. Developers can create custom tools by subclassing this base and implementing the run method. The examples/assistant_add_custom_tool.py file demonstrates how to register and integrate custom tools into agent workflows.

Summary

  • Qwen-Agent provides a comprehensive built-in toolbox covering web search, document parsing, code execution, image generation, and external APIs.
  • All tools inherit from qwen_agent/tools/base.py, ensuring consistent interfaces through the run(**kwargs) method.
  • Key modules include web_search.py, doc_parser.py, code_interpreter.py, retrieval.py, and image_gen.py.
  • Tools are composable and can be combined in agents like react_chat or router to build complex workflows.
  • The framework is extensible via the base tool class, allowing developers to add custom integrations.

Frequently Asked Questions

What types of web search tools does Qwen-Agent support?

Qwen-Agent includes general web search through web_search.py, content extraction via web_extractor.py, and specialized search algorithms in the search_tools/ directory. These include keyword search, vector search, hybrid search, and front-page search capabilities, allowing agents to retrieve information using different retrieval strategies depending on the use case.

How does Qwen-Agent handle document parsing and retrieval?

The framework provides simple_doc_parser.py and doc_parser.py to load and process PDF, HTML, and TXT files. For retrieval, retrieval.py combines these parsers with vector stores to implement RAG (Retrieval-Augmented Generation) workflows. The search_tools/ module also provides extract_doc_vocabulary.py for indexing document content.

Can I execute Python code safely within Qwen-Agent?

Yes, the code_interpreter.py module provides sandboxed Python execution through python_executor.py and code_interpreter_init_kernel.py. This allows agents to perform calculations, data analysis, and algorithmic tasks without compromising system security. The tool returns stdout output and supports stateful execution across multiple code blocks.

Is it possible to add custom tools to Qwen-Agent?

Absolutely. All tools inherit from the abstract base class in qwen_agent/tools/base.py, which requires implementing a run(**kwargs) method. Developers can subclass this base class to create custom integrations, then register them with agents as demonstrated in examples/assistant_add_custom_tool.py. This extensibility allows integration with proprietary APIs, databases, or specialized computation engines.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →