MCPAgent API Documentation
(AgentAction, str)
tuples, followed by the final result as a string.
Parameters:
query
(str): The query to executemax_steps
(int, optional): Maximum number of steps to takemanage_connector
(bool): Whether to handle connector lifecycleexternal_history
(list[BaseMessage], optional): External conversation history(AgentAction, str)
: Intermediate steps containing the action and observationstr
: Final result stringquery
(str): The query to executemax_steps
(int, optional): Maximum number of steps to takemanage_connector
(bool): Whether to handle connector lifecycleexternal_history
(list[BaseMessage], optional): External conversation historystr
: The final resultquery
(str): The query to executemax_steps
(int, optional): Maximum number of steps to takemanage_connector
(bool): Whether to handle connector lifecycleexternal_history
(list[BaseMessage], optional): External conversation historystr
: Streaming chunks of the agent’s outputMethod | Use Case | Output Type | Granularity |
---|---|---|---|
stream() | Step-by-step workflow tracking | Steps + final result | Tool-level |
run() | Simple execution | Final result only | Complete |
astream() | Real-time chat interfaces | Streaming chunks | Token-level |