tavily_fastmcp.models

Typed models for Tavily FastMCP.

Purpose:

Define canonical request, response, catalog, and profile models.

Design:
  • Request models are strict and reject unknown fields.

  • Response models allow extra fields because upstream Tavily payloads may evolve.

  • Profile and catalog models are shared between direct Python helpers, packaged resources, and MCP prompts.

Examples

>>> SearchRequest(query="FastMCP docs").max_results
5
>>> ProfileSummary(slug="router", title="Router", summary="x").slug
'router'

Attributes

Classes

SearchRequest

Canonical request model for Tavily search.

ExtractRequest

Canonical request model for Tavily extract.

MapRequest

Canonical request model for Tavily map.

CrawlRequest

Canonical request model for Tavily crawl.

ResearchRequest

Canonical request model for Tavily research.

GetResearchRequest

Canonical request model for retrieving a Tavily research task.

SearchHit

Normalized Tavily search hit.

SearchResponse

Normalized Tavily search response.

ExtractHit

Normalized Tavily extract result item.

ExtractResponse

Normalized Tavily extract response.

MapResponse

Normalized Tavily map response.

CrawlHit

Normalized Tavily crawl result item.

CrawlResponse

Normalized Tavily crawl response.

ResearchSource

Source used by a Tavily research task.

ResearchResponse

Normalized Tavily research response.

ProfileSummary

Summary metadata for a packaged prompt profile.

PromptProfile

Structured packaged profile with markdown prompt content.

ServerCatalog

Catalog of server metadata exposed through resources and tools.

HealthResponse

Simple health payload.

Module Contents

type tavily_fastmcp.models.JsonObject = dict[str, Any][source]
class tavily_fastmcp.models.SearchRequest(/, **data: Any)[source]

Bases: pydantic.BaseModel

Canonical request model for Tavily search.

Parameters:
  • query – Natural-language search query.

  • max_results – Maximum number of results.

  • topic – Tavily topic mode.

  • include_answer – Whether to include Tavily’s answer field.

  • include_raw_content – Whether to return cleaned page content.

  • include_images – Whether to include image URLs.

  • include_image_descriptions – Whether to include image descriptions.

  • search_depth – Tavily search depth.

  • time_range – Relative time filter.

  • start_date – Inclusive start bound in YYYY-MM-DD format.

  • end_date – Inclusive end bound in YYYY-MM-DD format.

  • include_domains – Domains to include.

  • exclude_domains – Domains to exclude.

  • include_usage – Whether to return usage metadata.

Returns:

A validated request object.

Raises:

ValueError – If a field is invalid.

Examples

>>> SearchRequest(query="FastMCP resources", max_results=3).max_results
3
model_config[source]

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

query: str[source]
max_results: int = None[source]
topic: Literal['general', 'news', 'finance'] = 'general'[source]
include_answer: bool = False[source]
include_raw_content: bool = False[source]
include_images: bool = False[source]
include_image_descriptions: bool = False[source]
search_depth: Literal['basic', 'advanced'] = 'basic'[source]
time_range: Literal['day', 'week', 'month', 'year'] | None = None[source]
start_date: str | None = None[source]
end_date: str | None = None[source]
include_domains: list[str] | None = None[source]
exclude_domains: list[str] | None = None[source]
include_usage: bool = False[source]
class tavily_fastmcp.models.ExtractRequest(/, **data: Any)[source]

Bases: pydantic.BaseModel

Canonical request model for Tavily extract.

Parameters:
  • urls – URLs to extract.

  • extract_depth – Extraction depth.

  • include_images – Whether to include images.

Returns:

A validated request object.

Raises:

ValueError – If a field is invalid.

Examples

>>> ExtractRequest(urls=["https://example.com"]).extract_depth
'basic'
model_config[source]

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

urls: list[pydantic.AnyUrl] = None[source]
extract_depth: Literal['basic', 'advanced'] = 'basic'[source]
include_images: bool = False[source]
class tavily_fastmcp.models.MapRequest(/, **data: Any)[source]

Bases: pydantic.BaseModel

Canonical request model for Tavily map.

model_config[source]

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

url: pydantic.AnyUrl[source]
instructions: str | None = None[source]
class tavily_fastmcp.models.CrawlRequest(/, **data: Any)[source]

Bases: pydantic.BaseModel

Canonical request model for Tavily crawl.

model_config[source]

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

url: pydantic.AnyUrl[source]
instructions: str | None = None[source]
class tavily_fastmcp.models.ResearchRequest(/, **data: Any)[source]

Bases: pydantic.BaseModel

Canonical request model for Tavily research.

model_config[source]

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

input: str[source]
model: Literal['mini', 'pro', 'auto'] = 'auto'[source]
output_schema: JsonObject | None = None[source]
stream: bool = False[source]
citation_format: Literal['numbered', 'mla', 'apa', 'chicago'] = 'numbered'[source]
class tavily_fastmcp.models.GetResearchRequest(/, **data: Any)[source]

Bases: pydantic.BaseModel

Canonical request model for retrieving a Tavily research task.

model_config[source]

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

request_id: str[source]
class tavily_fastmcp.models.SearchHit(/, **data: Any)[source]

Bases: pydantic.BaseModel

Normalized Tavily search hit.

model_config[source]

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

url: str[source]
title: str | None = None[source]
content: str | None = None[source]
raw_content: str | None = None[source]
score: float | None = None[source]
published_date: str | None = None[source]
class tavily_fastmcp.models.SearchResponse(/, **data: Any)[source]

