ExMCP.Types.V20250326 (ex_mcp v0.9.2)

View Source

Type definitions for MCP protocol version 2025-03-26.

This module contains type definitions specific to the 2025-03-26 version of the Model Context Protocol specification.

Summary

Types

audio_content()

@type audio_content() :: ExMCP.Types.audio_content()

client_capabilities()

@type client_capabilities() :: %{
  optional(:experimental) => %{required(String.t()) => any()},
  optional(:sampling) => %{required(String.t()) => any()},
  optional(:roots) => %{optional(:listChanged) => boolean()}
}

content()

@type content() :: ExMCP.Types.content()

content_type()

@type content_type() :: ExMCP.Types.content_type()

create_message_params()

@type create_message_params() :: %{
  :messages => [message()],
  optional(:modelPreferences) => model_preferences(),
  optional(:systemPrompt) => String.t(),
  optional(:maxTokens) => pos_integer()
}

cursor()

@type cursor() :: ExMCP.Types.cursor()

error_code()

@type error_code() :: ExMCP.Types.error_code()

image_content()

@type image_content() :: ExMCP.Types.image_content()

json_schema()

@type json_schema() :: map()

json_value()

@type json_value() :: any()

log_level()

@type log_level() ::
  :debug | :info | :notice | :warning | :error | :critical | :alert | :emergency

message()

@type message() :: %{role: :user | :assistant, content: content() | [content()]}

model_hint()

@type model_hint() :: %{optional(:name) => String.t()}

model_preferences()

@type model_preferences() :: %{
  optional(:hints) => [model_hint()],
  optional(:costPriority) => float(),
  optional(:speedPriority) => float(),
  optional(:intelligencePriority) => float()
}

request_id()

@type request_id() :: ExMCP.Types.request_id()

resource()

@type resource() :: %{
  :uri => String.t(),
  optional(:name) => String.t(),
  optional(:description) => String.t(),
  optional(:mimeType) => String.t()
}

resource_content()

@type resource_content() :: %{:uri => String.t(), optional(atom()) => any()}

resource_updated_notification()

@type resource_updated_notification() :: %{
  method: String.t(),
  params: %{uri: String.t()}
}

server_capabilities()

@type server_capabilities() :: %{
  optional(:experimental) => %{required(String.t()) => any()},
  optional(:prompts) => %{optional(:listChanged) => boolean()},
  optional(:resources) => %{
    optional(:subscribe) => boolean(),
    optional(:listChanged) => boolean()
  },
  optional(:tools) => %{optional(:listChanged) => boolean()},
  optional(:logging) => %{optional(:setLevel) => boolean()}
}

set_level_request()

@type set_level_request() :: %{method: String.t(), params: %{level: log_level()}}

text_content()

@type text_content() :: ExMCP.Types.text_content()

tool()

@type tool() :: %{
  :name => String.t(),
  optional(:description) => String.t(),
  inputSchema: json_schema()
}

Functions

protocol_version()