From 85ac397eb4ec9094834214ed89ee4896b40ddd91 Mon Sep 17 00:00:00 2001 From: ki7mt Date: Sat, 14 Mar 2026 20:30:02 +0000 Subject: [PATCH] Fix null parameter handling for mcpo/Open WebUI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Type annotations changed to accept None (int | None) so mcpo/Pydantic doesn't reject null values. Runtime coercion converts None → defaults. 2 params in parse_adif. Fixes #2 Co-Authored-By: Claude Opus 4.6 (1M context) --- pyproject.toml | 2 +- src/adif_mcp/mcp/server.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index eb8df9f..31f986e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "adif-mcp" -version = "1.0.3" +version = "1.0.4" description = "ADIF MCP server — spec parsing, validation, and field enumeration tools" readme = "README.md" license = { text = "GPL-3.0-or-later" } diff --git a/src/adif_mcp/mcp/server.py b/src/adif_mcp/mcp/server.py index 0f1c241..d1fd088 100644 --- a/src/adif_mcp/mcp/server.py +++ b/src/adif_mcp/mcp/server.py @@ -497,13 +497,15 @@ def calculate_heading(start: str, end: str) -> float: @mcp.tool() async def parse_adif( - file_path: str, start_at: int = 1, limit: int = 20 + file_path: str, start_at: int | None = 1, limit: int | None = 20 ) -> List[types.TextContent]: """Streaming parser for large ADIF files with record seeking. SECURITY NOTE: This tool reads files from the local filesystem using the provided path. Only pass paths to ADIF log files you own. """ + start_at = start_at if start_at is not None else 1 + limit = limit if limit is not None else 20 record_pattern = re.compile(r"(.*?)", re.IGNORECASE | re.DOTALL) try: