Class WebMCPAdapter
Represents an adapter for the WebMCP domain to simplify the command interface.
public class WebMCPAdapter
- Inheritance
-
WebMCPAdapter
- Inherited Members
Constructors
WebMCPAdapter(IDevToolsSession)
Initializes a new instance of the WebMCPAdapter class.
public WebMCPAdapter(IDevToolsSession session)
Parameters
sessionIDevToolsSessionThe IDevToolsSession to be used with this adapter.
Exceptions
- ArgumentNullException
If
sessionis null.
Properties
Session
Gets the DevToolsSession associated with the adapter.
public IDevToolsSession Session { get; }
Property Value
Methods
Enable(EnableCommandSettings?, CancellationToken, int?, bool)
Enables the WebMCP domain, allowing events to be sent. Enabling the domain will trigger a toolsAdded event for all currently registered tools.
public Task<EnableCommandResponse?> Enable(EnableCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)
Parameters
commandEnableCommandSettingscancellationTokenCancellationTokenmillisecondsTimeoutint?throwExceptionIfResponseNotReceivedbool
Returns
Events
ToolsAdded
Event fired when new tools are added.
public event EventHandler<ToolsAddedEventArgs>? ToolsAdded
Event Type
ToolsRemoved
Event fired when tools are removed.
public event EventHandler<ToolsRemovedEventArgs>? ToolsRemoved