-
Notifications
You must be signed in to change notification settings - Fork 534
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
The MCPTool parameter arguments throw ArgumentExceptions which is won't communicate propertly. Since this is not an "MCPException" -- the LLM gets no real feedback on the error -- doomed to repeat it. This plays into issue #820 which would allow us to handle exceptions.
To Reproduce
Pass incorrect arguments to an MCP tool endpoint.
Expected behavior
Communicate to the LLM that the argument was wrong instead of "An error occurred invoking 'tool_thing'."
Logs
System.ArgumentException: The arguments dictionary is missing a value for the required parameter 'request'. (Parameter 'arguments')
at Microsoft.Shared.Diagnostics.Throw.ArgumentException(String paramName, String message)
at Microsoft.Extensions.AI.AIFunctionFactory.ReflectionAIFunctionDescriptor.<>c__DisplayClass34_0.<GetParameterMarshaller>b__4(AIFunctionArguments arguments, CancellationToken _)
at Microsoft.Extensions.AI.AIFunctionFactory.ReflectionAIFunction.InvokeCoreAsync(AIFunctionArguments arguments, CancellationToken cancellationToken)
at Microsoft.Extensions.AI.AIFunctionFactory.ReflectionAIFunction.InvokeCoreAsync(AIFunctionArguments arguments, CancellationToken cancellationToken)
at ModelContextProtocol.Server.AIFunctionMcpServerTool.InvokeAsync(RequestContext`1 request, CancellationToken cancellationToken)
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working