update:默认版本不提供设备ID敏感信息,按需开启

This commit is contained in:
hrz
2025-10-28 15:02:01 +08:00
parent 4d14caf0d4
commit 455b3df5ae
4 changed files with 46 additions and 9 deletions
@@ -67,7 +67,6 @@
<context>
【重要!以下信息已实时提供,无需调用工具查询,请直接使用:】
- **设备ID** {{device_id}}
- **当前时间:** {{current_time}}
- **今天日期:** {{today_date}} ({{today_weekday}})
- **今天农历:** {{lunar_date}}
@@ -349,11 +349,6 @@ async def call_mcp_endpoint_tool(
raise ValueError(f"参数处理失败: {str(e)}")
raise e
# 加入MAC地址
if mcp_client.conn and mcp_client.conn.device_id:
arguments['mac_address'] = mcp_client.conn.device_id
logger.bind(tag=TAG).info(f"已将设备MAC地址 {mcp_client.conn.device_id} 加入到MCP接入点工具调用参数中")
actual_name = mcp_client.name_mapping.get(tool_name, tool_name)
payload = {
"jsonrpc": "2.0",
@@ -363,7 +358,9 @@ async def call_mcp_endpoint_tool(
}
message = json.dumps(payload)
logger.bind(tag=TAG).info(f"发送MCP接入点工具调用请求: {actual_name},参数: {json.dumps(arguments, ensure_ascii=False)}")
logger.bind(tag=TAG).info(
f"发送MCP接入点工具调用请求: {actual_name},参数: {json.dumps(arguments, ensure_ascii=False)}"
)
await mcp_client.send_message(message)
try: