The public surface
Every type, function, method and value moonmcp exposes, drawn straight from the compiled package interfaces. Generated from source — it cannot drift from the code.
Three capability kinds give the reference its colours: tools, resources, prompts. Everything else is the server, the wire, or the errors in between.
MCP 2026-07-28 · 2025-11-25 · 2024-11-05 · Streamable HTTP · stdio
Facade
The names a server is written with. Re-exports the server and the three capability types, plus argument decoding.
Documentation page
The page a server serves beside its endpoint, listing what it offers and calling it, in two looks.
pub fn page(endpoint? : String, theme? : Theme) -> String
The page as HTML, for a server whose endpoint answers at endpoint: a path on the same origin, or an absolute URL. It lists the tools, resources, resource templates and prompts the server offers and calls them over the endpoint, showing the JSON-RPC request it built and the reply it got back, in either era of the protocol, chosen on the page. Server::to_asgi serves it at /docs unless told otherwise; this hands the same document to a router of your own.
pub let theme : Theme
The look page and Server::to_asgi use unless told otherwise: the one the moonmcp website wears.
pub(all) enum Theme { Site Plain } derive(Eq, @debug.Debug)
The two looks the page comes in.
pub fn Theme::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn Theme::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn Theme::to_repr(Self) -> @debug.Repr
Debug representation of this value.
Server
One server holds tools, resources, templates and prompts, and speaks both protocol eras over Streamable HTTP and stdio.
pub fn[T : @json.FromJson] decode(Map[String, Json], String) -> T raise @json.JsonDecodeError
The argument name of a call, read as T; the code #mcp.tool generates calls this for each required parameter. A string read where something else is wanted is read again as JSON, which is how the {id} of a resource template, always text, reaches an Int parameter.
pub fn[T : @json.FromJson] decode_option(Map[String, Json], String) -> T? raise @json.JsonDecodeError
The argument name of a call when it may be left out: None when it is missing or null, else the value read as decode reads it. The code #mcp.tool generates calls this for optional parameters.
pub(all) enum Scope { Public Private } derive(Eq, @debug.Debug)
Who may keep a cached list result: any intermediary, or only caches inside the same authorisation context (the cacheScope of a cacheable result).
pub fn Scope::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn Scope::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn Scope::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub struct Server { info : @types.Implementation instructions : String? ttl_ms : Int32 scope : Scope
An MCP server: the tools, resources, resource templates and prompts it offers, and who it says it is. It speaks both eras of the protocol. A request carrying its protocol version in _meta is served statelessly under the 2026-07-28 revision; an initialize request opens the handshake of the revisions before it. The same server is reached over Streamable HTTP with to_asgi, over stdio with run_stdio, or by any transport of your own through handle. ttl_ms and scope are the caching hints every list result carries under the 2026-07-28 revision. The presets say "stale at once" and "this caller only", the cautious end of both, since a server that changes what it lists per caller would otherwise leak one caller's list to the next.
pub fn Server::add_prompt(Self, @prompts.Prompt) -> Unit
Offer prompt. A second prompt under the same name replaces the first.
pub fn Server::add_resource(Self, @resources.Resource) -> Unit
Offer resource at its URI. A second resource at the same URI replaces the first.
pub fn Server::add_template(Self, @resources.ResourceTemplate) -> Unit
Offer template; a URI no fixed resource answers is matched against the templates in the order they were added.
pub fn Server::add_tool(Self, @tools.Tool) -> Unit
Offer tool. Its input schema is compiled here, so a call is checked against it before the tool runs. A schema that does not compile is a mistake in the program, not in a request, so it aborts now rather than failing the first call. A second tool under the same name replaces the first.
pub async fn Server::handle(Self, Json) -> Json?
Answer one JSON-RPC message, the way every transport does (← the low-level server's message loop). None is the answer to a notification. A message that is not JSON-RPC at all is answered with the error JSON-RPC prescribes, under a null id.
pub fn Server::new(String, version? : String, title? : String, instructions? : String, ttl_ms? : Int32, scope? : Scope) -> Self
Construct a value with the given fields.
pub fn Server::prompt(Self, String, async (Map[String, Json]) -> String, title? : String, description? : String, arguments? : Array[@types.PromptArgument]) -> Unit
Offer a prompt rendered as one user message (← @mcp.prompt).
pub fn Server::resource(Self, String, async () -> String, name? : String, title? : String, description? : String, mime_type? : String) -> Unit
Offer a resource read as text (← @mcp.resource(uri)).
pub async fn Server::serve_lines(Self, async () -> String?, async (String) -> Unit) -> Unit
Serve newline-delimited JSON-RPC: read a line with read until it gives None, answer it, and write the reply as one line (← the stdio transport, over any pair of streams). A line that is not JSON is answered with a parse error; a blank one is skipped. Requests are answered one at a time, in the order they arrive.
pub fn Server::template(Self, String, async (Map[String, Json]) -> String, name? : String, title? : String, description? : String, mime_type? : String) -> Unit
Offer the resources an RFC 6570 template names, read as text with the parameters the URI matched (← @mcp.resource("users://{id}")). A template that does not parse aborts at registration.
pub fn Server::to_asgi(Self, path? : String, origins? : Array[String], docs? : String?, theme? : @docs.Theme) -> async (@spec.Scope, async () -> @spec.Event, async (@spec.Event) -> Unit) -> Unit
The server as an ASGI application serving the MCP endpoint at path. Run it with mooncat, or mount it beside a moonapi app. Every message is its own POST, answered with one JSON object, or 202 for a notification. Sessions, the GET stream and DELETE belong to the revisions before 2026-07-28 and are optional there; this server keeps no session, so GET and DELETE answer 405. A request whose Origin header names another site is refused with 403, as the transport requires against DNS rebinding. An origin passes when its host is the request's own Host, a loopback address, or one listed in origins. docs names the path the documentation page is served at, beside the endpoint: a browser opened on it lists what the server offers and calls it, in both eras of the protocol. It is on at /docs unless told otherwise, as an API framework's interactive docs are; docs=None leaves it off, and a path equal to the endpoint's is ignored. theme picks its look, the moonmcp website's by default. The page carries no credentials of its own.
pub fn Server::tool(Self, String, async (Map[String, Json]) -> Json, input_schema? : Json, title? : String, description? : String, output_schema? : Json, annotations? : @types.ToolAnnotations) -> Unit
Offer a tool whose handler returns any JSON value (← @mcp.tool). An object becomes structured content as well as text; anything else becomes text. An error the handler raises becomes a result marked isError, which the model reads and can correct itself from. A name the protocol does not allow aborts at registration.
pub async fn Server::run_stdio(self : Server) -> Unit
Serve over the process's standard input and output: one message per line each way, until standard input closes. Anything else the program prints belongs on standard error, since standard output carries nothing but messages.
Tools
A tool: a handler, an input schema, and a typed result.
pub fn convert_to_content(Json) -> Array[@types.ContentBlock] raise @json.JsonDecodeError
Convert a raw result to a sequence of content blocks.
pub fn default_title(String) -> String
A title derived from a tool name.
pub fn is_valid_tool_name(String) -> Bool
Whether a tool name is valid per the MCP specification (SEP-986): 1-64 characters of letters, digits, underscores and hyphens.
pub(all) struct Tool { component : @component.ComponentBase parameters : Json output_schema : Json? annotations : @types.ToolAnnotations? execution : @types.ToolExecution? timeout : Double? run_fn : async (Map[String, Json]) -> ToolResult raise @exceptions.FastMCPError }
A registered tool.
pub fn Tool::base(Self) -> @component.ComponentBase
The shared component metadata.
pub fn Tool::convert_result(Self, Json) -> ToolResult raise @exceptions.FastMCPError
Convert a raw return value to a ToolResult, honouring the declared output schema.
pub async fn Tool::dispatch(Self, Map[String, Json]) -> ToolResult raise @exceptions.FastMCPError
Server entry point for tool execution; subclasses customise dispatch by supplying a different run_fn at construction.
pub fn Tool::get_meta(Self) -> Map[String, Json]
Arbitrary metadata carried with the component.
pub fn Tool::identifier(Self) -> String
The stable identifier used in listings.
pub fn Tool::key(Self) -> String
The de-duplication key used in the registry.
pub fn Tool::new(String, parameters~ : Json, run_fn~ : async (Map[String, Json]) -> ToolResult raise @exceptions.FastMCPError, version? : String, title? : String, description? : String, icons? : Array[@types.Icon], tags? : @set.Set[String], meta? : Map[String, Json], annotations? : @types.ToolAnnotations, output_schema? : Json, execution? : @types.ToolExecution, timeout? : Double, task_config? : @tasks.TaskConfig) -> Self raise @exceptions.FastMCPError
Register a tool. parameters is the JSON schema of its arguments and run_fn executes it.
pub async fn Tool::run(Self, Map[String, Json]) -> ToolResult raise @exceptions.FastMCPError
Run the tool with arguments.
pub fn Tool::to_mcp_tool(Self) -> @types.Tool
Convert the tool to its wire representation. Title precedence: explicit title, then annotation title, then a title derived from the name.
pub impl @component.Component for Tool
A public item of this server framework.
pub(all) struct ToolResult { content : Array[@types.ContentBlock] structured_content : Map[String, Json]? meta : Map[String, Json]? is_error : Bool raw_mcp_result : @types.CallToolResult? input_required : @types.InputRequiredResult? } derive(Eq, @debug.Debug)
The canonical result of running a tool.
pub fn ToolResult::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn ToolResult::from_mcp_result(@types.CallToolResult) -> Self
Wrap a protocol result while preserving its exact wire representation.
pub fn ToolResult::input_required(@types.InputRequiredResult) -> Self
Wrap a client-input ask (SEP-2322) as an ordinary tool result.
pub fn ToolResult::is_input_required(Self) -> Bool
Whether this result carries a client-input ask (SEP-2322).
pub fn ToolResult::new(content? : Array[@types.ContentBlock], structured_content? : Map[String, Json], meta? : Map[String, Json], is_error? : Bool) -> Self raise @exceptions.FastMCPError
Register a tool. parameters is the JSON schema of its arguments and run_fn executes it.
pub fn ToolResult::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn ToolResult::to_mcp_result(Self) -> @types.CallToolResult
Convert to the protocol result, keeping the original wire representation when one was preserved.
pub fn ToolResult::to_repr(Self) -> @debug.Repr
Debug representation of this value.
Resources
A resource: a URI and a reader. Templates fill a URI pattern from arguments.
pub fn contains_path_traversal(String) -> Bool
Whether value contains .. as a path component, considering both separators. Dots inside a single segment are not traversal.
pub fn convert_raw_to_resource_result(RawResourceValue, mime_type? : String, meta? : Map[String, Json]) -> ResourceResult
Wrap a resource function's return value in a ResourceResult. Shared by Resource and ResourceTemplate so both honour the MIME type the component declares in listings: a component that advertises text/csv must not serve text/plain on read.
pub fn encode_literal(String) -> String
A public item of this server framework.
pub fn expand_uri_template(String, Map[String, Json]) -> String
Expand a URI template with parameters — the inverse of match_uri_template. Params use underscored keys but templates may use hyphens, so both spellings are tried.
pub fn extract_exploded_query_params(String) -> Array[String]
Extract query parameter names declared with the explode modifier: {?tags*} marks tags as repeatable.
pub fn extract_query_params(String) -> Array[String]
Extract query parameter names from RFC 6570 {?param1,param2} syntax. The explode modifier is stripped, so {?tags*} yields tags.
pub fn forward_uri(String, Map[String, Json], String) -> String
Build the URI a forwarding layer (mount or proxy) sends to the server behind it: the path is expanded from the template, but the query string is carried over from the incoming URI byte for byte.
pub fn is_absolute_path(String) -> Bool
Whether value looks like an absolute filesystem path: rooted at / or \\, UNC-prefixed, or a Windows drive letter path.
pub fn match_uri_template(String, String, list_params? : Array[String], segments? : Array[TemplateSegment]) -> Map[String, Json]?
Match a URI against a template and extract both path and query parameters, percent-decoded. list_params names non-exploded query parameters that hold lists; their first value is comma-split per RFC 6570 section 3.2.8. Pass pre-parsed segments when the caller already holds them.
pub fn parse_template(String) -> Array[TemplateSegment]
Parse the path portion of a URI template into literal and variable segments; query blocks are dropped for path matching.
pub fn parse_template_params(String) -> @set.Set[String]
All parameter names a template declares, hyphens normalised to underscores, path and query parameters combined.
pub fn pct_encode(String, safe? : String) -> String
A public item of this server framework.
pub fn resolve_security(ResourceSecuritySetting, ResourceSecurity?) -> ResourceSecurity?
Resolve the effective security policy for this template.
pub(all) enum ContentPayload { Text(String) Blob(Bytes) } derive(Eq, @debug.Debug)
The payload of a resource content item: inline text or raw bytes.
pub fn ContentPayload::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn ContentPayload::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn ContentPayload::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub(all) enum RawResourceValue { Text(String) Blob(Bytes) Ready(ResourceResult) }
What a resource read function may return: text, bytes or a full result.
pub(all) struct Resource { component : @component.ComponentBase uri : String mime_type : String annotations : @types.Annotations? read_fn : async () -> RawResourceValue raise @exceptions.FastMCPError }
A registered resource.
pub fn Resource::base(Self) -> @component.ComponentBase
The shared component metadata.
pub fn Resource::binary(String, data~ : Bytes, name? : String, version? : String, title? : String, description? : String, icons? : Array[@types.Icon], mime_type? : String, tags? : @set.Set[String], meta? : Map[String, Json], annotations? : @types.Annotations) -> Self
A resource backed by inline bytes.
pub fn Resource::convert_result(Self, RawResourceValue) -> ResourceResult
Convert a raw result to a ResourceResult, forwarding the template's declared MIME type so reads match what it advertises in listings.
pub fn Resource::from_function(String, read_fn~ : async () -> RawResourceValue raise @exceptions.FastMCPError, name? : String, version? : String, title? : String, description? : String, icons? : Array[@types.Icon], mime_type? : String, tags? : @set.Set[String], meta? : Map[String, Json], annotations? : @types.Annotations) -> Self
A resource backed by a closure computing its value on read.
pub fn Resource::get_meta(Self) -> Map[String, Json]
Arbitrary metadata carried with the component.
pub fn Resource::identifier(Self) -> String
The stable identifier used in listings.
pub fn Resource::key(Self) -> String
The de-duplication key used in the registry.
pub fn Resource::new(String, read_fn~ : async () -> RawResourceValue raise @exceptions.FastMCPError, name? : String, version? : String, title? : String, description? : String, icons? : Array[@types.Icon], mime_type? : String, tags? : @set.Set[String], meta? : Map[String, Json], annotations? : @types.Annotations) -> Self
Register a resource template; read_fn receives the parameters matched from the request URI.
pub async fn Resource::read(Self) -> RawResourceValue raise @exceptions.FastMCPError
Read the resource content with the matched parameters.
pub async fn Resource::read_result(Self) -> ResourceResult raise @exceptions.FastMCPError
Server entry point for template reads.
pub fn Resource::text(String, text~ : String, name? : String, version? : String, title? : String, description? : String, icons? : Array[@types.Icon], mime_type? : String, tags? : @set.Set[String], meta? : Map[String, Json], annotations? : @types.Annotations) -> Self
A resource backed by inline text.
pub fn Resource::to_mcp_resource(Self) -> @types.Resource
Convert the resource to its wire representation.
pub impl @component.Component for Resource
A public item of this server framework.
pub(all) struct ResourceContent { content : ContentPayload mime_type : String? meta : Map[String, Json]? } derive(Eq, @debug.Debug)
A single resource content item with optional MIME type and metadata.
pub fn ResourceContent::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn ResourceContent::new(ContentPayload, mime_type? : String, meta? : Map[String, Json]) -> Self
Register a resource template; read_fn receives the parameters matched from the request URI.
pub fn ResourceContent::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn ResourceContent::to_mcp_resource_contents(Self, String) -> @types.ResourceContents
Convert to the wire resource contents type; bytes are base64-encoded.
pub fn ResourceContent::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub(all) struct ResourceResult { contents : Array[ResourceContent] meta : Map[String, Json]? input_required : @types.InputRequiredResult? } derive(Eq, @debug.Debug)
The canonical result of a resource read.
pub fn ResourceResult::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn ResourceResult::input_required(@types.InputRequiredResult) -> Self
Wrap a client-input ask (SEP-2322) as an ordinary resource result.
pub fn ResourceResult::is_input_required(Self) -> Bool
Whether this result carries a client-input ask (SEP-2322).
pub fn ResourceResult::new(Array[ResourceContent], meta? : Map[String, Json]) -> Self
Register a resource template; read_fn receives the parameters matched from the request URI.
pub fn ResourceResult::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn ResourceResult::to_mcp_result(Self, String) -> @types.ReadResourceResult
Convert to the wire read-resource result.
pub fn ResourceResult::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub(all) struct ResourceSecurity { reject_path_traversal : Bool reject_absolute_paths : Bool reject_null_bytes : Bool exempt_params : @set.Set[String] } derive(Eq, @debug.Debug)
Security policy applied to extracted resource template parameters. The checks run after a URI has matched a template and its parameter values have been extracted and percent-decoded; they catch path-traversal and absolute-path injection regardless of how the value was encoded in the URI.
pub fn ResourceSecurity::default() -> Self
Secure-by-default policy: traversal, absolute paths and null bytes all rejected.
pub fn ResourceSecurity::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn ResourceSecurity::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn ResourceSecurity::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub fn ResourceSecurity::validate(Self, Map[String, Json]) -> String?
Check all parameter values against the policy. String values (and lists of strings, from wildcard parameters) are screened; non-string values are ignored. Returns the name of the first failing parameter, if any.
pub(all) enum ResourceSecuritySetting { Inherit Explicit(ResourceSecurity) Disabled } derive(Eq, @debug.Debug)
Per-component security setting: inherit the server-wide default, apply an explicit policy, or disable screening.
pub fn ResourceSecuritySetting::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn ResourceSecuritySetting::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn ResourceSecuritySetting::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub(all) struct ResourceTemplate { component : @component.ComponentBase uri_template : String mime_type : String parameters : Json annotations : @types.Annotations? security : ResourceSecuritySetting list_query_params : @set.Set[String] segments : Array[TemplateSegment] read_fn : async (Map[String, Json]) -> RawResourceValue raise @exceptions.FastMCPError }
A template for dynamically creating resources.
pub fn ResourceTemplate::base(Self) -> @component.ComponentBase
The shared component metadata.
pub fn ResourceTemplate::convert_result(Self, RawResourceValue) -> ResourceResult
Convert a raw result to a ResourceResult, forwarding the template's declared MIME type so reads match what it advertises in listings.
pub fn ResourceTemplate::create_resource(Self, String, Map[String, Json]) -> Resource
Create a concrete resource from the template for the given parameters.
pub fn ResourceTemplate::from_mcp_template(@types.ResourceTemplate) -> Self raise @exceptions.FastMCPError
Create a template from a raw wire template, for remote servers whose original function is lost.
pub fn ResourceTemplate::get_meta(Self) -> Map[String, Json]
Arbitrary metadata carried with the component.
pub fn ResourceTemplate::identifier(Self) -> String
The stable identifier used in listings.
pub fn ResourceTemplate::key(Self) -> String
The de-duplication key used in the registry.
pub fn ResourceTemplate::matches(Self, String, ResourceSecurity?) -> Map[String, Json]? raise @exceptions.FastMCPError
Check if a URI matches this template and extract its parameters, screening extracted values against the effective security policy.
pub fn ResourceTemplate::new(String, parameters~ : Json, read_fn~ : async (Map[String, Json]) -> RawResourceValue raise @exceptions.FastMCPError, name? : String, version? : String, title? : String, description? : String, icons? : Array[@types.Icon], mime_type? : String, tags? : @set.Set[String], meta? : Map[String, Json], annotations? : @types.Annotations, security? : ResourceSecuritySetting, list_query_params? : @set.Set[String]) -> Self raise @exceptions.FastMCPError
Register a resource template; read_fn receives the parameters matched from the request URI.
pub async fn ResourceTemplate::read(Self, Map[String, Json]) -> RawResourceValue raise @exceptions.FastMCPError
Read the resource content with the matched parameters.
pub async fn ResourceTemplate::read_result(Self, String, Map[String, Json]) -> ResourceResult raise @exceptions.FastMCPError
Server entry point for template reads.
pub fn ResourceTemplate::resolve_security(Self, ResourceSecurity?) -> ResourceSecurity?
Resolve the effective security policy for this template.
pub fn ResourceTemplate::to_mcp_template(Self) -> @types.ResourceTemplate
Convert the template to its wire representation.
pub impl @component.Component for ResourceTemplate
A public item of this server framework.
pub(all) enum TemplateSegment { Literal(Array[Char]) PathVar(name~ : String, wildcard~ : Bool) }
One parsed chunk of a template's path portion.
Prompts
A prompt: a renderer that turns arguments into messages.
pub(all) struct Message { role : @types.Role content : @types.ContentBlock } derive(Eq, @debug.Debug)
A wrapper for a prompt message with a role.
pub fn Message::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn Message::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn Message::of_content(@types.ContentBlock, role? : @types.Role) -> Self
Create a message from an existing content block, user role by default.
pub fn Message::text(String, role? : @types.Role) -> Self
Create a message from plain text, user role by default.
pub fn Message::to_mcp_prompt_message(Self) -> @types.PromptMessage
Convert to the wire prompt message.
pub fn Message::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub(all) struct Prompt { component : @component.ComponentBase arguments : Array[@types.PromptArgument]? render_fn : async (Map[String, Json]) -> RenderedPrompt raise @exceptions.FastMCPError }
A prompt template that can be rendered with arguments.
pub fn Prompt::base(Self) -> @component.ComponentBase
The shared component metadata.
pub fn Prompt::convert_result(Self, RenderedPrompt) -> PromptResult
Convert a rendered value to a canonical result.
pub fn Prompt::get_meta(Self) -> Map[String, Json]
Arbitrary metadata carried with the component.
pub fn Prompt::identifier(Self) -> String
The stable identifier used in listings.
pub fn Prompt::key(Self) -> String
The de-duplication key used in the registry.
pub fn Prompt::new(String, render_fn~ : async (Map[String, Json]) -> RenderedPrompt raise @exceptions.FastMCPError, version? : String, title? : String, description? : String, icons? : Array[@types.Icon], tags? : @set.Set[String], meta? : Map[String, Json], arguments? : Array[@types.PromptArgument]) -> Self
Register a prompt; render_fn renders it with the given arguments.
pub async fn Prompt::render(Self, Map[String, Json]) -> RenderedPrompt raise @exceptions.FastMCPError
Render the prompt with arguments.
pub async fn Prompt::render_result(Self, Map[String, Json]) -> PromptResult raise @exceptions.FastMCPError
Server entry point for prompt rendering.
pub fn Prompt::to_mcp_prompt(Self) -> @types.Prompt
Convert the prompt to its wire representation.
pub impl @component.Component for Prompt
A public item of this server framework.
pub(all) struct PromptResult { messages : Array[Message] description : String? meta : Map[String, Json]? input_required : @types.InputRequiredResult? } derive(Eq, @debug.Debug)
The canonical result of rendering a prompt.
pub fn PromptResult::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn PromptResult::input_required(@types.InputRequiredResult) -> Self
Wrap a client-input ask (SEP-2322) as an ordinary prompt result.
pub fn PromptResult::is_input_required(Self) -> Bool
Whether this result carries a client-input ask (SEP-2322).
pub fn PromptResult::new(Array[Message], description? : String, meta? : Map[String, Json]) -> Self
Register a prompt; render_fn renders it with the given arguments.
pub fn PromptResult::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn PromptResult::to_mcp_prompt_result(Self) -> @types.GetPromptResult
Convert to the wire get-prompt result.
pub fn PromptResult::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub(all) enum RenderedPrompt { Text(String) Messages(Array[Message]) Ready(PromptResult) }
What a prompt's render function may return: plain text, a message list, or an already-assembled result.
Wire types
The JSON-RPC and MCP data shapes, method constants and protocol-version helpers shared with the wire.
pub let client_capabilities_meta_key : String
A constant value.
pub let client_info_meta_key : String
A constant value.
pub fn client_request_frame(RequestId, ClientRequest) -> Json
A public item of this server framework.
pub fn core_result_types() -> Array[String]
Result type names that may appear as the resultType of a discover reply.
pub fn handshake_protocol_versions() -> Array[String]
A public item of this server framework.
pub let internal_error : Int32
A constant value.
pub let invalid_params : Int32
A constant value.
pub let invalid_request : Int32
A constant value.
pub let latest_protocol_version : String
The protocol version this implementation speaks.
pub fn logging_level_from_wire(String) -> LoggingLevel?
A public item of this server framework.
pub let method_completion_complete : String
A constant value.
pub let method_elicitation_create : String
A constant value.
pub let method_elicitation_create_form : String
A constant value.
pub let method_initialize : String
Canonical JSON-RPC method and notification names.
pub let method_input_response : String
A constant value.
pub let method_logging_set_level : String
A constant value.
pub let method_not_found : Int32
A constant value.
pub let method_ping : String
A constant value.
pub let method_prompts_get : String
A constant value.
pub let method_prompts_list : String
A constant value.
pub let method_resources_list : String
A constant value.
pub let method_resources_read : String
A constant value.
pub let method_resources_subscribe : String
A constant value.
pub let method_resources_unsubscribe : String
A constant value.
pub let method_roots_list : String
A constant value.
pub let method_sampling_create_message : String
A constant value.
pub let method_server_discover : String
A constant value.
pub let method_tools_call : String
A constant value.
pub let method_tools_list : String
A constant value.
pub fn modern_protocol_versions() -> Array[String]
Protocol versions with modern semantics (used for capability gating).
pub let notification_cancelled : String
A constant value.
pub let notification_initialized : String
A constant value.
pub let notification_message : String
A constant value.
pub let notification_progress : String
A constant value.
pub let notification_prompt_list_changed : String
A constant value.
pub let notification_resource_list_changed : String
A constant value.
pub let notification_resource_updated : String
A constant value.
pub let notification_roots_list_changed : String
A constant value.
pub let notification_tool_list_changed : String
A constant value.
pub fn parse_client_request(Json) -> ClientRequest raise @json.JsonDecodeError
Decode a request frame into a typed ClientRequest.
pub let parse_error : Int32
JSON-RPC error codes defined by the MCP specification.
pub fn parse_message(Json) -> JSONRPCMessage raise @json.JsonDecodeError
Parse one wire frame.
pub fn parse_server_request(Json) -> ServerRequest raise @json.JsonDecodeError
Decode a request frame into a typed ServerRequest.
pub let protocol_version_meta_key : String
A constant value.
pub fn role_from_wire(String) -> Role?
A public item of this server framework.
pub let server_info_meta_key : String
Request _meta keys used to propagate session facts.
pub fn server_request_frame(RequestId, ServerRequest) -> Json
A public item of this server framework.
pub fn text_block(String) -> ContentBlock
Shorthand for a plain text block without annotations.
pub(all) struct Annotations { audience : Array[String]? priority : Double? } derive(Eq, @debug.Debug)
Audience and priority hints attached to content.
pub fn Annotations::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn Annotations::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn Annotations::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn Annotations::to_json(Self) -> Json
Encode this shape to JSON.
pub fn Annotations::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for Annotations
A public item of this server framework.
pub impl @json.FromJson for Annotations
A public item of this server framework.
pub(all) struct CallToolRequestParams { name : String arguments : Map[String, Json]? meta : Map[String, Json]? } derive(Eq, @debug.Debug)
tools/call request parameters.
pub fn CallToolRequestParams::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn CallToolRequestParams::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn CallToolRequestParams::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn CallToolRequestParams::progress_token(Self) -> String?
The progress token carried in the request meta.
pub fn CallToolRequestParams::to_json(Self) -> Json
Encode this shape to JSON.
pub fn CallToolRequestParams::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for CallToolRequestParams
A public item of this server framework.
pub impl @json.FromJson for CallToolRequestParams
A public item of this server framework.
pub(all) struct CallToolResult { content : Array[ContentBlock] structured_content : Map[String, Json]? is_error : Bool cache_control : String? meta : Map[String, Json]? } derive(Eq, @debug.Debug)
The result of a tools/call call.
pub fn CallToolResult::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn CallToolResult::error(String) -> Self
Build an error result with the given message.
pub fn CallToolResult::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn CallToolResult::new(Array[ContentBlock]) -> Self
Construct a value with the given fields.
pub fn CallToolResult::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn CallToolResult::to_json(Self) -> Json
Encode this shape to JSON.
pub fn CallToolResult::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for CallToolResult
A public item of this server framework.
pub impl @json.FromJson for CallToolResult
A public item of this server framework.
pub(all) struct CancelledNotificationParams { request_id : RequestId reason : String? } derive(Eq, @debug.Debug)
A cancelled request, sent by the side that issued it.
pub fn CancelledNotificationParams::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn CancelledNotificationParams::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn CancelledNotificationParams::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn CancelledNotificationParams::to_json(Self) -> Json
Encode this shape to JSON.
pub fn CancelledNotificationParams::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for CancelledNotificationParams
A public item of this server framework.
pub impl @json.FromJson for CancelledNotificationParams
A public item of this server framework.
pub(all) struct ClientCapabilities { experimental : Map[String, Json]? roots_list_changed : Bool? sampling : Bool? elicitation : Bool? tasks : Bool? } derive(Eq, @debug.Debug)
What a client supports.
pub fn ClientCapabilities::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn ClientCapabilities::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn ClientCapabilities::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn ClientCapabilities::to_json(Self) -> Json
Encode this shape to JSON.
pub fn ClientCapabilities::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for ClientCapabilities
A public item of this server framework.
pub impl @json.FromJson for ClientCapabilities
A public item of this server framework.
pub(all) enum ClientRequest { Initialize(InitializeRequestParams) Ping(meta~ : Map[String, Json]?) ListTools(PaginatedRequestParams) CallTool(CallToolRequestParams) ListResources(PaginatedRequestParams) ReadResource(ReadResourceRequestParams) Subscribe(SubscribeRequestParams) Unsubscribe(SubscribeRequestParams) ListPrompts(PaginatedRequestParams) GetPrompt(GetPromptRequestParams) Complete(CompleteRequestParams) SetLevel(SetLevelRequestParams) InputResponse(InputResponseRequestParams) } derive(Eq, @debug.Debug)
A typed request a client can send to a server.
pub fn ClientRequest::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn ClientRequest::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn ClientRequest::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn ClientRequest::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub fn ClientRequest::verb(Self) -> String
The method name a typed request will be sent under.
pub impl @json.FromJson for ClientRequest
A public item of this server framework.
pub(all) struct CompleteRequestParams { context : CompletionContext meta : Map[String, Json]? } derive(Eq, @debug.Debug)
completion/complete request parameters.
pub fn CompleteRequestParams::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn CompleteRequestParams::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn CompleteRequestParams::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn CompleteRequestParams::to_json(Self) -> Json
Encode this shape to JSON.
pub fn CompleteRequestParams::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for CompleteRequestParams
A public item of this server framework.
pub impl @json.FromJson for CompleteRequestParams
A public item of this server framework.
pub(all) struct CompleteResult { completion : Completion cache_control : String? meta : Map[String, Json]? } derive(Eq, @debug.Debug)
The result of a completion/complete call.
pub fn CompleteResult::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn CompleteResult::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn CompleteResult::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn CompleteResult::to_json(Self) -> Json
Encode this shape to JSON.
pub fn CompleteResult::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for CompleteResult
A public item of this server framework.
pub impl @json.FromJson for CompleteResult
A public item of this server framework.
pub(all) struct Completion { values : Array[String] total : Int32? has_more : Bool? } derive(Eq, @debug.Debug)
Completion values returned by completion/complete.
pub fn Completion::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn Completion::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn Completion::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn Completion::to_json(Self) -> Json
Encode this shape to JSON.
pub fn Completion::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for Completion
A public item of this server framework.
pub impl @json.FromJson for Completion
A public item of this server framework.
pub(all) struct CompletionArgument { name : String value : String } derive(Eq, @debug.Debug)
A data shape. The fields below are its wire and in-memory members.
pub fn CompletionArgument::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn CompletionArgument::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn CompletionArgument::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn CompletionArgument::to_json(Self) -> Json
Encode this shape to JSON.
pub fn CompletionArgument::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for CompletionArgument
A public item of this server framework.
pub impl @json.FromJson for CompletionArgument
A public item of this server framework.
pub(all) struct CompletionContext { reference : Reference argument : CompletionArgument } derive(Eq, @debug.Debug)
A data shape. The fields below are its wire and in-memory members.
pub fn CompletionContext::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn CompletionContext::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn CompletionContext::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn CompletionContext::to_json(Self) -> Json
Encode this shape to JSON.
pub fn CompletionContext::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for CompletionContext
A public item of this server framework.
pub impl @json.FromJson for CompletionContext
A public item of this server framework.
pub(all) enum ContentBlock { Text(text~ : String, annotations~ : Annotations?, meta~ : Map[String, Json]?) Image(data~ : String, mime_type~ : String, annotations~ : Annotations?, meta~ : Map[String, Json]?) Audio(data~ : String, mime_type~ : String, annotations~ : Annotations?, meta~ : Map[String, Json]?) ResourceLink(uri~ : String, name~ : String, title~ : String?, description~ : String?, mime_type~ : String?, size~ : Int32?, annotations~ : Annotations?, meta~ : Map[String, Json]?) EmbeddedResource(resource~ : ResourceContents, annotations~ : Annotations?, meta~ : Map[String, Json]?) } derive(Eq, @debug.Debug)
A block of content in a tool result, sampling message or prompt message.
pub fn ContentBlock::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn ContentBlock::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn ContentBlock::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn ContentBlock::to_json(Self) -> Json
Encode this shape to JSON.
pub fn ContentBlock::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for ContentBlock
A public item of this server framework.
pub impl @json.FromJson for ContentBlock
A public item of this server framework.
pub(all) struct CreateMessageRequestParams { messages : Array[SamplingMessage] system_message : String? include_context : String? max_tokens : Int32 temperature : Double? stop_sequences : Array[String]? model_preferences : ModelPreferences? meta : Map[String, Json]? } derive(Eq, @debug.Debug)
sampling/createMessage request parameters.
pub fn CreateMessageRequestParams::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn CreateMessageRequestParams::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn CreateMessageRequestParams::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn CreateMessageRequestParams::to_json(Self) -> Json
Encode this shape to JSON.
pub fn CreateMessageRequestParams::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for CreateMessageRequestParams
A public item of this server framework.
pub impl @json.FromJson for CreateMessageRequestParams
A public item of this server framework.
pub(all) struct CreateMessageResult { model : String stop_reason : String? role : Role content : ContentBlock cache_control : String? meta : Map[String, Json]? } derive(Eq, @debug.Debug)
The result of a sampling/createMessage call.
pub fn CreateMessageResult::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn CreateMessageResult::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn CreateMessageResult::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn CreateMessageResult::to_json(Self) -> Json
Encode this shape to JSON.
pub fn CreateMessageResult::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for CreateMessageResult
A public item of this server framework.
pub impl @json.FromJson for CreateMessageResult
A public item of this server framework.
pub(all) struct CreateTaskResult { task : Json meta : Map[String, Json]? } derive(Eq, @debug.Debug)
A task handle minted for task-augmented execution (SEP-2663).
pub fn CreateTaskResult::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn CreateTaskResult::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn CreateTaskResult::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn CreateTaskResult::to_json(Self) -> Json
Encode this shape to JSON.
pub fn CreateTaskResult::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for CreateTaskResult
A public item of this server framework.
pub impl @json.FromJson for CreateTaskResult
A public item of this server framework.
pub(all) struct DiscoverResult { result_type : String result : Json meta : Map[String, Json]? } derive(Eq, @debug.Debug)
A discovery reply wrapping any core result, tagged with its type.
pub fn DiscoverResult::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn DiscoverResult::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn DiscoverResult::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn DiscoverResult::to_json(Self) -> Json
Encode this shape to JSON.
pub fn DiscoverResult::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for DiscoverResult
A public item of this server framework.
pub impl @json.FromJson for DiscoverResult
A public item of this server framework.
pub(all) struct ElicitRequestParams { message : String requested_schema : Map[String, Json]? url : String? meta : Map[String, Json]? } derive(Eq, @debug.Debug)
elicitation/create request parameters, covering both the form- and URL-based variants.
pub fn ElicitRequestParams::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn ElicitRequestParams::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn ElicitRequestParams::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn ElicitRequestParams::to_json(Self) -> Json
Encode this shape to JSON.
pub fn ElicitRequestParams::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for ElicitRequestParams
A public item of this server framework.
pub impl @json.FromJson for ElicitRequestParams
A public item of this server framework.
pub(all) struct ElicitResult { action : String content : Map[String, Json]? cache_control : String? meta : Map[String, Json]? } derive(Eq, @debug.Debug)
The result of an elicitation round trip.
pub fn ElicitResult::accept(Map[String, Json]) -> Self
Accept an elicitation with the given content.
pub fn ElicitResult::cancel() -> Self
Cancel an elicitation.
pub fn ElicitResult::decline() -> Self
Decline an elicitation.
pub fn ElicitResult::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn ElicitResult::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn ElicitResult::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn ElicitResult::to_json(Self) -> Json
Encode this shape to JSON.
pub fn ElicitResult::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for ElicitResult
A public item of this server framework.
pub impl @json.FromJson for ElicitResult
A public item of this server framework.
pub(all) struct EmptyResult { meta : Map[String, Json]? } derive(Eq, @debug.Debug)
A bare result with no payload.
pub fn EmptyResult::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn EmptyResult::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn EmptyResult::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn EmptyResult::to_json(Self) -> Json
Encode this shape to JSON.
pub fn EmptyResult::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for EmptyResult
A public item of this server framework.
pub impl @json.FromJson for EmptyResult
A public item of this server framework.
pub(all) struct ErrorData { code : Int32 message : String data : Json? } derive(Eq, ToJson, @debug.Debug, @json.FromJson)
Wire-format error payload carried by JSON-RPC error responses.
pub fn ErrorData::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn ErrorData::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn ErrorData::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn ErrorData::to_json(Self) -> Json
Encode this shape to JSON.
pub fn ErrorData::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub(all) struct GetPromptRequestParams { name : String arguments : Map[String, Json]? meta : Map[String, Json]? } derive(Eq, @debug.Debug)
prompts/get request parameters.
pub fn GetPromptRequestParams::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn GetPromptRequestParams::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn GetPromptRequestParams::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn GetPromptRequestParams::to_json(Self) -> Json
Encode this shape to JSON.
pub fn GetPromptRequestParams::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for GetPromptRequestParams
A public item of this server framework.
pub impl @json.FromJson for GetPromptRequestParams
A public item of this server framework.
pub(all) struct GetPromptResult { description : String? messages : Array[PromptMessage] cache_control : String? meta : Map[String, Json]? } derive(Eq, @debug.Debug)
The result of a prompts/get call.
pub fn GetPromptResult::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn GetPromptResult::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn GetPromptResult::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn GetPromptResult::to_json(Self) -> Json
Encode this shape to JSON.
pub fn GetPromptResult::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for GetPromptResult
A public item of this server framework.
pub impl @json.FromJson for GetPromptResult
A public item of this server framework.
pub(all) struct Icon { src : String mime_type : String? sizes : Array[String]? } derive(Eq, @debug.Debug)
An icon for display in user interfaces.
pub fn Icon::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn Icon::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn Icon::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn Icon::to_json(Self) -> Json
Encode this shape to JSON.
pub fn Icon::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for Icon
A public item of this server framework.
pub impl @json.FromJson for Icon
A public item of this server framework.
pub(all) struct Implementation { name : String title : String? version : String } derive(Eq, @debug.Debug)
The name and version of an MCP implementation.
pub fn Implementation::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn Implementation::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn Implementation::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn Implementation::to_json(Self) -> Json
Encode this shape to JSON.
pub fn Implementation::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for Implementation
A public item of this server framework.
pub impl @json.FromJson for Implementation
A public item of this server framework.
pub(all) struct InitializeRequestParams { protocol_version : String capabilities : ClientCapabilities client_info : Implementation meta : Map[String, Json]? } derive(Eq, @debug.Debug)
initialize request parameters.
pub fn InitializeRequestParams::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn InitializeRequestParams::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn InitializeRequestParams::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn InitializeRequestParams::to_json(Self) -> Json
Encode this shape to JSON.
pub fn InitializeRequestParams::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for InitializeRequestParams
A public item of this server framework.
pub impl @json.FromJson for InitializeRequestParams
A public item of this server framework.
pub(all) struct InitializeResult { protocol_version : String capabilities : ServerCapabilities server_info : Implementation instructions : String? meta : Map[String, Json]? } derive(Eq, @debug.Debug)
initialize result: capabilities and server description.
pub fn InitializeResult::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn InitializeResult::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn InitializeResult::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn InitializeResult::to_json(Self) -> Json
Encode this shape to JSON.
pub fn InitializeResult::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for InitializeResult
A public item of this server framework.
pub impl @json.FromJson for InitializeResult
A public item of this server framework.
pub(all) struct InputRequest { id : String request : Json } derive(Eq, @debug.Debug)
One guard-channel request a client must answer (SEP-2322).
pub fn InputRequest::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn InputRequest::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn InputRequest::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn InputRequest::to_json(Self) -> Json
Encode this shape to JSON.
pub fn InputRequest::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for InputRequest
A public item of this server framework.
pub impl @json.FromJson for InputRequest
A public item of this server framework.
pub(all) struct InputRequiredResult { input_requests : Array[InputRequest] request_state : String? meta : Map[String, Json]? } derive(Eq, @debug.Debug)
Tells the client to answer the carried requests and re-issue the call.
pub fn InputRequiredResult::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn InputRequiredResult::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn InputRequiredResult::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn InputRequiredResult::to_json(Self) -> Json
Encode this shape to JSON.
pub fn InputRequiredResult::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for InputRequiredResult
A public item of this server framework.
pub impl @json.FromJson for InputRequiredResult
A public item of this server framework.
pub(all) struct InputResponse { request_id : String action : String content : Map[String, Json]? } derive(Eq, @debug.Debug)
A client answer to a guard-channel input request (SEP-2322).
pub fn InputResponse::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn InputResponse::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn InputResponse::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn InputResponse::to_json(Self) -> Json
Encode this shape to JSON.
pub fn InputResponse::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for InputResponse
A public item of this server framework.
pub impl @json.FromJson for InputResponse
A public item of this server framework.
pub(all) struct InputResponseRequestParams { input_responses : Map[String, Json] request_state : String? meta : Map[String, Json]? } derive(Eq, @debug.Debug)
input/response request parameters: answers keyed by request id.
pub fn InputResponseRequestParams::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn InputResponseRequestParams::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn InputResponseRequestParams::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn InputResponseRequestParams::to_json(Self) -> Json
Encode this shape to JSON.
pub fn InputResponseRequestParams::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for InputResponseRequestParams
A public item of this server framework.
pub impl @json.FromJson for InputResponseRequestParams
A public item of this server framework.
pub(all) enum JSONRPCMessage { Request(id~ : RequestId, verb~ : String, params~ : Json?) Notification(verb~ : String, params~ : Json?) Response(id~ : RequestId, result~ : Json) Error(id~ : RequestId, error~ : ErrorData) } derive(Eq, @debug.Debug)
Any message frame on the wire.
pub fn JSONRPCMessage::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn JSONRPCMessage::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn JSONRPCMessage::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn JSONRPCMessage::to_json(Self) -> Json
Encode this shape to JSON.
pub fn JSONRPCMessage::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for JSONRPCMessage
A public item of this server framework.
pub impl @json.FromJson for JSONRPCMessage
A public item of this server framework.
pub(all) struct ListPromptsResult { prompts : Array[Prompt] next_cursor : String? cache_control : String? meta : Map[String, Json]? } derive(Eq, @debug.Debug)
The result of a prompts/list call.
pub fn ListPromptsResult::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn ListPromptsResult::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn ListPromptsResult::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn ListPromptsResult::to_json(Self) -> Json
Encode this shape to JSON.
pub fn ListPromptsResult::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for ListPromptsResult
A public item of this server framework.
pub impl @json.FromJson for ListPromptsResult
A public item of this server framework.
pub(all) struct ListResourceTemplatesResult { resource_templates : Array[ResourceTemplate] next_cursor : String? cache_control : String? meta : Map[String, Json]? } derive(Eq, @debug.Debug)
The result of a resources/templates/list call.
pub fn ListResourceTemplatesResult::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn ListResourceTemplatesResult::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn ListResourceTemplatesResult::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn ListResourceTemplatesResult::to_json(Self) -> Json
Encode this shape to JSON.
pub fn ListResourceTemplatesResult::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for ListResourceTemplatesResult
A public item of this server framework.
pub impl @json.FromJson for ListResourceTemplatesResult
A public item of this server framework.
pub(all) struct ListResourcesResult { resources : Array[Resource] next_cursor : String? cache_control : String? meta : Map[String, Json]? } derive(Eq, @debug.Debug)
The result of a resources/list call.
pub fn ListResourcesResult::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn ListResourcesResult::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn ListResourcesResult::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn ListResourcesResult::to_json(Self) -> Json
Encode this shape to JSON.
pub fn ListResourcesResult::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for ListResourcesResult
A public item of this server framework.
pub impl @json.FromJson for ListResourcesResult
A public item of this server framework.
pub(all) struct ListRootsResult { roots : Array[Root] cache_control : String? meta : Map[String, Json]? } derive(Eq, @debug.Debug)
The result of a roots/list call.
pub fn ListRootsResult::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn ListRootsResult::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn ListRootsResult::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn ListRootsResult::to_json(Self) -> Json
Encode this shape to JSON.
pub fn ListRootsResult::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for ListRootsResult
A public item of this server framework.
pub impl @json.FromJson for ListRootsResult
A public item of this server framework.
pub(all) struct ListToolsResult { tools : Array[Tool] next_cursor : String? cache_control : String? meta : Map[String, Json]? } derive(Eq, @debug.Debug)
The result of a tools/list call.
pub fn ListToolsResult::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn ListToolsResult::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn ListToolsResult::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn ListToolsResult::to_json(Self) -> Json
Encode this shape to JSON.
pub fn ListToolsResult::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for ListToolsResult
A public item of this server framework.
pub impl @json.FromJson for ListToolsResult
A public item of this server framework.
pub(all) enum LoggingLevel { Debug Info Notice Warning Error Critical Alert Emergency } derive(Eq, @debug.Debug)
Verbosity levels for notifications/message, ordered debug → emergency.
pub fn LoggingLevel::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn LoggingLevel::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn LoggingLevel::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub fn LoggingLevel::to_wire(Self) -> String
Encode this value to its wire string.
pub(all) struct LoggingMessageNotificationParams { level : LoggingLevel logger : String? data : Json } derive(Eq, @debug.Debug)
A log entry streamed by the server.
pub fn LoggingMessageNotificationParams::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn LoggingMessageNotificationParams::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn LoggingMessageNotificationParams::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn LoggingMessageNotificationParams::to_json(Self) -> Json
Encode this shape to JSON.
pub fn LoggingMessageNotificationParams::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for LoggingMessageNotificationParams
A public item of this server framework.
pub impl @json.FromJson for LoggingMessageNotificationParams
A public item of this server framework.
pub(all) struct ModelHint { name : String } derive(Eq, @debug.Debug)
Client hints steering server-side model selection.
pub fn ModelHint::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn ModelHint::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn ModelHint::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn ModelHint::to_json(Self) -> Json
Encode this shape to JSON.
pub fn ModelHint::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for ModelHint
A public item of this server framework.
pub impl @json.FromJson for ModelHint
A public item of this server framework.
pub(all) struct ModelPreferences { hints : Array[ModelHint]? cost_priority : Double? speed_priority : Double? intelligence_priority : Double? } derive(Eq, @debug.Debug)
A data shape. The fields below are its wire and in-memory members.
pub fn ModelPreferences::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn ModelPreferences::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn ModelPreferences::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn ModelPreferences::to_json(Self) -> Json
Encode this shape to JSON.
pub fn ModelPreferences::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for ModelPreferences
A public item of this server framework.
pub impl @json.FromJson for ModelPreferences
A public item of this server framework.
pub(all) struct PaginatedRequestParams { cursor : String? meta : Map[String, Json]? } derive(Eq, @debug.Debug)
List requests with cursor-based pagination.
pub fn PaginatedRequestParams::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn PaginatedRequestParams::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn PaginatedRequestParams::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn PaginatedRequestParams::progress_token(Self) -> String?
The progress token carried in the request meta.
pub fn PaginatedRequestParams::to_json(Self) -> Json
Encode this shape to JSON.
pub fn PaginatedRequestParams::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for PaginatedRequestParams
A public item of this server framework.
pub impl @json.FromJson for PaginatedRequestParams
A public item of this server framework.
pub(all) struct ProgressNotificationParams { progress_token : String progress : Double message : String? total : Double? } derive(Eq, @debug.Debug)
Progress reported for an in-flight request.
pub fn ProgressNotificationParams::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn ProgressNotificationParams::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn ProgressNotificationParams::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn ProgressNotificationParams::to_json(Self) -> Json
Encode this shape to JSON.
pub fn ProgressNotificationParams::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for ProgressNotificationParams
A public item of this server framework.
pub impl @json.FromJson for ProgressNotificationParams
A public item of this server framework.
pub(all) struct Prompt { name : String title : String? description : String? arguments : Array[PromptArgument]? meta : Map[String, Json]? } derive(Eq, @debug.Debug)
A prompt template exposed to the client.
pub fn Prompt::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn Prompt::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn Prompt::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn Prompt::to_json(Self) -> Json
Encode this shape to JSON.
pub fn Prompt::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for Prompt
A public item of this server framework.
pub impl @json.FromJson for Prompt
A public item of this server framework.
pub(all) struct PromptArgument { name : String title : String? description : String? required : Bool? } derive(Eq, @debug.Debug)
One argument of a prompt template.
pub fn PromptArgument::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn PromptArgument::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn PromptArgument::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn PromptArgument::to_json(Self) -> Json
Encode this shape to JSON.
pub fn PromptArgument::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for PromptArgument
A public item of this server framework.
pub impl @json.FromJson for PromptArgument
A public item of this server framework.
pub(all) struct PromptMessage { role : Role content : ContentBlock } derive(Eq, @debug.Debug)
One message in a rendered prompt.
pub fn PromptMessage::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn PromptMessage::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn PromptMessage::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn PromptMessage::to_json(Self) -> Json
Encode this shape to JSON.
pub fn PromptMessage::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for PromptMessage
A public item of this server framework.
pub impl @json.FromJson for PromptMessage
A public item of this server framework.
pub(all) struct PromptsCapabilities { list_changed : Bool? } derive(Eq, @debug.Debug)
Prompt listings only need list-change notifications.
pub fn PromptsCapabilities::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn PromptsCapabilities::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn PromptsCapabilities::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub(all) struct ReadResourceRequestParams { uri : String meta : Map[String, Json]? } derive(Eq, @debug.Debug)
resources/read request parameters.
pub fn ReadResourceRequestParams::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn ReadResourceRequestParams::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn ReadResourceRequestParams::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn ReadResourceRequestParams::to_json(Self) -> Json
Encode this shape to JSON.
pub fn ReadResourceRequestParams::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for ReadResourceRequestParams
A public item of this server framework.
pub impl @json.FromJson for ReadResourceRequestParams
A public item of this server framework.
pub(all) struct ReadResourceResult { contents : Array[ResourceContents] cache_control : String? meta : Map[String, Json]? } derive(Eq, @debug.Debug)
The result of a resources/read call.
pub fn ReadResourceResult::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn ReadResourceResult::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn ReadResourceResult::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn ReadResourceResult::to_json(Self) -> Json
Encode this shape to JSON.
pub fn ReadResourceResult::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for ReadResourceResult
A public item of this server framework.
pub impl @json.FromJson for ReadResourceResult
A public item of this server framework.
pub(all) enum Reference { PromptReference(name~ : String) ResourceTemplateReference(uri~ : String) } derive(Eq, @debug.Debug)
A prompt reference used for completion.
pub fn Reference::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn Reference::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn Reference::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn Reference::to_json(Self) -> Json
Encode this shape to JSON.
pub fn Reference::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for Reference
A public item of this server framework.
pub impl @json.FromJson for Reference
A public item of this server framework.
pub(all) enum RequestId { Number(id~ : Int32) Text(id~ : String) } derive(Eq, @debug.Debug)
A JSON-RPC request id: either a number or a string.
pub fn RequestId::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn RequestId::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn RequestId::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn RequestId::to_json(Self) -> Json
Encode this shape to JSON.
pub fn RequestId::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for RequestId
A public item of this server framework.
pub impl @json.FromJson for RequestId
A public item of this server framework.
pub(all) struct RequestParamsMeta { meta : Map[String, Json]? } derive(Eq, @debug.Debug)
Parameters common to every request; _meta.progressToken drives progress.
pub fn RequestParamsMeta::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn RequestParamsMeta::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn RequestParamsMeta::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn RequestParamsMeta::progress_token(Self) -> String?
The progress token carried in the request meta.
pub fn RequestParamsMeta::to_json(Self) -> Json
Encode this shape to JSON.
pub fn RequestParamsMeta::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for RequestParamsMeta
A public item of this server framework.
pub impl @json.FromJson for RequestParamsMeta
A public item of this server framework.
pub(all) struct Resource { uri : String name : String title : String? description : String? mime_type : String? size : Int32? annotations : Annotations? meta : Map[String, Json]? } derive(Eq, @debug.Debug)
A resource exposed for reading.
pub fn Resource::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn Resource::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn Resource::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn Resource::to_json(Self) -> Json
Encode this shape to JSON.
pub fn Resource::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for Resource
A public item of this server framework.
pub impl @json.FromJson for Resource
A public item of this server framework.
pub(all) enum ResourceContents { Text(uri~ : String, mime_type~ : String?, text~ : String) Blob(uri~ : String, mime_type~ : String?, blob~ : String) } derive(Eq, @debug.Debug)
The contents of a resource, either inline text or base64-encoded bytes.
pub fn ResourceContents::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn ResourceContents::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn ResourceContents::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn ResourceContents::to_json(Self) -> Json
Encode this shape to JSON.
pub fn ResourceContents::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub fn ResourceContents::uri(Self) -> String
The URI this content or reference points at.
pub impl ToJson for ResourceContents
A public item of this server framework.
pub impl @json.FromJson for ResourceContents
A public item of this server framework.
pub(all) struct ResourceTemplate { uri_template : String name : String title : String? description : String? mime_type : String? annotations : Annotations? meta : Map[String, Json]? } derive(Eq, @debug.Debug)
A parameterised resource address pattern.
pub fn ResourceTemplate::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn ResourceTemplate::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn ResourceTemplate::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn ResourceTemplate::to_json(Self) -> Json
Encode this shape to JSON.
pub fn ResourceTemplate::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for ResourceTemplate
A public item of this server framework.
pub impl @json.FromJson for ResourceTemplate
A public item of this server framework.
pub(all) struct ResourcesCapabilities { subscribe : Bool? list_changed : Bool? } derive(Eq, @debug.Debug)
Resource capability flags.
pub fn ResourcesCapabilities::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn ResourcesCapabilities::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn ResourcesCapabilities::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub(all) enum Role { User Assistant } derive(Eq, @debug.Debug)
One message in a sampling round trip.
pub fn Role::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn Role::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn Role::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub fn Role::to_wire(Self) -> String
Encode this value to its wire string.
pub(all) struct Root { uri : String name : String? } derive(Eq, @debug.Debug)
A filesystem root the client exposes to the server.
pub fn Root::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn Root::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn Root::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn Root::to_json(Self) -> Json
Encode this shape to JSON.
pub fn Root::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for Root
A public item of this server framework.
pub impl @json.FromJson for Root
A public item of this server framework.
pub(all) struct SamplingMessage { role : Role content : ContentBlock } derive(Eq, @debug.Debug)
A data shape. The fields below are its wire and in-memory members.
pub fn SamplingMessage::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn SamplingMessage::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn SamplingMessage::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn SamplingMessage::to_json(Self) -> Json
Encode this shape to JSON.
pub fn SamplingMessage::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for SamplingMessage
A public item of this server framework.
pub impl @json.FromJson for SamplingMessage
A public item of this server framework.
pub(all) struct ServerCapabilities { experimental : Map[String, Json]? logging : Bool? completions : Bool? prompts : PromptsCapabilities? resources : ResourcesCapabilities? tools : ToolCapabilities? tasks : Bool? } derive(Eq, @debug.Debug)
What a server supports; absent groups mean the feature is off.
pub fn ServerCapabilities::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn ServerCapabilities::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn ServerCapabilities::new() -> Self
Construct a value with the given fields.
pub fn ServerCapabilities::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn ServerCapabilities::to_json(Self) -> Json
Encode this shape to JSON.
pub fn ServerCapabilities::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for ServerCapabilities
A public item of this server framework.
pub impl @json.FromJson for ServerCapabilities
A public item of this server framework.
pub(all) enum ServerNotification { Cancelled(CancelledNotificationParams) Progress(ProgressNotificationParams) Message(LoggingMessageNotificationParams) ResourceUpdated(uri~ : String) ResourceListChanged ToolListChanged PromptListChanged Initialized RootsListChanged } derive(Eq, @debug.Debug)
A notification frame the server can send to a client.
pub fn ServerNotification::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn ServerNotification::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn ServerNotification::to_json(Self) -> Json
Encode this shape to JSON.
pub fn ServerNotification::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for ServerNotification
A public item of this server framework.
pub(all) enum ServerRequest { Ping(meta~ : Map[String, Json]?) CreateMessage(CreateMessageRequestParams) Elicit(ElicitRequestParams) ListRoots(meta~ : Map[String, Json]?) } derive(Eq, @debug.Debug)
A typed request a server can send to a client.
pub fn ServerRequest::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn ServerRequest::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn ServerRequest::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn ServerRequest::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl @json.FromJson for ServerRequest
A public item of this server framework.
pub(all) struct SetLevelRequestParams { level : LoggingLevel meta : Map[String, Json]? } derive(Eq, @debug.Debug)
logging/setLevel request parameters.
pub fn SetLevelRequestParams::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn SetLevelRequestParams::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn SetLevelRequestParams::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn SetLevelRequestParams::to_json(Self) -> Json
Encode this shape to JSON.
pub fn SetLevelRequestParams::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for SetLevelRequestParams
A public item of this server framework.
pub impl @json.FromJson for SetLevelRequestParams
A public item of this server framework.
pub(all) struct SubscribeRequestParams { uri : String meta : Map[String, Json]? } derive(Eq, @debug.Debug)
resources/subscribe request parameters.
pub fn SubscribeRequestParams::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn SubscribeRequestParams::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn SubscribeRequestParams::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn SubscribeRequestParams::to_json(Self) -> Json
Encode this shape to JSON.
pub fn SubscribeRequestParams::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for SubscribeRequestParams
A public item of this server framework.
pub impl @json.FromJson for SubscribeRequestParams
A public item of this server framework.
pub(all) struct Tool { name : String title : String? description : String? input_schema : Json output_schema : Json? icons : Array[Icon]? annotations : ToolAnnotations? execution : ToolExecution? meta : Map[String, Json]? } derive(Eq, @debug.Debug)
A tool exposed to the client.
pub fn Tool::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn Tool::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn Tool::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn Tool::to_json(Self) -> Json
Encode this shape to JSON.
pub fn Tool::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for Tool
A public item of this server framework.
pub impl @json.FromJson for Tool
A public item of this server framework.
pub(all) struct ToolAnnotations { title : String? read_only_hint : Bool? destructive_hint : Bool? idempotent_hint : Bool? open_world_hint : Bool? } derive(Eq, @debug.Debug)
UI hints for a tool.
pub fn ToolAnnotations::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn ToolAnnotations::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn ToolAnnotations::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn ToolAnnotations::to_json(Self) -> Json
Encode this shape to JSON.
pub fn ToolAnnotations::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for ToolAnnotations
A public item of this server framework.
pub impl @json.FromJson for ToolAnnotations
A public item of this server framework.
pub(all) struct ToolCapabilities { list_changed : Bool? } derive(Eq, @debug.Debug)
Tool listings only need list-change notifications.
pub fn ToolCapabilities::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn ToolCapabilities::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn ToolCapabilities::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub(all) struct ToolExecution { task_support : @tasks.TaskMode } derive(Eq, @debug.Debug)
Task execution configuration advertised on a tool (SEP-1686).
pub fn ToolExecution::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn ToolExecution::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn ToolExecution::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn ToolExecution::to_json(Self) -> Json
Encode this shape to JSON.
pub fn ToolExecution::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for ToolExecution
A public item of this server framework.
pub impl @json.FromJson for ToolExecution
A public item of this server framework.
Errors
The error type the handlers raise, and how it maps onto JSON-RPC error codes.
pub fn insufficient_scope(Array[String]) -> FastMCPError
Construct an InsufficientScope error with the standard message.
pub fn to_mcp_error(FastMCPError, default_code? : Int32) -> @types.ErrorData
Translate a moonmcp error into a wire-format error payload. NotFound, Disabled and Validation map to invalid_params (-32602); an existing Mcp payload is returned unchanged so an explicit code chosen upstream survives translation; everything else falls back to default_code (internal_error by default).
pub(all) suberror FastMCPError { Mcp(@types.ErrorData) Validation(String) Resource(String) Tool(String) Prompt(String) InvalidSignature(String) Client(String) NotFound(String) Disabled(String) ResourceSecurity(String) Authorisation(String) InsufficientScope(required_scopes~ : Array[String], message~ : String) } derive(Eq, @debug.Debug)
Custom errors for moonmcp, mirroring fastmcp/exceptions.py.
pub fn FastMCPError::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn FastMCPError::message(Self) -> String
Render the human-readable message carried by the error.
pub fn FastMCPError::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn FastMCPError::output(Self, &Logger) -> Unit
The message alone, as a person reads it.
pub fn FastMCPError::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub fn FastMCPError::to_string(Self) -> String
Render the error as a string.
pub impl Show for FastMCPError
A public item of this server framework.
Component
The shared metadata every capability carries: name, title, description, tags and icons.
pub fn coerce_version(Json?) -> String? raise @exceptions.FastMCPError
Coerce a JSON scalar to a version string. Raises Validation for non-scalar values or versions containing @ (used as the key delimiter).
pub fn get_fastmcp_metadata(Map[String, Json]?) -> FastMCPMeta
Extract moonmcp metadata from a component's meta object. Handles both the current fastmcp namespace and the legacy _fastmcp namespace for compatibility with older servers.
pub fn public_result_meta(Map[String, Json]?) -> Map[String, Json]?
Strip moonmcp's internal bookkeeping out of component meta. Returns None when nothing public remains, so components without user metadata keep an absent _meta rather than an empty object.
pub(all) struct ComponentBase { key_prefix : String name : String version : String? title : String? description : String? icons : Array[@types.Icon]? tags : @set.Set[String] meta : Map[String, Json]? task_config : @tasks.TaskConfig }
Common state shared by all moonmcp components.
pub fn ComponentBase::get_meta(Self) -> Map[String, Json]
The public meta information about the component. Always includes a fastmcp key containing the sorted tags list and the version (when set); internal keys (prefixed with _) are stripped from the fastmcp namespace.
pub fn ComponentBase::key(Self, String) -> String
The globally unique lookup key for a component. Format: "{key_prefix}:{identifier}@{version}"; the @ delimiter is always present so keys parse unambiguously even when the identifier itself contains @.
pub fn ComponentBase::make_key(String, String) -> String
Construct the lookup key for a component type, e.g. "tool:name".
pub fn ComponentBase::new(String, String, version? : String, title? : String, description? : String, icons? : Array[@types.Icon], tags? : @set.Set[String], meta? : Map[String, Json], task_config? : @tasks.TaskConfig) -> Self
Construct a value with the given fields.
pub(all) struct FastMCPMeta { tags : Array[String] version : String? versions : Array[String] } derive(Eq, @debug.Debug)
Namespaced metadata carried in a component's _meta.
pub fn FastMCPMeta::empty() -> Self
A public item of this server framework.
pub fn FastMCPMeta::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn FastMCPMeta::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn FastMCPMeta::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub(open) trait Component { fn base(Self) -> ComponentBase fn identifier(Self) -> String = _ fn key(Self) -> String = _ fn get_meta(Self) -> Map[String, Json] = _ }
A moonmcp component: tool, prompt, resource or resource template.
Tasks
Configuration for tools that hand long work to a task and answer later.
pub let default_poll_interval_ms : Int32
A constant value.
pub let default_ttl_ms : Int32
A constant value.
pub fn task_mode_from_wire(String) -> TaskMode?
A public item of this server framework.
pub let tasks_extension_id : String
Reverse-DNS identifier of the SEP-2663 tasks extension.
pub(all) struct TaskConfig { mode : TaskMode poll_interval_ms : Int32 } derive(Eq, @debug.Debug)
Configuration for MCP background task execution.
pub fn TaskConfig::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn TaskConfig::from_bool(Bool) -> Self
Convert a boolean task flag to a TaskConfig.
pub fn TaskConfig::new(mode? : TaskMode, poll_interval_ms? : Int32) -> Self
Construct a value with the given fields.
pub fn TaskConfig::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn TaskConfig::supports_tasks(Self) -> Bool
Whether this component supports task execution.
pub fn TaskConfig::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub(all) struct TaskMeta { ttl : Int32? fn_key : String? } derive(Eq, @debug.Debug)
Metadata for task-augmented execution requests.
pub fn TaskMeta::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn TaskMeta::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn TaskMeta::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub(all) enum TaskMode { Forbidden Optional Required } derive(Eq, @debug.Debug)
How a component handles task-augmented execution requests.
pub fn TaskMode::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn TaskMode::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn TaskMode::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub fn TaskMode::to_wire(Self) -> String
Encode this value to its wire string.
Settings
Build-time settings surfaced to the running server.
pub fn log_level_from_wire(String) -> LogLevel?
A public item of this server framework.
pub fn session_idle_timeout_from_wire(String) -> SessionIdleTimeout?
A public item of this server framework.
pub fn telemetry_mode_from_wire(String) -> TelemetryMode?
A public item of this server framework.
pub let ten_mb_in_bytes : Int32
A constant value.
pub fn transport_kind_from_wire(String) -> TransportKind?
A public item of this server framework.
pub(all) enum CheckForUpdates { Stable Prerelease Off } derive(Eq, @debug.Debug)
An alternative type. Each variant is listed below.
pub fn CheckForUpdates::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn CheckForUpdates::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn CheckForUpdates::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub(all) enum LogLevel { Debug Info Warning Error Critical } derive(Eq, @debug.Debug)
An alternative type. Each variant is listed below.
pub fn LogLevel::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn LogLevel::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn LogLevel::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub fn LogLevel::to_wire(Self) -> String
The http_session_idle_timeout wire forms: "auto", "none", or a number.
pub(all) enum SessionIdleTimeout { Auto Never Seconds(Double) } derive(Eq, @debug.Debug)
An alternative type. Each variant is listed below.
pub fn SessionIdleTimeout::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn SessionIdleTimeout::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn SessionIdleTimeout::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub fn SessionIdleTimeout::to_wire(Self) -> String
The http_session_idle_timeout wire forms: "auto", "none", or a number.
pub(all) struct Settings { home : String oauth_encryption_key : String? test_mode : Bool log_enabled : Bool log_level : LogLevel enable_rich_logging : Bool enable_rich_tracebacks : Bool deprecation_warnings : Bool telemetry_mode : TelemetryMode client_init_timeout : Double? client_disconnect_timeout : Double transport : TransportKind host : String port : Int32 sse_path : String message_path : String streamable_http_path : String debug : Bool mask_error_details : Bool client_log_level : @types.LoggingLevel? strict_input_validation : Bool ssrf_trust_proxy : Bool server_dependencies : Array[String] json_response : Bool stateless_http : Bool http_host_origin_protection : Bool http_allowed_hosts : Array[String]? http_allowed_origins : Array[String]? http_session_idle_timeout : SessionIdleTimeout mounted_components_raise_on_load_error : Bool show_server_banner : Bool check_for_updates : CheckForUpdates } derive(Eq, @debug.Debug)
Everything the framework reads from FASTMCP_* environment variables.
pub fn Settings::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn Settings::from_env() -> Self
Load settings, applying FASTMCP_* environment overrides.
pub fn Settings::new() -> Self
Construct a value with the given fields.
pub fn Settings::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn Settings::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub(all) enum TelemetryMode { Native PropagationOnly Off } derive(Eq, @debug.Debug)
How moonmcp's native telemetry behaves.
pub fn TelemetryMode::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn TelemetryMode::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn TelemetryMode::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub fn TelemetryMode::to_wire(Self) -> String
The http_session_idle_timeout wire forms: "auto", "none", or a number.
pub(all) enum TransportKind { Stdio Http Sse StreamableHttp } derive(Eq, @debug.Debug)
An alternative type. Each variant is listed below.
pub fn TransportKind::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn TransportKind::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn TransportKind::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub fn TransportKind::to_wire(Self) -> String
The http_session_idle_timeout wire forms: "auto", "none", or a number.
Config
Default ports and other knobs the server reads at start.
pub fn config_from_json(Json) -> MCPConfig raise @json.JsonDecodeError
Parse MCP configuration from a JSON document.
pub fn infer_transport_type_from_url(String) -> Result[String, String]
Infer "sse" or "http" from a remote server URL.
pub(all) struct MCPConfig { mcp_servers : Map[String, MCPServerEntry] } derive(Eq, @debug.Debug)
A configuration object for MCP servers.
pub fn MCPConfig::add_server(Self, String, MCPServerEntry) -> Unit
Add or update a server in the configuration.
pub fn MCPConfig::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn MCPConfig::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn MCPConfig::new() -> Self
Construct a value with the given fields.
pub fn MCPConfig::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn MCPConfig::to_json(Self) -> Json
Convert the configuration to a JSON document, omitting empty fields.
pub fn MCPConfig::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl @json.FromJson for MCPConfig
A public item of this server framework.
pub(all) struct MCPServerEntry { kind : MCPServerKind timeout : Int32? description : String? icon : String? authentication : Map[String, Json]? transform : ServerTransform? } derive(Eq, @debug.Debug)
A data shape. The fields below are its wire and in-memory members.
pub fn MCPServerEntry::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn MCPServerEntry::from_json(Json, @json.JsonPath) -> Self raise @json.JsonDecodeError
Decode this shape from JSON.
pub fn MCPServerEntry::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn MCPServerEntry::to_json(Self) -> Json
Convert the configuration to a JSON document, omitting empty fields.
pub fn MCPServerEntry::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub impl ToJson for MCPServerEntry
A public item of this server framework.
pub impl @json.FromJson for MCPServerEntry
A public item of this server framework.
pub(all) enum MCPServerKind { Stdio(command~ : String, args~ : Array[String], env~ : Map[String, Json], cwd~ : String?, keep_alive~ : Bool?) Remote(url~ : String, transport~ : RemoteTransport?, headers~ : Map[String, String], auth~ : String?, sse_read_timeout_ms~ : Int32?) } derive(Eq, @debug.Debug)
One server entry: either a stdio command or a remote URL.
pub fn MCPServerKind::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn MCPServerKind::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn MCPServerKind::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub(all) enum RemoteTransport { Http StreamableHttp Sse } derive(Eq, @debug.Debug)
An alternative type. Each variant is listed below.
pub fn RemoteTransport::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn RemoteTransport::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn RemoteTransport::to_repr(Self) -> @debug.Repr
Debug representation of this value.
pub fn RemoteTransport::to_wire(Self) -> String
Encode this value to its wire string.
pub(all) struct ServerTransform { tools : Map[String, Json] include_tags : @set.Set[String]? exclude_tags : @set.Set[String]? } derive(Eq, @debug.Debug)
Tool transforms and tag filters for a proxied server.
pub fn ServerTransform::equal(Self, Self) -> Bool
Equality with another value of the same type.
pub fn ServerTransform::not_equal(Self, Self) -> Bool
Inequality with another value of the same type.
pub fn ServerTransform::to_repr(Self) -> @debug.Repr
Debug representation of this value.
Utilities
Small helpers, chiefly media-type handling for binary content.
pub fn encode_base64(Bytes) -> String
Base64-encode raw bytes for wire transport.
pub(all) struct Audio { path : String? data : Bytes? format : String? mime_type : String annotations : @types.Annotations? }
A helper for returning audio from tools.
pub fn Audio::new(path? : String, data? : Bytes, format? : String, annotations? : @types.Annotations) -> Self raise @exceptions.FastMCPError
Create a file payload from a path or raw data, not both.
pub fn Audio::to_audio_content(Self, mime_type? : String, annotations? : @types.Annotations) -> @types.ContentBlock raise @exceptions.FastMCPError
Convert to an audio content block.
pub(all) struct File { path : String? data : Bytes? format : String? name : String? mime_type : String annotations : @types.Annotations? }
A helper for returning file data from tools.
pub fn File::new(path? : String, data? : Bytes, format? : String, name? : String, annotations? : @types.Annotations) -> Self raise @exceptions.FastMCPError
Create a file payload from a path or raw data, not both.
pub fn File::to_resource_content(Self, mime_type? : String, annotations? : @types.Annotations) -> @types.ContentBlock raise @exceptions.FastMCPError
Convert to an embedded resource content block.
pub(all) struct Image { path : String? data : Bytes? format : String? mime_type : String annotations : @types.Annotations? }
A helper for returning images from tools.
pub fn Image::new(path? : String, data? : Bytes, format? : String, annotations? : @types.Annotations) -> Self raise @exceptions.FastMCPError
Create a file payload from a path or raw data, not both.
pub fn Image::to_data_uri(Self, mime_type? : String) -> String raise @exceptions.FastMCPError
Render as a data: URI.
pub fn Image::to_image_content(Self, mime_type? : String, annotations? : @types.Annotations) -> @types.ContentBlock raise @exceptions.FastMCPError
Convert to an image content block.