Logo GenPRES

McpHelpers Module

Shared pure helpers used by MCP tool wiring classes.

Functions and values

Function or value Description

optFloat v

Full Usage: optFloat v

Parameters:
Returns: float option
v : Nullable<float>
Returns: float option

optStr s

Full Usage: optStr s

Parameters:
    s : string

Returns: string option
s : string
Returns: string option

textResult isError text

Full Usage: textResult isError text

Parameters:
    isError : bool
    text : string

Returns: CallToolResult

A tool result holding the text, flagged as a failure when isError is true, so the client and the logging filter can tell a refusal from an answer.

isError : bool
text : string
Returns: CallToolResult

toJson obj

Full Usage: toJson obj

Parameters:
    obj : 'a

Returns: string
Type parameters: 'a
obj : 'a
Returns: string

toJsonResult result

Full Usage: toJsonResult result

Parameters:
Returns: CallToolResult
Type parameters: 'a

An Ok value as JSON text; an Error message as plain text with IsError set.

result : Result<'a, string>
Returns: CallToolResult

Type something to start searching.