fix: apply telemetry decorator before MCP tool registration to ensure proper wrapping order for the old repo

main
Marcus Sanatan 2025-10-13 11:41:16 -04:00
parent 3d82cb26b0
commit 2d8e251e01
1 changed files with 2 additions and 2 deletions

View File

@ -51,9 +51,9 @@ def register_all_tools(mcp: FastMCP):
kwargs = tool_info['kwargs'] kwargs = tool_info['kwargs']
# Apply the @mcp.tool decorator and telemetry # Apply the @mcp.tool decorator and telemetry
wrapped = telemetry_tool(tool_name)(func)
wrapped = mcp.tool( wrapped = mcp.tool(
name=tool_name, description=description, **kwargs)(func) name=tool_name, description=description, **kwargs)(wrapped)
wrapped = telemetry_tool(tool_name)(wrapped)
tool_info['func'] = wrapped tool_info['func'] = wrapped
logger.info(f"Registered tool: {tool_name} - {description}") logger.info(f"Registered tool: {tool_name} - {description}")