InitializeResult class final

After receiving an initialize request from the client, the server sends this response.

Revisions: 2024-11-05, 2025-03-26, 2025-06-18, 2025-11-25.

Inheritance

Constructors

InitializeResult({Map<String, Object?>? meta, required ServerCapabilities capabilities, String? instructions, required String protocolVersion, required Implementation serverInfo, Map<String, Object?>? extra})
InitializeResult.fromJson(Map<String, Object?> json)
Wraps json as received; nothing is dropped.

Properties

capabilities → ServerCapabilities
no setter
extra → Map<String, Object?>
Keys outside the schema (newer revisions, extensions, applications).
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
instructions → String?
Instructions describing how to use the server and its features.
no setter
meta → Map<String, Object?>?
See General fields: _meta for notes on _meta usage.
no setter
protocolVersion → String
The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
schemaKeys → Set<String>
Property names the schema defines for this type.
no setteroverride
serverInfo → Implementation
no setter

Methods

$optional<T>(String key, T? read(Object? value, String path)) → T?
Optional property key, converted by read; null when absent or null.
inherited
$required<T>(String key, T read(Object? value, String path)) → T
Required property key, converted by read.
inherited
check() → List<String>
Reads every property this type defines and returns what could not be read (missing required properties, wrong types), nested types included. Empty = the JSON matches the schema's shape for this type.
override
copyWith({Map<String, Object?>? meta, ServerCapabilities? capabilities, String? instructions, String? protocolVersion, Implementation? serverInfo}) → InitializeResult
A copy with the given properties replaced; everything else, unknown keys included, is kept.
has(String key) → bool
Whether key is present (a null value counts as present).
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, Object?>
The JSON form of this value.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
Equal when the JSON is equal; key order does not matter.
inherited
operator [](String key) → Object?
The raw JSON value of key.
inherited

Constants

keys → const Set<String>