mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
793403f3db
* Add MCP long-running task support for MCP client tools * Fixed project file formatting issue. * Removed experimentation tag from MCP alpha project. * Addressed PR comments
31 lines
844 B
C#
31 lines
844 B
C#
// Copyright (c) Microsoft. All rights reserved.
|
|
|
|
using System;
|
|
using ModelContextProtocol.Protocol;
|
|
using ModelContextProtocol.Server;
|
|
|
|
namespace Microsoft.Agents.AI.Mcp.UnitTests;
|
|
|
|
/// <summary>
|
|
/// Helpers to create <see cref="McpServerTool"/> instances with a specific
|
|
/// <see cref="ToolTaskSupport"/> level for in-memory fixtures.
|
|
/// </summary>
|
|
internal static class TestTools
|
|
{
|
|
public static McpServerTool Create(string name, ToolTaskSupport? taskSupport, Delegate handler)
|
|
{
|
|
McpServerToolCreateOptions options = new()
|
|
{
|
|
Name = name,
|
|
Description = $"Test tool {name}.",
|
|
};
|
|
|
|
if (taskSupport is ToolTaskSupport ts)
|
|
{
|
|
options.Execution = new ToolExecution { TaskSupport = ts };
|
|
}
|
|
|
|
return McpServerTool.Create(handler, options);
|
|
}
|
|
}
|