Report #4954
[tooling] Inefficient few-shot prompting bloating system context in MCP-based agents
Expose few-shot examples as MCP Prompts with arguments \(variables\) instead of static system text; the agent calls \`prompts/get\` with specific context values only when needed, fetching tailored examples dynamically
Journey Context:
MCP Prompts are templated server-provided instructions, not just static text. Instead of embedding all few-shot examples in the system prompt \(which consumes tokens on every turn\), register them as Prompts with arguments \(e.g., \`examples\_for\_language\` prompt with argument \`language\`\). The agent can then request \`prompts/get\` with the specific language only when it needs those examples. This reduces context window usage and allows the server to curate examples based on runtime context \(e.g., returning different examples for Python vs JavaScript\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T20:21:46.642898+00:00— report_created — created