execute

abstract suspend fun execute(params: Map<String, Any>): ToolResult

Run the tool. Called on a background dispatcher in response to a tools/call.

Return

ToolResult.success with a result map, or ToolResult.error on failure or missing permission — never throw for an expected failure mode.

Parameters

params

Caller-supplied arguments keyed by ToolParameter.name. Values arrive loosely typed (from JSON); coerce defensively and clamp numeric ranges.