`tj context`: attribute MCP schema-injection tokens as a named overhead category
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- python
- Domain
- cli, observability
Research direction
Start with tokenjam/core/context_diagnostic.py and read the MCP_INJECTION_PARK_NOTE and mcp_injection_parked handling. First determine how a real per-request tool-schema token delta could be captured; the issue says this data is not currently available in transcripts or live OTLP spans. Done means tj context reports MCP-injection tokens as a distinct overhead category using captured data, not estimates.
Written by the indexing model from the issue text.
Description
Severity: Low
Where: tokenjam sub-repo — tokenjam/core/context_diagnostic.py
Observed: tj context breaks token usage into named "overhead" categories (for example the existing cache_miss category). MCP schema-injection — the tool/schema definitions Claude Code injects into each request, on the order of ~25K tokens per call — is a known overhead source that is currently NOT surfaced as its own category, because per-tool/per-schema token attribution is not available in either the on-disk Claude Code transcript or the live OTLP spans. Tool-definition/system-prompt tokens fold indistinguishably into input_tokens/cache_creation; mcp__-prefixed names appear only on tool-invocation spans, which carry no schema-injection token count. The honest gap is documented in code as the MCP_INJECTION_PARK_NOTE constant plus a mcp_injection_parked JSON field.
Fix direction: Once a per-request tool-schema token delta can be captured (e.g. the system-prompt/tool-definition token count Claude Code sends per request, or a with-vs-without-MCP token diff), surface MCP schema-injection as its own named overhead category, mirroring the existing cache_miss category. Blocked on capturing that data first.
Done when: tj context breaks out MCP-injection tokens as a distinct named overhead source (no invented numbers — only once the data is real).
- Dominant language
- Python
- Stars
- 122
- Forks
- 35
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 8
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Metabuilder-Labs/tokenjam
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Metabuilder-Labs/tokenjam#786 ·
Maintainers usually reply within 1 day
-
enhancement good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Metabuilder-Labs/tokenjam#759 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Metabuilder-Labs/tokenjam#728 ·
Maintainers usually reply within 1 day
-
bug help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Metabuilder-Labs/tokenjam#591 ·
Maintainers usually reply within 1 day
-
bug good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Metabuilder-Labs/tokenjam#559 ·
Maintainers usually reply within 1 day
All issues in Metabuilder-Labs/tokenjam
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
eclipse-score/inc_someip_gateway#356 ·
Maintainers usually reply within 2 days
-
[BUG]: `GitHubRestAdapter.check_user_permission` and `has_write_access` raise `TypeError` (missing `params`), silently disabling the inactivity lifecyclePossibly taken @tarunagnihotri534 claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
AOSSIE-Org/Gitcord-GithubDiscordBot#167 · 1 comment ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
mihai-vlc/sublime-jsfmt#56 ·
-
comp/cli comp/plugins P2 type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
NousResearch/hermes-agent#141917 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
riscv/riscv-opcodes#441 ·