Skip to main content

Module prompt

Module prompt 

Source
Available on crate feature server only.
Expand description

Prompt handling infrastructure for MCP servers

This module provides the core types and traits for implementing prompt handlers in MCP servers. Prompts allow servers to provide reusable templates for LLM interactions with customizable arguments.

Re-exports§

pub use super::common::Extension;
pub use super::common::RequestId;

Structs§

AsyncMethodAdapter
Adapter type for async methods that return Vec<PromptMessage>
AsyncMethodWithArgsAdapter
Adapter type for async methods with parameters that return Vec<PromptMessage>
AsyncPromptAdapter
Adapter types for macro-generated implementations
AsyncPromptMethodAdapter
PromptContext
Context for prompt retrieval operations
PromptName
SyncPromptAdapter
SyncPromptMethodAdapter

Enums§

IntoGetPromptResultFut

Traits§

GetPromptHandler
Trait for handling prompt retrieval
IntoGetPromptResult
Trait for types that can be converted into GetPromptResult

Functions§

cached_arguments_from_schema
Extract prompt arguments from a type’s JSON schema This function analyzes the schema of a type and extracts the properties as PromptArgument entries with name, description, and required status

Type Aliases§

DynGetPromptHandlerNon-local
Type alias for dynamic prompt handlers