Prompts
What Are Prompts?
Defining a Prompt with @prompt
@promptfrom hyperia import Hyperia
from hyperia.prompts import Message, PromptMessage, TextContent
mcp = Hyperia("PromptServer")
@mcp.prompt()
def ask_about(topic: str) -> str:
"""Ask the LLM to explain a concept."""
return f"Can you please explain the concept of '{topic}'?"
@mcp.prompt()
def code_request(language: str, task: str) -> PromptMessage:
content = f"Write a {language} function that {task}."
return PromptMessage(role="user", content=TextContent(text=content))Return Types
Return value
How Hyperia treats it
Type Annotations & Validation
Required vs Optional
Metadata Overrides
Async Prompts
Accessing Context
Server Behaviour Flags
Duplicate Prompt Names
Last updated