nexus-agents - v2.80.0
    Preparing search index...

    Function withLogging

    MCP exports - MCP server implementation Split from index.ts for file size compliance (Issue #285) Updated Issue #538: Added missing tool registration exports

    • Higher-order function that wraps a tool handler with logging.

      Type Parameters

      • TArgs

        Tool argument type

      • TResult

        Tool result type

      Parameters

      • toolName: string

        Name of the tool

      • handler: (args: TArgs) => Promise<TResult>

        The tool handler function

      • logger: ILogger

        The logger to use

      Returns (args: TArgs) => Promise<TResult>

      A wrapped handler with automatic logging

      const wrappedHandler = withLogging(
      'my_tool',
      async (args) => { ... },
      logger
      );