fix: add logger for template variables for mcp

Co-authored-by: Jin Peng <jinjpeng@Jins-MacBook-Pro.local>
This commit is contained in:
jnjpng
2025-08-01 14:27:00 -07:00
committed by GitHub
parent a298462f1b
commit 8d0bc26035

View File

@@ -6,6 +6,8 @@ from typing import Dict, List, Optional
from mcp import Tool
from pydantic import BaseModel, Field
from letta.utils import get_logger
# MCP Authentication Constants
MCP_AUTH_HEADER_AUTHORIZATION = "Authorization"
MCP_AUTH_TOKEN_BEARER_PREFIX = "Bearer"
@@ -13,6 +15,8 @@ TEMPLATED_VARIABLE_REGEX = (
r"\{\{\s*([A-Z_][A-Z0-9_]*)\s*(?:\|\s*([^}]+?)\s*)?\}\}" # Allows for optional whitespace around the variable name and default value
)
logger = get_logger(__name__)
class MCPTool(Tool):
"""A simple wrapper around MCP's tool definition (to avoid conflict with our own)"""