Skip to content

MCP token budget: track and limit tool definition token usage per fighter #10

@humancto

Description

@humancto

Problem

MCP tool definitions consume context window tokens. Without monitoring, fighters silently lose capacity. One documented case: 75K tokens consumed by tool defs alone (37.5% of a 200K context).

Proposed Solution

  • Track token count of injected tool definitions per bout
  • Warn when tool definitions exceed 10% of model context window
  • Hard limit: never inject more than 20% of context as tool definitions
  • Metrics: expose tool definition token usage in Prometheus metrics
  • Dashboard: show per-fighter tool token overhead in TUI

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions