When you use an agent (chatbot, coding IDE, automation workflows...) you don't just pass in your prompt. The agent also passes in other things, which increases the total context, and the input context length is limited.
Total context = user message + system instruction (system prompt) + tools, MCP instruction + subagent instruction + skill instruction. Can you control your input token?