# Tools agent guide
Built-in tool contracts, routing, filesystem access, and external bridges live here.
## Where to look
| Names, schema, limits | `capability.rs`, `contract.rs`, `args.rs` |
| Prompt descriptions | `descriptions.rs`, `../../prompts/tools/` |
| Routing and runtime state | `dispatch.rs`, `runtime.rs`, `mod.rs` |
| Paths and mutations | `fs.rs`, `workspace.rs`, `fs_cache.rs` |
| Anchored editing and content search | `hash_edit/`, `grep/`; read their local guides |
| AST search and outline | `ast_grep.rs`; `ast_grep/search.rs` embeds search/rewrite previews; `ast_grep/outline.rs` uses bundled outline rules; `ast_grep/embedded.rs` shares bounded reads and cooperative parsing. No external CLI or project config loading. |
| Process execution | `bash.rs`, `process.rs` |
| Public research and runtime page cache | `exa.rs`; direct URL reads stay in `url_fetch.rs` |
| Skill references | `skill.rs` |
| Regression coverage | `tests/` and module-local tests |
## Local contracts
- Keep capability names/order, aliases, typed arguments, dispatch, and schema metadata aligned. `MVP_TOOL_CAPABILITIES` is the canonical built-in list, not a directory inventory.
- `web` is the only public research built-in: Exa search/contents and cache-only find/open references. Keep `EXA_API_KEY` environment-only and never fall back to MCP. Cache snapshots are bounded, runtime-local, and shared by clones; cache misses never refetch. Browser/ax bridges are removed.
- Use the runtime's per-tool absolute-path settings and filesystem resolvers. Do not replace them with a blanket root-only rule or a string-prefix check.
- Mutation locks use canonical paths, falling back to lexical normalization for missing files. Preserve final-symlink rejection, cross-process locking, and atomic writes.
- `fs.rs` rechecks parents after creation; this reduces path races but is not a complete OS sandbox.
- Keep provider result content separate from local `ToolResultDisplay` data; preserve output-limit and cancellation reporting at each bridge.
- `skill.rs` reads only discovered skills and contained references. It is not an alternate arbitrary-file reader.