fastmcp.server.providers.local_provider.decorators.prompts
Prompt decorator mixin for LocalProvider.
This module provides the PromptDecoratorMixin class that adds prompt
registration functionality to LocalProvider.
Classes
PromptDecoratorMixin
Mixin class providing prompt decorator functionality for LocalProvider.
This mixin contains all methods related to:
- Prompt registration via add_prompt()
- Prompt decorator (@provider.prompt)
add_prompt
prompt
prompt
prompt
- @provider.prompt (without parentheses)
- @provider.prompt() (with empty parentheses)
- @provider.prompt(“custom_name”) (with name as first argument)
- @provider.prompt(name=“custom_name”) (with name as keyword argument)
- provider.prompt(function, name=“custom_name”) (direct function call)
name_or_fn: Either a function (when used as @prompt), a string name, or Nonename: Optional name for the prompt (keyword-only, alternative to name_or_fn)title: Optional title for the promptdescription: Optional description of what the prompt doesicons: Optional icons for the prompttags: Optional set of tags for categorizing the promptenabled: Whether the prompt is enabled (default True). If False, adds to blocklist.meta: Optional meta information about the prompttask: Optional task configuration for background executionauth: Optional authorization checks for the prompt
- The registered FunctionPrompt or a decorator function.

