ProjectToolRun typedef

ProjectToolRun = FutureOr<ToolResult> Function(ToolCall call)

What calling a project tool does: one ToolCall in, a result out.

A ToolResult rather than a server's own answer type, because a plugin's tool is offered by every server of the project and each of them speaks a different answer: the editor's carries a picture, the modeller's a selection. A result is what all of them send in the end.

A ToolCall rather than the arguments alone, so a minor can hand the tool more (progress, cancellation, the project's root) as members of the call, where a second parameter would break every tool a plugin wrote against 1.0.

Implementation

typedef ProjectToolRun = FutureOr<ToolResult> Function(ToolCall call);