tavily_fastmcp.agent

Optional LangChain agent helpers.

Purpose:

Offer a tiny convenience layer for wiring this package’s packaged router prompt into a LangChain agent.

Design:
  • Keep imports optional so the package remains usable without LangChain.

  • Accept explicit tools for flexibility.

Examples

>>> callable(create_langchain_agent)
True

Functions

create_langchain_agent(→ Any)

Create a LangChain agent with the packaged router prompt.

Module Contents

tavily_fastmcp.agent.create_langchain_agent(*, model: str, tools: list[Any]) Any[source]

Create a LangChain agent with the packaged router prompt.

Parameters:
  • model – LangChain model identifier.

  • tools – Tools to pass into create_agent.

Returns:

A LangChain agent instance.

Raises:

RuntimeError – If LangChain is not installed.

Examples

>>> callable(create_langchain_agent)
True