Member Junction
    Preparing search index...

    ExecutionLogger handles logging of MCP tool calls to the database.

    Features:

    • Configurable logging per connection (inputs, outputs)
    • Automatic output truncation for large responses
    • Async logging to avoid blocking tool execution
    • Error resilience (logging failures don't break tool calls)
    const logger = new ExecutionLogger();

    // Start logging before tool call
    const logEntry = await logger.startLog(connectionId, toolName, params, contextUser);

    // ... execute tool ...

    // Complete log after tool call
    await logger.completeLog(logEntry.id, result);
    Index

    Constructors

    Methods

    • Cleans up old log entries

      Parameters

      • connectionId: string

        MCP connection ID (optional, cleans all if not specified)

      • olderThanDays: number

        Delete logs older than this many days

      • contextUser: UserInfo

        User context

      • Optionalprovider: IMetadataProvider

      Returns Promise<number>

      Number of deleted entries

    • Creates a new log entry at the start of tool execution

      Parameters

      • connectionId: string

        MCP connection ID

      • toolId: string

        MCP tool ID (if available)

      • toolName: string

        Tool name

      • inputParams: Record<string, unknown>

        Input parameters

      • config: MCPLoggingConfig

        Logging configuration

      • contextUser: UserInfo

        User context

      • Optionalprovider: IMetadataProvider

      Returns Promise<string>

      Log entry ID for later completion