Updating MCP endpoint parameters to use snake case

This commit is contained in:
Gavin Aguiar
2026-01-30 15:34:33 -06:00
Unverified
parent 8b475afe17
commit c067cebf03
2 changed files with 8 additions and 8 deletions
@@ -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"}