nat.plugins.mcp.utils#

Functions#

truncate_session_id(→ str)

Truncate a session ID for logging purposes.

model_from_mcp_schema(→ type[pydantic.BaseModel])

Create a pydantic model from the input schema of the MCP tool

Module Contents#

truncate_session_id(session_id: str, max_length: int = 10) str#

Truncate a session ID for logging purposes.

Args:

session_id: The session ID to truncate max_length: Maximum length before truncation (default: 10)

Returns:

Truncated session ID with “…” if longer than max_length, otherwise full ID

model_from_mcp_schema(
name: str,
mcp_input_schema: dict,
) type[pydantic.BaseModel]#

Create a pydantic model from the input schema of the MCP tool