ExMCP.DSL.Meta (ex_mcp v0.9.2)
View SourceShared metadata DSL for Tools, Resources, and Prompts.
Provides a consistent meta block syntax across all DSL types:
deftool "say_hello" do
meta do
name "Hello Tool"
description "Says hello to someone"
version "1.0.0"
end
input_schema %{...}
end
defresource "config://app" do
meta do
name "App Config"
description "Application configuration"
end
mime_type "application/json"
end
defprompt "greeting" do
meta do
name "Greeting Template"
description "A greeting template"
end
arguments do
arg :style, description: "Greeting style"
end
end
Summary
Functions
Sets the author for the current DSL element.
Clears all metadata attributes for the current DSL element.
Sets the description for the current DSL element.
Retrieves all accumulated metadata for the current DSL element.
Defines a metadata block for DSL elements.
Sets the name for the current DSL element.
Sets tags for the current DSL element.
Validates that required metadata fields are present.
Sets the version for the current DSL element.
Functions
Sets the author for the current DSL element.
Clears all metadata attributes for the current DSL element.
Should be called before processing each new DSL element.
Sets the description for the current DSL element.
Retrieves all accumulated metadata for the current DSL element.
Returns a map with all the metadata fields that have been set.
Defines a metadata block for DSL elements.
The meta block accumulates metadata using module attributes and validates required fields.
Sets the name for the current DSL element.
Sets tags for the current DSL element.
Validates that required metadata fields are present.
Options
:require_name- Requires name field (default: true):require_description- Requires description field (default: true)
Sets the version for the current DSL element.