UNPKG

mcp-use

Version:

A utility library for integrating Model Context Protocol (MCP) with LangChain, Zod, and related tools. Provides helpers for schema conversion, event streaming, and SDK usage.

27 lines 1.04 kB
import type { MCPSession } from '../session.js'; export declare abstract class BaseAgent { protected session: MCPSession; /** * @param session MCP session used for tool invocation */ constructor(session: MCPSession); /** * Initialize the agent, including initializing the MCP session */ abstract initialize(): Promise<void>; /** * Run the agent on a query with a maximum number of steps * @param query The user query * @param maxSteps Maximum steps allowed (default: 10) * @returns Final result of agent execution */ abstract run(query: string, maxSteps?: number): Promise<Record<string, any>>; /** * Perform a single step given the query and previous steps * @param query The user query or intermediate input * @param previousSteps History of steps so far * @returns Result of this step */ abstract step(query: string, previousSteps?: Array<Record<string, any>>): Promise<Record<string, any>>; } //# sourceMappingURL=base.d.ts.map