From a27df399c739ef798e91caf239b45abb859299e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20P=C3=B6tzl?= Date: Tue, 1 Dec 2026 13:55:59 +0100 Subject: [PATCH] Accept .accda database paths --- CHANGELOG.md | 3 +++ skills/aclib-import/SKILL.md | 2 +- src/aclib_import_mcp/server.py | 6 +++--- tests/test_server.py | 6 ++++++ 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e315f0..aeed767 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). ## [Unreleased] +### Added +- Database paths with the extension .accda (Access add-in files) are accepted by all tools. + ## [0.2.0] - 2026-11-18 ### Added diff --git a/skills/aclib-import/SKILL.md b/skills/aclib-import/SKILL.md index 93eeb53..6083dde 100644 --- a/skills/aclib-import/SKILL.md +++ b/skills/aclib-import/SKILL.md @@ -14,7 +14,7 @@ Only the tools of the `aclib-import` MCP server are used. - ACLib Import Wizard with automation API is installed (`aclib_get_version` returns `api >= 1`). - Add-in **and** target database are in trusted locations. Otherwise a security prompt blocks the call or code is disabled. -- `database_path` is the full path of the target `.accdb`/`.mdb`. +- `database_path` is the full path of the target `.accdb`/`.accda`/`.mdb`. ## Tools diff --git a/src/aclib_import_mcp/server.py b/src/aclib_import_mcp/server.py index f0f191f..5552bc1 100644 --- a/src/aclib_import_mcp/server.py +++ b/src/aclib_import_mcp/server.py @@ -38,7 +38,7 @@ Mode = Literal["missing", "all", "selected"] Source = Literal["config", "local", "github"] -DATABASE_EXTENSIONS = {".accdb", ".mdb"} +DATABASE_EXTENSIONS = {".accdb", ".accda", ".mdb"} AC_CMD_COMPILE_AND_SAVE_ALL_MODULES = 126 NOT_COMPILED_MESSAGE = ( "Project does not compile; open the VBA editor (Debug > Compile) to see the error." @@ -48,7 +48,7 @@ DatabasePath = Annotated[ str, - Field(description="Full path of the target Access database (.accdb/.mdb)."), + Field(description="Full path of the target Access database (.accdb/.accda/.mdb)."), ] Files = Annotated[ list[str], @@ -96,7 +96,7 @@ def validate_database_path(database_path: str) -> str: if not path.is_absolute(): raise ToolError(f"database_path must be an absolute path: {database_path!r}") if path.suffix.lower() not in DATABASE_EXTENSIONS: - raise ToolError(f"database_path must be an .accdb or .mdb file: {database_path!r}") + raise ToolError(f"database_path must be an .accdb, .accda or .mdb file: {database_path!r}") return str(path) diff --git a/tests/test_server.py b/tests/test_server.py index 9e8d652..81ecc95 100644 --- a/tests/test_server.py +++ b/tests/test_server.py @@ -96,6 +96,12 @@ def test_validate_database_path_rejects(path): server.validate_database_path(path) +@pytest.mark.parametrize("extension", [".accdb", ".accda", ".mdb", ".ACCDA"]) +def test_validate_database_path_accepts(extension): + path = rf"C:\Data\test{extension}" + assert server.validate_database_path(path) == path + + def test_get_version(use_worker): app = FakeApp({"GetVersion": VERSION_OK}) use_worker(FakeWorker(app))