ToolParameter

@Serializable
data class ToolParameter(val name: String, val description: String, val type: ParameterType, val required: Boolean = false)

A single declared input to an McpTool. The list of these on a tool is compiled into the inputSchema advertised by MCP tools/list, so name and type are part of the wire contract.

Constructors

Link copied to clipboard
constructor(name: String, description: String, type: ParameterType, required: Boolean = false)

Properties

Link copied to clipboard

Human/LLM-readable explanation of the argument.

Link copied to clipboard

Argument key the caller supplies and McpTool.execute reads from its params map.

Link copied to clipboard

Whether the argument must be present. Surfaced in the enclosing schema's required array by the protocol layer (not by toJsonSchema, which describes one property).

Link copied to clipboard

JSON Schema type of the value.

Functions

Link copied to clipboard

The JSON Schema fragment for this one parameter — { "type": ..., "description": ... }. Required-ness is intentionally omitted here; the protocol layer aggregates it into the parent object schema's required list.