zeroclaw/src/agent
Vernon Stinebaker a52446c637
feat(agent): add tool_filter_groups for per-turn MCP tool schema filtering (#3395)
* feat(agent): add tool_filter_groups for per-turn MCP tool schema filtering

Introduces per-turn MCP tool schema filtering to reduce token overhead when
many MCP tools are registered. Filtering is driven by a new config field
`agent.tool_filter_groups`, which is a list of named groups that each
specify tool glob patterns and an activation mode (`always` or `dynamic`).

Built-in (non-MCP) tools always pass through unchanged; the feature is fully
backward-compatible — an empty `tool_filter_groups` list (the default) leaves
all existing behaviour untouched.

Changes:
- src/config/schema.rs: add `ToolFilterGroupMode`, `ToolFilterGroup` types
  and `tool_filter_groups` field on `AgentConfig`
- src/config/mod.rs: re-export `ToolFilterGroup`, `ToolFilterGroupMode`
- src/agent/loop_.rs: add `glob_match()`, `filter_tool_specs_for_turn()`,
  `compute_excluded_mcp_tools()` helpers; wire call sites in both single-shot
  and interactive REPL modes; add unit tests for all three functions
- docs/reference/api/config-reference.md: document `tool_filter_groups`
  field and sub-table schema with example
- docs/i18n/el/config-reference.md: add Greek locale config-reference with
  `tool_filter_groups` section (2026-03-12 update)

* Remove accidentally committed worktree directories

---------

Co-authored-by: argenis de la rosa <theonlyhennygod@gmail.com>
2026-03-13 14:23:57 -04:00
..
agent.rs Summary 2026-02-24 16:03:00 +08:00
classifier.rs feat(agent): log query classification route decisions 2026-02-24 16:02:59 +08:00
dispatcher.rs style: fix cargo fmt violations blocking CI lint (#3244) 2026-03-11 21:53:25 -04:00
loop_.rs feat(agent): add tool_filter_groups for per-turn MCP tool schema filtering (#3395) 2026-03-13 14:23:57 -04:00
memory_loader.rs fix(memory): stop autosaving assistant summaries and filter legacy entries 2026-02-20 01:14:08 +08:00
mod.rs feat(agent): add rule-based query classification for automatic model routing 2026-02-18 14:41:58 +08:00
prompt.rs feat(skills): add configurable compact skills prompt injection 2026-02-21 00:00:51 +08:00
tests.rs fix(provider): preserve reasoning_content in tool-call conversation history 2026-02-22 17:40:48 +08:00