MCP.Protocol.Types.Content (MCP Elixir SDK v1.1.0)

Copy Markdown View Source

Polymorphic content types used in tool results, prompts, and resources.

Content blocks are discriminated by their type field:

  • "text" — TextContent
  • "image" — ImageContent
  • "audio" — AudioContent
  • "resource" — EmbeddedResource
  • "resource_link" — ResourceLink

Summary

Functions

Parses a wire-format map into the appropriate content struct.

Types

Functions

from_map(map)

@spec from_map(map()) :: content_block()

Parses a wire-format map into the appropriate content struct.