Bases: pydantic.BaseModel

Normalized Tavily search response.

model_config[source]

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

query: str | None = None[source]
answer: str | None = None[source]
results: list[SearchHit] = None[source]
images: list[str] = None[source]
response_time: float | None = None[source]
request_id: str | None = None[source]
follow_up_questions: list[str] = None[source]
usage: JsonObject | None = None[source]
class tavily_fastmcp.models.ExtractHit(/, **data: Any)[source]

Bases: pydantic.BaseModel

Normalized Tavily extract result item.

model_config[source]

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

url: str[source]
raw_content: str | None = None[source]
images: list[str] = None[source]
class tavily_fastmcp.models.ExtractResponse(/, **data: Any)[source]

Bases: pydantic.BaseModel

Normalized Tavily extract response.

model_config[source]

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

results: list[ExtractHit] = None[source]
failed_results: list[JsonObject] = None[source]
response_time: float | None = None[source]
class tavily_fastmcp.models.MapResponse(/, **data: Any)[source]

Bases: pydantic.BaseModel

Normalized Tavily map response.

model_config[source]

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

base_url: str | None = None[source]
results: list[str] = None[source]
request_id: str | None = None[source]
response_time: float | None = None[source]
class tavily_fastmcp.models.CrawlHit(/, **data: Any)[source]

Bases: pydantic.BaseModel

Normalized Tavily crawl result item.

model_config[source]

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

url: str[source]
raw_content: str | None = None[source]
class tavily_fastmcp.models.CrawlResponse(/, **data: Any)[source]

Bases: pydantic.BaseModel

Normalized Tavily crawl response.

model_config[source]

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

base_url: str | None = None[source]
results: list[CrawlHit] = None[source]
request_id: str | None = None[source]
response_time: float | None = None[source]
class tavily_fastmcp.models.ResearchSource(/, **data: Any)[source]

Bases: pydantic.BaseModel

Source used by a Tavily research task.

model_config[source]

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

title: str | None = None[source]
url: str | None = None[source]
favicon: str | None = None[source]
class tavily_fastmcp.models.ResearchResponse(/, **data: Any)[source]

Bases: pydantic.BaseModel

Normalized Tavily research response.

model_config[source]

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

request_id: str | None = None[source]
created_at: str | None = None[source]
completed_at: str | None = None[source]
status: str | None = None[source]
input: str | None = None[source]
model: str | None = None[source]
content: str | JsonObject | None = None[source]
sources: list[ResearchSource] = None[source]
response_time: float | None = None[source]
class tavily_fastmcp.models.ProfileSummary(/, **data: Any)[source]

Bases: pydantic.BaseModel

Summary metadata for a packaged prompt profile.

Parameters:
  • slug – Stable profile slug.

  • title – Human-readable title.

  • summary – One-sentence profile summary.

  • tags – Tags for filtering and discovery.

  • recommended_tools – Ordered preferred tool names.

  • prompt_resource_uri – Resource URI for the prompt text.

  • profile_resource_uri – Resource URI for structured profile metadata.

Returns:

A reusable profile summary object.

Raises:

ValueError – If a field is invalid.

Examples

>>> ProfileSummary(
...     slug="router",
...     title="Router",
...     summary="Route tasks",
...     prompt_resource_uri="resource://x",
...     profile_resource_uri="resource://y",
... ).slug
'router'
slug: str[source]
title: str[source]
summary: str[source]
tags: list[str] = None[source]
recommended_tools: list[str] = None[source]
prompt_resource_uri: str[source]
profile_resource_uri: str[source]
class tavily_fastmcp.models.PromptProfile(/, **data: Any)[source]

Bases: pydantic.BaseModel

Structured packaged profile with markdown prompt content.

Parameters:
  • slug – Stable profile slug.

  • title – Human-readable title.

  • summary – Short description.

  • use_when – List of ideal use cases.

  • avoid_when – List of anti-patterns.

  • recommended_tools – Preferred tool sequence.

  • tags – Discovery tags.

  • meta – Arbitrary profile metadata.

  • prompt_markdown – Full markdown prompt body.

Returns:

A rich profile object.

Raises:

ValueError – If a field is invalid.

Examples

>>> profile = PromptProfile(
...     slug="router",
...     title="Router",
...     summary="Route tasks",
...     prompt_markdown="# Router",
... )
>>> profile.title
'Router'
slug: str[source]
title: str[source]
summary: str[source]
use_when: list[str] = None[source]
avoid_when: list[str] = None[source]
recommended_tools: list[str] = None[source]
tags: list[str] = None[source]
meta: JsonObject = None[source]
prompt_markdown: str[source]
class tavily_fastmcp.models.ServerCatalog(/, **data: Any)[source]

Bases: pydantic.BaseModel

Catalog of server metadata exposed through resources and tools.

name: str[source]
version: str[source]
package_name: str[source]
prompt_names: list[str] = None[source]
profile_slugs: list[str] = None[source]
tool_names: list[str] = None[source]
resource_uris: list[str] = None[source]
example_resource_uris: list[str] = None[source]
meta: JsonObject = None[source]
class tavily_fastmcp.models.HealthResponse(/, **data: Any)[source]

Bases: pydantic.BaseModel

Simple health payload.

status: Literal['ok'][source]
server_name: str[source]
version: str[source]