Enable Optional inputs in CrewAI adapter#54
Enable Optional inputs in CrewAI adapter#54electrocucaracha wants to merge 1 commit intogrll:mainfrom
Conversation
|
Hey @electrocucaracha, thanks a lot for your contribution! I understand the issue however I am just wondering as we are using in this case a python function as the basis for the tool, in python the behavior of failing if id is not specified would be the expected behavior, wouldnt it? |
Do you mean that maybe other programming languages that don't allow this kind Python unique nullable required case could raise an error when they are called? I can figure out, but if this an exception I guess it needs to be address in the MCP SDK |
The current implementation of the CrewAI adapter doesn't cover the scenario where the argument is optional. This change fixes that and provides an assertion to validate what is received by the MCP echo server.
b55e2d2 to
8e61bfa
Compare
The current CrewAI adapter implementation requires passing all the values for arguments that don't have a default value, but fails when the MCP tool provides an optional argument. For example, the following code:
Results in the following error
When the tool doesn't provide an
idvalue, liketools[0].run(text="hello")This change modifies the way to populate
filtered_kwargsvariable utilizing theschema_propertiesvalues instead of thekwargs