Optional_Extension metadata advertised on this tool's tools/list descriptor.
Use vendor-namespaced keys for custom data. This definition metadata is
distinct from a tool callback result's _meta: it describes the tool,
while result _meta belongs to one invocation. For view-bound or
visibility-restricted tools, framework-owned MCP Apps keys are derived
from ToolDefinition.view and ToolDefinition.visibility;
those derived values take precedence over colliding entries here.
OptionalannotationsBehavioral hints for clients (readOnlyHint, destructiveHint, …).
OptionaldescriptionLLM-facing description of what the tool does.
OptionalinputObject schema for input validation — any Standard Schema library with
JSON Schema conversion (StandardSchemaWithJSON): zod v4, ArkType,
Valibot, …. Field descriptions become LLM hints. Input is validated by
the SDK before the callback runs. Emitted on the wire as inputSchema.
Unique tool identifier, e.g. "fetch-weather".
OptionaloutputSchema for structured output (StandardSchemaWithJSON). Any JSON
root is allowed — object, array, or primitive (2026-07-28 protocol).
When set, the callback must return a result carrying matching
structuredContent or an explicit isError result — enforced at
compile time and validated by the SDK at runtime.
OptionalschemaAlias for ToolDefinition.inputSchema. Prefer inputSchema in new
code — it matches the MCP wire field name.
OptionaltitleHuman-readable title shown in UIs (falls back to name).
OptionalviewBind this tool to a view for MCP Apps rendering. Requires
ToolDefinition.outputSchema — the view reads the result's
structuredContent typed by this schema.
OptionalvisibilityDeclares who may call or see the tool. Emitted as _meta.ui.visibility
on tools/list. Omitted = host default (callable by the model, visible
to the app). The server always lists every registered tool — hosts
filter by this declaration; the server never omits tools from
tools/list. "app" marks app-private helper tools callable from
views via useCallTool while the host hides them from the model.
Declares a tool's identity, LLM-facing description, and schemas. First argument to MCPServer.tool.