mcp_simple_tool_agent ===================== .. py:module:: mcp_simple_tool_agent .. autoapi-nested-parse:: MCP Simple Tool Agent - Using SimpleAgent with retrieval tool. Attributes ---------- .. autoapisummary:: mcp_simple_tool_agent.VECTOR_STORE mcp_simple_tool_agent.app mcp_simple_tool_agent.mcp_agent Classes ------- .. autoapisummary:: mcp_simple_tool_agent.QueryRequest mcp_simple_tool_agent.QueryResponse Functions --------- .. autoapisummary:: mcp_simple_tool_agent.ask_agent mcp_simple_tool_agent.create_mcp_documents mcp_simple_tool_agent.create_mcp_tool_agent mcp_simple_tool_agent.initialize_vector_store mcp_simple_tool_agent.root mcp_simple_tool_agent.search_mcp_servers mcp_simple_tool_agent.startup_event Module Contents --------------- .. py:class:: QueryRequest(/, **data: Any) Bases: :py:obj:`pydantic.BaseModel` !!! abstract "Usage Documentation" [Models](../concepts/models.md) A base class for creating Pydantic models. .. attribute:: __class_vars__ The names of the class variables defined on the model. .. attribute:: __private_attributes__ Metadata about the private attributes of the model. .. attribute:: __signature__ The synthesized `__init__` [`Signature`][inspect.Signature] of the model. .. attribute:: __pydantic_complete__ Whether model building is completed, or if there are still undefined fields. .. attribute:: __pydantic_core_schema__ The core schema of the model. .. attribute:: __pydantic_custom_init__ Whether the model has a custom `__init__` function. .. attribute:: __pydantic_decorators__ Metadata containing the decorators defined on the model. This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. .. attribute:: __pydantic_generic_metadata__ Metadata for generic models; contains data used for a similar purpose to __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. .. attribute:: __pydantic_parent_namespace__ Parent namespace of the model, used for automatic rebuilding of models. .. attribute:: __pydantic_post_init__ The name of the post-init method for the model, if defined. .. attribute:: __pydantic_root_model__ Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. .. attribute:: __pydantic_serializer__ The `pydantic-core` `SchemaSerializer` used to dump instances of the model. .. attribute:: __pydantic_validator__ The `pydantic-core` `SchemaValidator` used to validate instances of the model. .. attribute:: __pydantic_fields__ A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. .. attribute:: __pydantic_computed_fields__ A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. .. attribute:: __pydantic_extra__ A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] is set to `'allow'`. .. attribute:: __pydantic_fields_set__ The names of fields explicitly set during instantiation. .. attribute:: __pydantic_private__ Values of private attributes set on the model instance. .. py:attribute:: query :type: str .. py:class:: QueryResponse(/, **data: Any) Bases: :py:obj:`pydantic.BaseModel` !!! abstract "Usage Documentation" [Models](../concepts/models.md) A base class for creating Pydantic models. .. attribute:: __class_vars__ The names of the class variables defined on the model. .. attribute:: __private_attributes__ Metadata about the private attributes of the model. .. attribute:: __signature__ The synthesized `__init__` [`Signature`][inspect.Signature] of the model. .. attribute:: __pydantic_complete__ Whether model building is completed, or if there are still undefined fields. .. attribute:: __pydantic_core_schema__ The core schema of the model. .. attribute:: __pydantic_custom_init__ Whether the model has a custom `__init__` function. .. attribute:: __pydantic_decorators__ Metadata containing the decorators defined on the model. This replaces `Model.__validators__` and `Model.__root_validators__` from Pydantic V1. .. attribute:: __pydantic_generic_metadata__ Metadata for generic models; contains data used for a similar purpose to __args__, __origin__, __parameters__ in typing-module generics. May eventually be replaced by these. .. attribute:: __pydantic_parent_namespace__ Parent namespace of the model, used for automatic rebuilding of models. .. attribute:: __pydantic_post_init__ The name of the post-init method for the model, if defined. .. attribute:: __pydantic_root_model__ Whether the model is a [`RootModel`][pydantic.root_model.RootModel]. .. attribute:: __pydantic_serializer__ The `pydantic-core` `SchemaSerializer` used to dump instances of the model. .. attribute:: __pydantic_validator__ The `pydantic-core` `SchemaValidator` used to validate instances of the model. .. attribute:: __pydantic_fields__ A dictionary of field names and their corresponding [`FieldInfo`][pydantic.fields.FieldInfo] objects. .. attribute:: __pydantic_computed_fields__ A dictionary of computed field names and their corresponding [`ComputedFieldInfo`][pydantic.fields.ComputedFieldInfo] objects. .. attribute:: __pydantic_extra__ A dictionary containing extra values, if [`extra`][pydantic.config.ConfigDict.extra] is set to `'allow'`. .. attribute:: __pydantic_fields_set__ The names of fields explicitly set during instantiation. .. attribute:: __pydantic_private__ Values of private attributes set on the model instance. .. py:attribute:: query :type: str .. py:attribute:: response :type: str .. py:attribute:: timestamp :type: str .. py:function:: ask_agent(request: QueryRequest) :async: Ask the MCP agent a question. .. py:function:: create_mcp_documents() -> list[langchain_core.documents.Document] Create documents from MCP server data. .. py:function:: create_mcp_tool_agent(llm_config: haive.core.models.llm.base.LLMConfig | None = None) -> haive.agents.simple.agent.SimpleAgent Create a SimpleAgent with MCP search tool. .. py:function:: initialize_vector_store() Initialize the vector store with MCP documents. .. py:function:: root() :async: Web interface for the MCP agent. .. py:function:: search_mcp_servers(query: str, k: int = 5) -> str Search for MCP servers based on query. :param query: Search query (e.g., "python database", "github integration") :param k: Number of results to return (default: 5) :returns: Formatted string with search results .. py:function:: startup_event() :async: Initialize the MCP tool agent. .. py:data:: VECTOR_STORE :value: None .. py:data:: app .. py:data:: mcp_agent :value: None