// Copyright (c) Microsoft. All rights reserved.
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.AI;
namespace Microsoft.Agents.AI.Workflows.Declarative;
///
/// Defines the contract for invoking MCP tools within declarative workflows.
///
///
/// This interface allows the MCP tool invocation to be abstracted, enabling
/// different implementations for local development, hosted workflows, and testing scenarios.
///
public interface IMcpToolHandler
{
///
/// Invokes an MCP tool on the specified server.
///
/// The URL of the MCP server.
/// An optional label identifying the server connection.
/// The name of the tool to invoke.
/// Optional arguments to pass to the tool.
/// Optional headers to include in the request.
/// An optional connection name for managed connections.
/// A token to observe cancellation.
///
/// A task representing the asynchronous operation. The result contains a
/// with the tool invocation output.
///
Task InvokeToolAsync(
string serverUrl,
string? serverLabel,
string toolName,
IDictionary? arguments,
IDictionary? headers,
string? connectionName,
CancellationToken cancellationToken = default);
}