Skip to content

Tools

Every tool is a LangChain StructuredTool — the format deepagents expects. ToolProvider builds the list at agent construction, filters by role (for subagents) and by security profile, and wraps each in the rate limiter + audit + dedup pipeline before it reaches the LLM.

ToolArgsPurpose
analyze_files_for_questionfilePath, class_name?, function_name?Read a file, optionally filtered to a named symbol. Path validated against workspace.
edit_filefilePath, mode: overwrite|replace, content?, search?, replace?Safe replace or full overwrite. Search/replace is the surgical mode.
ast_editfilePath, nodeType, nodeName, newBodyTree-sitter-aware edit — replaces a named node’s body via byte ranges, re-indents, routes through diff review.
compose_fileslabel, edits: [{filePath, mode, content?, search?, replace?}]Multi-file batch — one review, one commit conceptually.
list_filesdirPath?Directory listing with type flags.
find_filesqueryFuzzy filename finder honoring .gitignore / .codebuddyignore.
ToolArgsPurpose
ripgrep_searchPattern, glob, extra argsFast regex over the workspace via bundled ripgrep
search_symbolsLSP-based querySymbol search using the editor’s language servers
search_vector_dbquery: stringSemantic search over indexed code chunks (see Semantic search)
web_searchquery, maxResults?, includeRawContent?, timeout?Web search via Tavily / Brave / Firecrawl (whichever key is set)
ToolArgsPurpose
get_active_editorActive file, languageId, cursor/selection, visible ranges, dirty state (path-validated).
lsp_queryfilePath, kind: hover|definition|references|signature, positionMultiplexes over the vscode.execute<Kind>Provider commands.
get_diagnosticsEditor diagnostics APICompiler errors, linter warnings, LSP diagnostics
query_graphoperation: imported_by|imports_of, filePathReverse/forward import-graph queries (“who uses this?”), staleness-labeled by commit.
ToolArgsPurpose
run_terminal_commandcommand, background?Modal-approved shell command. Background mode for servers.
manage_terminalaction: start|execute|read|terminate, sessionId, command?, waitMs?Persistent terminal sessions with state.
run_testsFramework-native argsRun configured test runner; structured pass/fail back.
run_skill_scriptskill, script, action argsRuns an installed skill’s script (modal-gated). See Skills.

All 5 require an active vscode.debug session.

ToolDAP requestPurpose
debug_get_statethreadsThreads + state
debug_get_stack_tracestackTraceCall stack
debug_get_variablesscopesvariablesFrame variables
debug_evaluateevaluate (REPL context)Expression eval
debug_controlnext, stepIn, stepOut, continue, pauseExecution control
ToolArgsPurpose
browseraction, plus action-specific argsNavigate, click, type, screenshot, snapshot, evaluate, hover, select, press key, wait, tab management. evaluate runs a regex-blocklisted expression (allow-list refactor tracked).
open_web_previewurlOpen in the editor’s built-in browser panel
ToolArgsPurpose
thinkthought: stringStructured reasoning; output stays in LLM context
manage_core_memoryaction: add|update|delete|search, memory: {...}, query?JSON-backed core memory. See Memory.
manage_tasksaction: add|update|list, task: {id?, content?, status?, priority?}Task list for multi-step work
get_architecture_knowledgesection?: all|overview|patterns|call-graph|middleware|endpoints|modelsQuery pre-computed codebase analysis (12 KB cap)
ToolArgsPurpose
git_opsGit-native write operationsbranch, commit, stage, and other state-changing git actions
git_readRead-only git operationsstatus, log, diff, blame (given to read-only roles)
standup_intelligenceoperation: ingest|my_tasks|blockers|history, args: {notes?, person?, dateRange?}Parse + query standup notes
team_graphoperation: person_profile|...|team_summary, argsTeam collaboration analytics

Dynamically loaded from configured MCP servers as LangChainMCPTool instances. Bypass role filtering — every subagent gets every MCP tool. See MCP.

Each tool passes through, in order:

  1. getToolsForRole(role) — filter by TOOL_ROLE_MAPPING (subagents only; main agent gets all)
  2. Append MCP tools
  3. PermissionScopeService.filter — remove tools the active security profile disallows
  4. applyRateLimit — wraps in the sliding-window rate limiter (600/min global, 200/min per-tool)
  5. Dedup wrapper — same (toolName, JSON.stringify(args)) returns cached result within one turn
  6. Audit wrapper — records every invocation to .codebuddy/logs/audit.jsonl

Each subagent gets a filtered subset. Patterns are substring matches against tool names.

RolePattern set
code-analyzeranalyze, lint, security, search, terminal, ripgrep_search, get_diagnostics, git_read, browser
doc-writersearch, read, web, edit_file, compose_files, standup_intelligence, team_graph, browser
debuggerdebug_*, analyze, read, search, terminal, edit_file, get_diagnostics, browser
file-organizerfile, directory, terminal, git_ops, list_files, edit_file, compose_files
architectsearch, think, standup_intelligence, team_graph, manage_core_memory, browser
revieweranalyze, lint, review, git_read, get_diagnostics, search_symbols, standup_intelligence
testerterminal, run_tests, edit_file, get_diagnostics, browser
architecture-expertget_architecture_knowledge, search, ripgrep_search, search_vector_db
general-purposeEverything (deepagents-provided)

Every tool passes through PermissionScopeService before being handed to any agent:

ProfileEffect
restrictedRead-only tools only — analyze_files_for_question, search_*, list_files, get_diagnostics, lsp_query, get_active_editor, query_graph, git_read, think, web_search
standardRead/write + terminal with modal approval. Default.
trustedRead/write + auto-approved terminal. Catastrophic patterns still deny.

Per-workspace custom rules in .codebuddy/permissions.json:

{
"profile": "standard",
"commandDenyPatterns": ["docker rm", "kubectl delete"],
"toolBlocklist": ["browser"]
}

Details: Security.

  • Architecture — where the tool pipeline sits in the middleware stack
  • MCP — adding external tools
  • Subagents — how role filtering shapes each specialist