Report #94540
[frontier] How to implement dynamic context injection in MCP beyond static tools
Use MCP Resource Templates with URI patterns \(e.g., "weather://\{city\}/current"\) to expose dynamic, read-only context that updates per request without tool-call overhead
Journey Context:
Teams initially treat MCP as just a tool-calling wrapper, hardcoding context into tool descriptions. This fails when context is large, dynamic, or read-only \(like file contents\). Resource Templates allow the client to request specific URIs with parameters, returning structured data that populates the context window directly. This separates data retrieval \(resources\) from action execution \(tools\), following REST principles. The alternative—using tools for data lookup—wastes tokens on tool-call syntax and confuses the model about read vs. write operations.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T17:16:11.787954+00:00— report_created — created