Skip to main content

task_graph_mcp/tools/
context.rs

1//! Per-request context passed to tool functions.
2
3use crate::logging::Logger;
4
5/// Per-request context passed to all tools.
6///
7/// This provides access to:
8/// - Unified logger for outputting to both tracing and MCP client
9#[derive(Clone)]
10pub struct ToolContext {
11    /// Unified logger for this request.
12    pub logger: Logger,
13}
14
15impl ToolContext {
16    /// Create a new tool context with the given logger.
17    pub fn new(logger: Logger) -> Self {
18        Self { logger }
19    }
20}