McpServer.Router (MCP SSE v0.1.0)

View Source

A DSL to define a router for the Model Context Protocol (MCP) server.

Summary

Functions

check_tool_args(args, tool_name, input_fields)

format_field(field)

format_schema(fields)

tool(name, description, controller, function, list)

(macro)

Defines a tool

Example

tool "echo", "Echoes back the input", EchoController, :echo,
  title: "Echo",
  hints: [:read_only, :non_destructive, :idempotent, :closed_world] do
  input_field("message", "The message to echo", :string, required: true)
  output_field("message", "The echoed message", :string)
end

tool(name, description, controller, function, opts, list)

(macro)