Logo GenPRES

McpToolLogging Module

The tool-call logging filter: wraps every `tools/call` request the SDK dispatches, whichever `[]` class ends up handling it, with no per-tool-method edit needed.

Functions and values

Function or value Description

callToolLoggingFilter logger

Full Usage: callToolLoggingFilter logger

Parameters:
Returns: McpRequestFilter<CallToolRequestParams, CallToolResult>

SDK-shaped adapter around `logToolCall`: reads `ctx.Params`, converts `ValueTask` to `Task` and back. Registered once at the composition root via `WithRequestFilters`.

logger : Logger
Returns: McpRequestFilter<CallToolRequestParams, CallToolResult>

logToolCall logger toolName argumentKeys isError call

Full Usage: logToolCall logger toolName argumentKeys isError call

Parameters:
    logger : Logger
    toolName : string
    argumentKeys : string[]
    isError : 'result -> bool
    call : unit -> Task<'result>

Returns: Task<'result>
Type parameters: 'result

The loggable decision, free of any SDK type: what to log, in what order, given a tool name, its argument keys, and a thunk that performs the call. Argument KEYS only, never values - clinical parameters (age/weight/sex/generic/indication) live in the values.

logger : Logger
toolName : string
argumentKeys : string[]
isError : 'result -> bool
call : unit -> Task<'result>
Returns: Task<'result>

Type something to start searching.