Skip to content

Commit c8dc0c0

Browse files
authored
Fix "failed to parse tools" due to mcp EXIT_LOOP_TOOLS not following the ChatCompletionInputFunctionDefinition model (#3219)
* Fix EXIT_LOOP_TOOLS mcp tools not following the ChatCompletionInputFunctionDefinition model * Add property trigger to preserve compatibility with OpenAI schema
1 parent 2e1e1bf commit c8dc0c0

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/huggingface_hub/inference/_mcp/constants.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,15 @@
5454
"function": {
5555
"name": "task_complete",
5656
"description": "Call this tool when the task given by the user is complete",
57+
"parameters": {
58+
"type": "object",
59+
"properties": {
60+
"trigger": {
61+
"type": "boolean",
62+
"description": "Set to true to trigger this function",
63+
}
64+
},
65+
},
5766
},
5867
}
5968
)
@@ -64,6 +73,15 @@
6473
"function": {
6574
"name": "ask_question",
6675
"description": "Ask the user for more info required to solve or clarify their problem.",
76+
"parameters": {
77+
"type": "object",
78+
"properties": {
79+
"trigger": {
80+
"type": "boolean",
81+
"description": "Set to true to trigger this function",
82+
}
83+
},
84+
},
6785
},
6886
}
6987
)

0 commit comments

Comments
 (0)