ExMCP.Types.V20241105 (ex_mcp v0.10.0)

View Source

Type definitions for MCP protocol version 2024-11-05.

This module contains type definitions specific to the 2024-11-05 version of the Model Context Protocol specification.

Summary

Types

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() :: text_content() | image_content() | resource_content()

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() :: %{type: :image, data: String.t(), mimeType: String.t()}

json_schema()

@type json_schema() :: map()

json_value()

@type json_value() :: any()

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() :: %{type: :resource, resource: resource()}

server_capabilities()

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

text_content()

@type text_content() :: %{type: :text, text: String.t()}

tool()

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

Functions

protocol_version()