tavily_fastmcp.prompt_loader

Prompt loading helpers.

Purpose:

Load packaged markdown prompts by name and list the prompt files shipped with the package.

Design:
  • Prompt files live under tavily_fastmcp.prompts.

  • Prompt names are addressed without the .md suffix.

Examples

>>> "router" in list_prompt_names()
True
>>> load_prompt_text("router").startswith("#")
True

Functions

list_prompt_names(→ list[str])

Return the packaged prompt names.

load_prompt_text(→ str)

Load a packaged markdown prompt.

Module Contents

tavily_fastmcp.prompt_loader.list_prompt_names() list[str][source]

Return the packaged prompt names.

Returns:

Sorted prompt names without file extensions.

Raises:

FileNotFoundError – If the prompts package is unavailable.

Examples

>>> isinstance(list_prompt_names(), list)
True
tavily_fastmcp.prompt_loader.load_prompt_text(name: str) str[source]

Load a packaged markdown prompt.

Parameters:

name – Prompt name without .md.

Returns:

The markdown contents of the prompt file.

Raises:

FileNotFoundError – If the prompt does not exist.

Examples

>>> text = load_prompt_text("router")
>>> text.startswith("# ")
True