As far as I can tell, I do not see support for streaming output.
Let’s consider the fowlloing use case:
[Function(nameof(McpFunction))]
public async Task<string> McpFunction(
[McpToolTrigger("return_string", "returns the numbers in the Fibonacci sequence up to a given limit.")] ToolInvocationContext context,
FunctionContext functionContext,
CancellationToken cancellationToken
)
{
return "1, 1, 2, 3, 5, 8, 13, 21";
}
What If I want to stream the results up to a potentially unbounded limit?
I think this use case is not realistic, but it is really to drive the point home.
I would expect to be able to use ToolInvocationContext and from there, acquire some kind of SendResponseAsync(…)-ish method to the client, while the function is still running and computing results.
Am I missing something obvious ?
As far as I can tell, I do not see support for streaming output.
Let’s consider the fowlloing use case:
What If I want to stream the results up to a potentially unbounded limit?
I think this use case is not realistic, but it is really to drive the point home.
I would expect to be able to use
ToolInvocationContextand from there, acquire some kind ofSendResponseAsync(…)-ish method to the client, while the function is still running and computing results.Am I missing something obvious ?