Pass area names to the file tools, not resolved areas

list_dir and fetch take a name and resolve it themselves; the tools layer
resolved it first and handed over the object, so every call failed with
'No FTP area named Area(...)'. Found by calling the tool for real.
This commit is contained in:
Ryan Malloy
2026-10-02 02:06:56 -06:00
parent 169bc91a8f
commit dd2e6c4886
+2 -2
View File
@@ -47,7 +47,7 @@ def register(mcp: FastMCP, settings: Settings) -> None:
through this tool. through this tool.
""" """
host = _host(settings) host = _host(settings)
entries = await asyncio.to_thread(ftp.list_dir, ftp.resolve_area(area), path, host=host) entries = await asyncio.to_thread(ftp.list_dir, area, path, host=host)
return [FileEntry(name=e.name, size=e.size, is_dir=e.is_dir) for e in entries] return [FileEntry(name=e.name, size=e.size, is_dir=e.is_dir) for e in entries]
@mcp.tool(annotations={"readOnlyHint": True, "openWorldHint": True}) @mcp.tool(annotations={"readOnlyHint": True, "openWorldHint": True})
@@ -61,7 +61,7 @@ def register(mcp: FastMCP, settings: Settings) -> None:
host = _host(settings) host = _host(settings)
dest = await asyncio.to_thread( dest = await asyncio.to_thread(
ftp.fetch, ftp.fetch,
ftp.resolve_area(area), area,
path, path,
host=host, host=host,
capture_dir=settings.capture_dir, capture_dir=settings.capture_dir,