Fix outline_api_call: handle empty params string
All checks were successful
Build and Push Outline MCP Docker Image / build (push) Successful in 6s

This commit is contained in:
Ben
2025-12-30 20:38:36 +00:00
parent 0293acaaa8
commit cf1d9be24b

View File

@@ -183,7 +183,7 @@ async def list_collection_documents(
@mcp.tool()
async def outline_api_call(method: str, params: str = "{}") -> str:
async def outline_api_call(method: str, params: str = "") -> str:
"""Execute a raw Outline API call for any endpoint.
Use the 'outline://api-reference' resource to discover available methods
@@ -202,7 +202,7 @@ async def outline_api_call(method: str, params: str = "{}") -> str:
- method='documents.delete', params='{"id": "document-uuid"}'
"""
try:
parsed_params = json.loads(params) if params else {}
parsed_params = json.loads(params) if params and params.strip() else {}
except json.JSONDecodeError as e:
return json.dumps({"ok": False, "error": f"Invalid JSON params: {str(e)}"})