Interface IAssistantToolSource
Where an assistant bridge gets the tools it serves: the language server's catalog, through whatever connection the bridge has to it
(rdcore/tools/list and rdcore/tools/call).
public interface IAssistantToolSource
Remarks
A McpToolServer serves the tools of one source. A client app fills it from its LSP connection (ClientAppToolSource); an IDE add-in
can fill it from its host's channel to the language server.
Methods
CallAsync(ToolCallParams, CancellationToken)
Calls a tool (rdcore/tools/call).
Task<ToolCallResult> CallAsync(ToolCallParams call, CancellationToken cancellationToken)
Parameters
callToolCallParamsThe tool and its arguments.
cancellationTokenCancellationTokenA token that cancels the call.
Returns
- Task<ToolCallResult>
What the tool answers; a refusal is a result whose IsError is true.
Exceptions
- Exception
The language server refused the request, or the connection failed; the message says why.
ListAsync(CancellationToken)
Lists the tools (rdcore/tools/list).
Task<ToolsListResult> ListAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenA token that cancels the request.
Returns
- Task<ToolsListResult>
Every tool of the catalog.
WaitForReadyAsync(CancellationToken)
Completes once the language server can list and call its tools.
Task WaitForReadyAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenA token that stops the wait.
Returns
- Task
A task that completes when the tools can be listed and called.