Skip to content

Tool manifest bloat: prefer trigger-scoped tool exposure (split from #204) #206

@mostlydev

Description

@mostlydev

Split out from #204 §I to keep the cursored-context PR focused.

Context

The Tiverton effective-context capture (2026-04-29T05:04:01Z, turn_count: 1) showed:

```text
tools count: 43
tools JSON total: 37853 chars
```

That is ~38 KB of tool schema in every request, even for a simple Discord context question that touches none of those tools. The system+tools+memory grand total was 81 KB per turn. Tool manifest is not the root cause of the first-system rewrite issue (#204), but it is a real lever for prompt size and provider latency.

Hypothesis

Tools should be trigger-scoped or role-scoped at compile time so only the relevant subset is exposed for a given invocation type. For example:

  • A Discord-mention turn does not need market-data tools.
  • A scheduled claw api schedule invocation might need the full set.
  • A managed MCP sidecar's tools are only relevant when that sidecar is reachable.

Possible directions

  1. Compile-time trigger filter in claw.describe — declare triggers: [discord, schedule] per tool, expose only intersecting tools per invocation.
  2. Lazy tool manifest — initial request carries a compact manifest digest; tools are loaded on demand via a separate endpoint when the model calls one. Probably too much complexity for v1.
  3. Per-agent tool allowlist in pod YAML — operator declares which tools each agent gets. Operator-driven, no model-driven dynamism. Cheapest option.

Open questions

  1. Is the right knob agent-level, trigger-level, or per-skill?
  2. Does nanobot support a compact tool digest pattern, or is the full schema always required?
  3. How does this interact with managed MCP sidecars (Support MCP sidecar services as managed tools through cllama #177/Provide first-class stdio MCP wrapper for managed MCP sidecars #179) where tool sets are discovered at compile time?

Out of scope

Predecessor

#204 ships first. The hash telemetry added in #204 makes the impact of any tool-manifest change measurable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions