From 218f946e485adf989cfbdb59387c71e4bb1a30c2 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Sun, 29 Mar 2026 15:16:13 -0400 Subject: [PATCH] fix: fable_add_task_log sends content not body to match API The MCP tool was sending {"body": ...} but the task logs API route expects {"content": ...}, causing 400 errors. Co-Authored-By: Claude Sonnet 4.6 --- fable-mcp/fable_mcp/server.py | 4 ++-- fable-mcp/fable_mcp/tools/tasks.py | 4 ++-- fable-mcp/tests/test_tools_tasks.py | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/fable-mcp/fable_mcp/server.py b/fable-mcp/fable_mcp/server.py index 87ad547..2db77c0 100644 --- a/fable-mcp/fable_mcp/server.py +++ b/fable-mcp/fable_mcp/server.py @@ -298,7 +298,7 @@ async def fable_update_task( @mcp.tool() -async def fable_add_task_log(task_id: int, body: str) -> dict: +async def fable_add_task_log(task_id: int, content: str) -> dict: """Append a timestamped progress log entry to a Fable task. Use this to record work sessions, decisions, or status updates over time without @@ -306,7 +306,7 @@ async def fable_add_task_log(task_id: int, body: str) -> dict: chronologically in the task view. """ async with FableClient() as client: - return await tasks.add_task_log(client, task_id=task_id, body=body) + return await tasks.add_task_log(client, task_id=task_id, content=content) # --------------------------------------------------------------------------- diff --git a/fable-mcp/fable_mcp/tools/tasks.py b/fable-mcp/fable_mcp/tools/tasks.py index d9bb4c2..d2f6167 100644 --- a/fable-mcp/fable_mcp/tools/tasks.py +++ b/fable-mcp/fable_mcp/tools/tasks.py @@ -87,7 +87,7 @@ async def add_task_log( client: FableClient, *, task_id: int, - body: str, + content: str, ) -> dict[str, Any]: """Append a log entry to a task.""" - return await client.post(f"/api/tasks/{task_id}/logs", json={"body": body}) + return await client.post(f"/api/tasks/{task_id}/logs", json={"content": content}) diff --git a/fable-mcp/tests/test_tools_tasks.py b/fable-mcp/tests/test_tools_tasks.py index 12246d6..17976b6 100644 --- a/fable-mcp/tests/test_tools_tasks.py +++ b/fable-mcp/tests/test_tools_tasks.py @@ -46,9 +46,9 @@ async def test_update_task_patches(client): @pytest.mark.asyncio async def test_add_task_log_posts_to_logs_endpoint(client): from fable_mcp.tools.tasks import add_task_log - client.post = AsyncMock(return_value={"id": 1, "body": "progress"}) - await add_task_log(client, task_id=9, body="progress") + client.post = AsyncMock(return_value={"id": 1, "content": "progress"}) + await add_task_log(client, task_id=9, content="progress") client.post.assert_called_once() path = client.post.call_args[0][0] assert path == "/api/tasks/9/logs" - assert client.post.call_args[1]["json"]["body"] == "progress" + assert client.post.call_args[1]["json"]["content"] == "progress"