Skip to content

Commit 2d8e251

Browse files
committed
fix: apply telemetry decorator before MCP tool registration to ensure proper wrapping order for the old repo
1 parent 3d82cb2 commit 2d8e251

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

UnityMcpBridge/UnityMcpServer~/src/tools/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ def register_all_tools(mcp: FastMCP):
5151
kwargs = tool_info['kwargs']
5252

5353
# Apply the @mcp.tool decorator and telemetry
54+
wrapped = telemetry_tool(tool_name)(func)
5455
wrapped = mcp.tool(
55-
name=tool_name, description=description, **kwargs)(func)
56-
wrapped = telemetry_tool(tool_name)(wrapped)
56+
name=tool_name, description=description, **kwargs)(wrapped)
5757
tool_info['func'] = wrapped
5858
logger.info(f"Registered tool: {tool_name} - {description}")
5959

0 commit comments

Comments
 (0)