mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Updating MCP endpoint parameters to use snake case
This commit is contained in:
@@ -536,7 +536,7 @@ class AgentFunctionApp(DFAppBase):
|
||||
"isArray": False,
|
||||
},
|
||||
{
|
||||
"propertyName": "threadId",
|
||||
"propertyName": "thread_id",
|
||||
"propertyType": "string",
|
||||
"description": "Optional thread identifier for conversation continuity.",
|
||||
"isRequired": False,
|
||||
@@ -561,7 +561,7 @@ class AgentFunctionApp(DFAppBase):
|
||||
"""Handle MCP tool invocation for the agent.
|
||||
|
||||
Args:
|
||||
context: MCP tool invocation context containing arguments (query, threadId)
|
||||
context: MCP tool invocation context containing arguments (query, thread_id)
|
||||
client: Durable orchestration client for entity communication
|
||||
|
||||
Returns:
|
||||
@@ -610,8 +610,8 @@ class AgentFunctionApp(DFAppBase):
|
||||
if not query or not isinstance(query, str):
|
||||
raise ValueError("MCP Tool invocation is missing required 'query' argument of type string.")
|
||||
|
||||
# Extract optional threadId
|
||||
thread_id = arguments.get("threadId")
|
||||
# Extract optional thread_id
|
||||
thread_id = arguments.get("thread_id")
|
||||
|
||||
# Create or parse session ID
|
||||
if thread_id and isinstance(thread_id, str) and thread_id.strip():
|
||||
|
||||
@@ -981,7 +981,7 @@ class TestMCPToolEndpoint:
|
||||
client.read_entity_state.return_value = mock_state
|
||||
|
||||
# Create JSON string context
|
||||
context = '{"arguments": {"query": "test query", "threadId": "test-thread"}}'
|
||||
context = '{"arguments": {"query": "test query", "thread_id": "test-thread"}}'
|
||||
|
||||
with patch.object(app, "_get_response_from_entity") as get_response_mock:
|
||||
get_response_mock.return_value = {"status": "success", "response": "Test response"}
|
||||
@@ -1008,7 +1008,7 @@ class TestMCPToolEndpoint:
|
||||
client.read_entity_state.return_value = mock_state
|
||||
|
||||
# Create JSON string context
|
||||
context = json.dumps({"arguments": {"query": "test query", "threadId": "test-thread"}})
|
||||
context = json.dumps({"arguments": {"query": "test query", "thread_id": "test-thread"}})
|
||||
|
||||
with patch.object(app, "_get_response_from_entity") as get_response_mock:
|
||||
get_response_mock.return_value = {"status": "success", "response": "Test response"}
|
||||
@@ -1088,7 +1088,7 @@ class TestMCPToolEndpoint:
|
||||
|
||||
# Thread ID contains a different agent name (@StockAdvisor@poc123)
|
||||
# but we're invoking PlantAdvisor - it should use PlantAdvisor's entity
|
||||
context = json.dumps({"arguments": {"query": "test query", "threadId": "@StockAdvisor@test123"}})
|
||||
context = json.dumps({"arguments": {"query": "test query", "thread_id": "@StockAdvisor@test123"}})
|
||||
|
||||
with patch.object(app, "_get_response_from_entity") as get_response_mock:
|
||||
get_response_mock.return_value = {"status": "success", "response": "Test response"}
|
||||
@@ -1120,7 +1120,7 @@ class TestMCPToolEndpoint:
|
||||
client.read_entity_state.return_value = mock_state
|
||||
|
||||
# Plain thread_id without @name@key format
|
||||
context = json.dumps({"arguments": {"query": "test query", "threadId": "simple-thread-123"}})
|
||||
context = json.dumps({"arguments": {"query": "test query", "thread_id": "simple-thread-123"}})
|
||||
|
||||
with patch.object(app, "_get_response_from_entity") as get_response_mock:
|
||||
get_response_mock.return_value = {"status": "success", "response": "Test response"}
|
||||
|
||||
Reference in New Issue
Block a user