McpTool

data class McpTool(val name: String, val title: String? = null, val description: String? = null, val inputSchema: JsonObject, val outputSchema: JsonObject? = null, val annotations: McpToolAnnotations? = null, val meta: JsonObject? = null)(source)

A tool offered by an MCP server (tools/list).

Constructors

Link copied to clipboard
constructor(name: String, title: String? = null, description: String? = null, inputSchema: JsonObject, outputSchema: JsonObject? = null, annotations: McpToolAnnotations? = null, meta: JsonObject? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

title, then annotations.title, then name (the spec's display-name precedence).

Link copied to clipboard
val inputSchema: JsonObject
Link copied to clipboard
val meta: JsonObject?

The tool's _meta, as the server sent it.

Link copied to clipboard
Link copied to clipboard
val outputSchema: JsonObject?
Link copied to clipboard
Link copied to clipboard

The MCP App that renders this tool's results (MCP Apps _meta.ui.resourceUri, or the deprecated flat _meta["ui/resourceUri"]); only ui:// URIs count.

Link copied to clipboard

Who may call the tool (MCP Apps _meta.ui.visibility): model and / or app; both by default.

Functions

Link copied to clipboard
fun McpTool.toJson(): JsonObject

The tool as MCP Tool JSON (for an MCP App's hostContext.toolInfo).