ChunDe Claude Sonnet 4.5 commited on
Commit
4b6459f
·
1 Parent(s): 56dd95f

fix: Use correct API method addObject instead of addText

Browse files

MCP server was calling non-existent addText() method.
Changed to addObject({type: "text", ...}) which is the correct API.

This should finally allow text to be added when customizing layouts.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>

Files changed (1) hide show
  1. mcp_server_comprehensive.py +8 -3
mcp_server_comprehensive.py CHANGED
@@ -447,13 +447,16 @@ async def create_thumbnail(inputs: Dict[str, Any]) -> Dict[str, Any]:
447
  # Add new title text
448
  if title_objects:
449
  first_title = title_objects[0]
450
- await execute_api_call(page, "addText", title, {
 
 
451
  "x": first_title.get("x", 73),
452
  "y": first_title.get("y", 65),
453
  "fontSize": first_title.get("fontSize", 190),
454
  "fontFamily": first_title.get("fontFamily", "Inter"),
455
  "fill": first_title.get("fill", "#000000"),
456
- "fontWeight": "bold"
 
457
  })
458
  results.append({"step": "add_new_title"})
459
  # Wait for new text to render
@@ -490,7 +493,9 @@ async def create_thumbnail(inputs: Dict[str, Any]) -> Dict[str, Any]:
490
  # Add new subtitle text
491
  if subtitle_objects:
492
  first_subtitle = subtitle_objects[0]
493
- await execute_api_call(page, "addText", subtitle, {
 
 
494
  "x": first_subtitle.get("x", 84),
495
  "y": first_subtitle.get("y", 428),
496
  "fontSize": first_subtitle.get("fontSize", 68),
 
447
  # Add new title text
448
  if title_objects:
449
  first_title = title_objects[0]
450
+ await execute_api_call(page, "addObject", {
451
+ "type": "text",
452
+ "text": title,
453
  "x": first_title.get("x", 73),
454
  "y": first_title.get("y", 65),
455
  "fontSize": first_title.get("fontSize", 190),
456
  "fontFamily": first_title.get("fontFamily", "Inter"),
457
  "fill": first_title.get("fill", "#000000"),
458
+ "fontWeight": "bold",
459
+ "bold": True
460
  })
461
  results.append({"step": "add_new_title"})
462
  # Wait for new text to render
 
493
  # Add new subtitle text
494
  if subtitle_objects:
495
  first_subtitle = subtitle_objects[0]
496
+ await execute_api_call(page, "addObject", {
497
+ "type": "text",
498
+ "text": subtitle,
499
  "x": first_subtitle.get("x", 84),
500
  "y": first_subtitle.get("y", 428),
501
  "fontSize": first_subtitle.get("fontSize", 68),