Built-in Tools
Complete reference for all built-in tools available in Xagent, organized by category.Basic Tools
web_search
Search the internet for current information. Capabilities:- Find recent news and information
- Research topics online
- Get current data
- Fact-check statements
query(required) - Search querynum_results(optional) - Number of results to return (default: 10)include_content(optional) - Whether to include full page content
- Search results with titles, links, and snippets
- Full page content (if requested)
- Source information
python_executor
Execute Python code safely for data analysis and computation. Capabilities:- Run Python code
- Data analysis with pandas
- Visualization with matplotlib
- Mathematical computations
- Data transformations
code(required) - Python code to executelibraries- Available libraries: pandas, numpy, matplotlib, etc.
- Output from code execution
- Error messages if code fails
- Displayed figures (saved as images)
Knowledge Tools
list_knowledge_bases
List all available knowledge bases. Capabilities:- See all knowledge bases in your workspace
- Get document and chunk counts
- Check knowledge base status
- None (automatically uses accessible knowledge bases)
- List of knowledge base names
- Document counts
- Chunk counts
- Embedding model information
search_knowledge_base
Search for relevant documents in your knowledge bases. Capabilities:- Find relevant information
- Semantic search with embeddings
- Keyword search
- Hybrid search (semantic + keyword)
query(required) - Search querycollections(optional) - Specific knowledge bases to searchsearch_type(optional) - “dense”, “sparse”, or “hybrid” (default: “hybrid”)top_k(optional) - Maximum results per knowledge base (default: 5)min_score(optional) - Minimum relevance score (default: 0.3)
- Relevant document chunks
- Relevance scores
- Source document names
- Section/page references
File Tools
read_file
Read content from text files. Capabilities:- Read text files (TXT, MD, CSV, JSON, etc.)
- Parse PDF documents
- Extract text from DOCX
- Read Excel files
file_path(required) - Path to file in workspace
- File content as text
- Document structure for complex formats
- Metadata (page count, sections, etc.)
write_file
Write content to files. Capabilities:- Create new text files
- Save results
- Generate reports
- Export data
file_path(required) - Path where to save the filecontent(required) - Content to write
- Success status
- Saved file path
- File size
list_files
List files and directories in workspace. Capabilities:- Browse workspace structure
- Find files by pattern
- Check directory contents
directory_path(optional) - Directory to list (default: workspace root)pattern(optional) - File pattern to match
- List of files and directories
- File sizes and types
- Directory structure
edit_file
Edit existing file content. Capabilities:- Replace text
- Insert new content
- Delete sections
- Multiple replacements at once
file_path(required) - Path to fileoperations(required) - List of edit operationsoperation- “replace”, “insert”, or “delete”old_text- Text to replace (for replace operation)new_text- New text (for replace/insert operations)
- Success status
- Number of changes made
- Updated file content preview
document_parser
Parse various document formats. Supported Formats:- PDF (.pdf)
- Word (.doc, .docx)
- PowerPoint (.pptx)
- Excel (.xlsx, .xls)
- Images (.png, .jpg) for OCR
- HTML (.html, .htm)
file_path(required) - Path to documentparse_method(optional) - Parsing method (default, pypdf, pdfplumber, etc.)
- Extracted text content
- Document structure
- Tables (for spreadsheet files)
- Metadata
Vision Tools
understand_images
Analyze images and answer questions about them. Capabilities:- Understand image content
- Answer specific questions
- Extract information
- OCR and text recognition
- Chart and graph analysis
images(required) - List of image paths or URLsquestion(optional) - Specific question about images
- Detailed answer to question
- Description of image content
- Detected text (OCR)
- Object information
describe_images
Generate detailed descriptions of images. Capabilities:- Generate comprehensive image descriptions
- Identify elements and objects
- Describe scenes and activities
- Extract text from images
images(required) - List of image paths or URLs
- Detailed textual description
- Key elements identified
- Context and setting
detect_objects
Detect and identify objects in images. Capabilities:- Find objects in images
- Count occurrences
- Locate positions
- Object categories
images(required) - List of image paths or URLsobjects(optional) - Specific objects to detect
- Detected objects list
- Bounding boxes
- Confidence scores
- Object counts
Image Tools
generate_image
Generate images from text descriptions. Capabilities:- Create images from text
- Various styles and formats
- Automatic prompt optimization
- Text handling in images
prompt(required) - Description of desired imagesize(optional) - Image size (default: “1024*1024”)model_id(optional) - Specific model to use
- Generated image URL
- Image file path (saved to workspace)
- Generation metadata
edit_image
Edit and modify existing images. Capabilities:- Modify image content
- Change styles
- Add/remove elements
- Combine multiple images
image_url(required) - Source image(s) to editprompt(required) - Description of desired changesmodel_id(optional) - Specific model to use
- Edited image URL
- Image file path (saved to workspace)
- Edit metadata
Browser Tools
browser_automation
Automate web browser interactions using Playwright. Capabilities:- Navigate to websites
- Click buttons and links
- Fill forms
- Extract data
- Take screenshots
- Manage multiple tabs
actions(required) - List of browser actionsaction- “goto”, “click”, “fill”, “screenshot”, etc.selector- CSS selector for elementvalue- Value to input or text to find
- Screenshot images
- Extracted data
- Action results
- Page information
- Anti-detection settings
- Multi-tab support
- Session persistence
- Error recovery
Special Image Tools
search_images
Search for images on the web. Capabilities:- Find images by query
- Get image URLs
- Browse image collections
query(required) - Search query for imagesnum_results(optional) - Number of results (default: 10)
- Image URLs
- Image sources
- Thumbnail links
logo_overlay
Add logo overlay to images. Capabilities:- Place logo on images
- Position control
- Size adjustment
- Opacity settings
image_url(required) - Base imagelogo_url(required) - Logo imageposition(optional) - Logo position (default: “top-right”)opacity(optional) - Logo opacity (default: 0.8)
- Composite image URL
- Saved file path
Tool Requirements
Some tools require specific models or configurations:| Tool | Requirement |
|---|---|
understand_images, describe_images, detect_objects | Vision model (multimodal LLM) |
generate_image, edit_image | Image generation model |
search_knowledge_base | Embedding model + knowledge base |
web_search | Search API credentials |
browser_automation | Browser automation enabled |
Best Practices
Choosing Tools
- Web search - For current events and online information
- Knowledge base - For domain-specific documentation
- File operations - For working with uploaded files
- Vision tools - For image analysis and OCR
- Image generation - For creating visual content
- Python executor - For data analysis and computation
- Browser automation - For web scraping and automation
Tool Chaining
Xagent can use multiple tools in sequence:Error Handling
Tools automatically handle errors:- Retry failed operations
- Provide clear error messages
- Suggest alternatives
- Fall back to safe defaults
Next Steps
- Tools Overview - Learn about tool categories
- Building Agents - Configure tools in your agents
- Models - Configure models required for tools