# CxIDE — Agent Tools Reference 56 tools across 8 categories, available in-process via AgentService or standalone via CxSwiftAgent CLI. ## File Operations (10 tools) | Tool | Read-Only | Description | | ---- | --------- | ----------- | | `file_read` | Yes | Read file contents with optional line range | | `file_write` | No | Write or create a file | | `file_patch` | No | Apply a targeted patch to a file | | `file_search` | Yes | Search file contents with regex or text | | `file_list` | Yes | List directory contents | | `file_tree` | Yes | Show directory tree structure | | `file_info` | Yes | Get file metadata (size, dates, permissions) | | `file_delete` | No | Delete a file or directory | | `file_move` | No | Move or rename a file | | `file_find` | Yes | Find files matching a glob pattern | ## Code Intelligence (10 tools) | Tool | Read-Only | Description | | ---- | --------- | ----------- | | `code_complete` | Yes | Generate code completions | | `code_explain` | Yes | Explain code functionality | | `code_review` | Yes | Review code for issues and improvements | | `code_refactor` | Yes | Suggest refactoring improvements | | `code_fix` | No | Auto-fix code issues | | `code_document` | No | Generate documentation comments | | `code_test` | Yes | Generate unit tests | | `code_security` | Yes | Security vulnerability scan | | `code_symbols` | Yes | Extract symbols (functions, classes, etc.) | | `code_diff_explain` | Yes | Explain a code diff | ## Git (8 tools) | Tool | Read-Only | Description | | ---- | --------- | ----------- | | `git_status` | Yes | Show working tree status | | `git_diff` | Yes | Show file differences | | `git_log` | Yes | Show commit history | | `git_commit` | No | Create a commit | | `git_branch` | No | Create, list, or switch branches | | `git_blame` | Yes | Show line-by-line authorship | | `git_stash` | No | Stash or pop changes | | `git_show` | Yes | Show commit details | ## Project (5 tools) | Tool | Read-Only | Description | | ---- | --------- | ----------- | | `project_detect` | Yes | Detect project type and structure | | `project_run` | No | Run the project | | `project_deps` | Yes | List project dependencies | | `project_config` | Yes | Read project configuration | | `project_create` | No | Create a new project from template | ## Terminal (2 tools) | Tool | Read-Only | Description | | ---- | --------- | ----------- | | `terminal_exec` | No | Execute a shell command | | `terminal_env` | Yes | Read environment variables | ## Xcode (10 tools) | Tool | Read-Only | Description | | ---- | --------- | ----------- | | `xcode_build` | No | Build an Xcode project | | `xcode_test` | No | Run Xcode tests | | `xcode_analyze` | Yes | Run static analyzer | | `xcode_schemes` | Yes | List available schemes | | `xcode_devices` | Yes | List simulators and devices | | `xcode_swift_check` | Yes | Swift syntax check | | `xcode_clean` | No | Clean build folder | | `xcode_archive` | No | Archive for distribution | | `xcode_provisioning` | Yes | Check provisioning profiles | | `xcode_swift_format` | No | Format Swift code | ## Diagnostics (5 tools) | Tool | Read-Only | Description | | ---- | --------- | ----------- | | `diag_workspace` | Yes | Full workspace health check | | `diag_lint` | Yes | Lint source files | | `diag_todo` | Yes | Find TODO/FIXME/HACK markers | | `diag_duplicates` | Yes | Detect duplicate code | | `diag_complexity` | Yes | Measure cyclomatic complexity | ## AutoPilot (6 tools) | Tool | Read-Only | Description | | ---- | --------- | ----------- | | `autopilot_plan` | Yes | Generate a multi-step plan for a task | | `autopilot_execute` | No | Execute a plan step | | `autopilot_memory` | Yes | Query agent session memory | | `autopilot_context` | Yes | Gather context for a task | | `autopilot_diff` | Yes | Preview changes before applying | | `autopilot_status` | Yes | Check autopilot execution status | ## Sandbox Mode When `sandboxMode` is enabled (via `CX_SANDBOX=true` or toggle), only the 30 read-only tools are permitted. Write, delete, commit, and execution tools are blocked. ## Usage ### In-Process (CxIDE) Tools are called via `AgentService` which wraps `MCPServer.handleJsonRpc()`: ```swift let result = await agentService.callTool(name: "file_list", arguments: ["path": "."]) ``` ### Chat Panel Type in the Agent bottom panel. Natural language is routed automatically: - "list files" → `file_list` - "git status" → `git_status` - "explain this code" → `code_explain` ### Direct Call Prefix with `/` for direct tool invocation: ```text /file_read {"path": "Core/CodeEngine.cpp", "startLine": 1, "endLine": 50} /git_log {"count": 10} /diag_complexity {"path": "ViewModels/EditorViewModel.swift"} ``` ### Standalone CLI ```bash # HTTP mode ./CxSwiftAgent/.build/release/cx-swift-agent --port 3001 --workspace . # stdio mode (for MCP clients like VS Code, Cursor) ./CxSwiftAgent/.build/release/cx-swift-agent --stdio ```