src.marcus_mcp.tools.context module#
Context Tools for Marcus MCP.
This module contains tools for context management: - log_decision: Log architectural decisions - get_task_context: Get context for a specific task
- async src.marcus_mcp.tools.context.log_decision(agent_id, task_id, decision, state)[source]#
Log an architectural decision made during task implementation.
Agents use this to document important technical choices that might affect other tasks. Decisions are automatically cross-referenced to dependent tasks.
- async src.marcus_mcp.tools.context.get_task_context(task_id, state)[source]#
Get the full context for a specific task.
This is useful for agents who want to understand the broader context of their work or review decisions made on dependencies.
For subtasks, includes parent task context and shared conventions.
- Parameters:
- Returns:
Dict with task context including implementations, dependencies, and decisions. For subtasks, includes parent_task, shared_conventions, and dependency_artifacts.
- Return type:
- async src.marcus_mcp.tools.context.assemble_task_context(task_id, task, state)[source]#
Assemble the full delivered context for a freshly assigned task.
Issue #605: context must be delivered with the task in the
request_next_taskresponse, not left to the optionalget_task_contextcall. This helper builds the three-tier context bundle sorequest_next_task()can attach it directly.The three tiers, each scope-labelled:
project_contractβ the project-global foundation contract (_collect_foundation_contract()). Reaches every task.dependency_artifactsβ direct-dependency artifacts, filtered to architectural types, carrying thein_scope/reference_onlyannotation set by_collect_task_artifacts().transitive_contextβ transitive ancestor artifacts and all upstream decisions (_collect_transitive_context()), every entryreference_only.
- Parameters:
- Returns:
{"project_contract": {...}, "dependency_artifacts": [...], "transitive_context": {...}}. Each field degrades to an empty value rather than raising when a subsystem is unavailable.- Return type: