mcp-use
Version:
Opinionated MCP Framework for TypeScript (@modelcontextprotocol/sdk compatible) - Build MCP Agents, Clients and Servers with support for ChatGPT Apps, Code Mode, OAuth, Notifications, Sampling, Observability and more.
58 lines • 1.83 kB
TypeScript
import type { StreamEvent } from "@langchain/core/tracers/log_stream";
interface ExecuteCodeResult {
result: unknown;
logs: string[];
error: string | null;
execution_time: number;
}
export declare function printBox(content: string, title?: string, language?: string, bgColor?: boolean): void;
/**
* Extract code from tool input if present
*/
export declare function extractCodeFromToolInput(input: unknown): string | null;
/**
* Parse execute_code tool result
*/
export declare function parseExecuteCodeResult(output: unknown): ExecuteCodeResult | null;
/**
* Render content with appropriate formatting
*/
export declare function renderContent(content: unknown): string;
/**
* Unwrap tool input if it's wrapped in an "input" field with JSON string
*/
export declare function unwrapToolInput(input: unknown): unknown;
/**
* Handle tool start event with pretty printing
*/
export declare function handleToolStart(event: StreamEvent): void;
/**
* Extract content from LangChain ToolMessage structure
*/
export declare function extractToolMessageContent(output: unknown): {
toolName: string;
status: string;
content: unknown;
} | null;
/**
* Format search_tools result as a tree structure
*/
export declare function formatSearchToolsAsTree(tools: Array<{
server: string;
name: string;
description?: string;
}>, meta?: {
total_tools?: number;
namespaces?: string[];
result_count?: number;
}, query?: string): string;
/**
* Handle tool end event with pretty printing
*/
export declare function handleToolEnd(event: StreamEvent): void;
/**
* Stream events with pretty printing
*/
export declare function prettyStreamEvents(streamEventsGenerator: AsyncGenerator<StreamEvent, void, void>): AsyncGenerator<void, string, void>;
export {};
//# sourceMappingURL=display.d.ts.map