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:
@@ -47,7 +47,7 @@ def register(mcp: FastMCP, settings: Settings) -> None:
|
||||
through this tool.
|
||||
"""
|
||||
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]
|
||||
|
||||
@mcp.tool(annotations={"readOnlyHint": True, "openWorldHint": True})
|
||||
@@ -61,7 +61,7 @@ def register(mcp: FastMCP, settings: Settings) -> None:
|
||||
host = _host(settings)
|
||||
dest = await asyncio.to_thread(
|
||||
ftp.fetch,
|
||||
ftp.resolve_area(area),
|
||||
area,
|
||||
path,
|
||||
host=host,
|
||||
capture_dir=settings.capture_dir,
|
||||
|
||||
Reference in New Issue
Block a user