Learn how to manage nested context blocks in MCP with a step-by-step guide on setting up system instructions, user profiles, docs, tasks, and tool access.

Book a call with an Expert
Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.
System Instructions: This defines the model's role and specialization. For example, “You are a helpful assistant specialized in finance.”
User Profile: Contains details like the user's name, preferences, and goals.
Document Context: Includes knowledge bases or documents recently uploaded or accessed.
Active Tasks / Goals: Lists current objectives or to-dos the model needs to focus on.
Tool Access: Specifies what external tools the model can interact with, such as web access or databases.
Rules / Constraints: Defines boundaries for the model, such as “never suggest medical diagnoses.”
{
"system_instructions": "You are a helpful assistant specialized in finance.",
"rules_constraints": ["never suggest medical diagnoses"]
}
{
"user_profile": {
"name": "John Doe",
"preferences": {
"communication_style": "formal",
"interest_topics": ["investments", "stocks"]
},
"goals": [
"reduce expenses",
"increase savings"
]
}
}
{
"document_context": {
"knowledge_base": [
{
"title": "Investment 101",
"link": "http://example.com/investments"
},
{
"title": "Guide to Saving",
"link": "http://example.com/savings"
}
],
"recent_uploads": [
{
"title": "John's Financial Report",
"upload_date": "2023-10-01"
}
]
}
}
{
"activetasksgoals": {
"current_objectives": [
"analyze recent expenses",
"suggest investment opportunities"
],
"to_dos": [
"check stock market updates",
"review monthly budget"
]
}
}
{
"tool_access": {
"web": true,
"python": false,
"database": "financial_data"
}
}
{
"MCP": {
"system_instructions": "...",
"user_profile": "...",
"document_context": "...",
"activetasksgoals": "...",
"tool_access": "...",
"nestedcontextblocks": [
{
"sub_goal": "Pay off credit card debt",
"related_documents": [
{
"title": "Debt Management Strategies",
"link": "http://example.com/debt"
}
],
"current_status": "Ongoing",
"deadline": "2023-12-31"
},
{
"sub_goal": "Plan retirement savings",
"related_documents": [
{
"title": "Retirement Planning",
"link": "http://example.com/retirement"
}
],
"current_status": "Not Started",
"deadline": "2024-06-30"
}
]
}
}
Continuously Update Context: Keep track of changes in user goals, document updates, and the availability of new tools.
Adapt Model Behavior: Modify system instructions, user preferences, or constraints as needed to better align with current objectives and user feedback.
By following these steps, you can effectively manage nested context blocks within the Model Context Protocol (MCP), ensuring your AI or language model operates predictably and efficiently across various tasks and scenarios.
When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.