Skip to main content

SamplingClient

Trait SamplingClient 

Source
pub trait SamplingClient: Sync {
    // Required methods
    fn is_available(&self) -> bool;
    fn create_message<'a>(&'a self, prompt: &'a str) -> SamplingFuture<'a>;
}
Expand description

MCP sampling/createMessage reverse-call client.

Implementations:

  • NoopSamplingClient — always unavailable (CLI/hook contexts).
  • McpSamplingClient (in src/mcp.rs) — real MCP reverse-call.
  • Test fakes for unit testing.

Required Methods§

Source

fn is_available(&self) -> bool

Source

fn create_message<'a>(&'a self, prompt: &'a str) -> SamplingFuture<'a>

Implementors§