UNPKG

@agentpaid/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.

22 lines (21 loc) 856 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AcquireActiveMCPServerTool = void 0; const zod_1 = require("zod"); const base_js_1 = require("./base.js"); const PresentActiveServerSchema = zod_1.z.object({}); class AcquireActiveMCPServerTool extends base_js_1.MCPServerTool { name = 'get_active_mcp_server'; description = 'Get the currently active MCP (Model Context Protocol) server'; schema = PresentActiveServerSchema; constructor(manager) { super(manager); } async _call() { if (!this.manager.activeServer) { return `No MCP server is currently active. Use connect_to_mcp_server to connect to a server.`; } return `Currently active MCP server: ${this.manager.activeServer}`; } } exports.AcquireActiveMCPServerTool = AcquireActiveMCPServerTool;