Skip to content

AttributeError: 'ImageContent' object has no attribute 'text'ย #2

@guyuming76

Description

@guyuming76

when i use deepseek-chat for blender-mcp, i got the following error:

 ๐Ÿค  You: ๆŠŠblenderๅœบๆ™ฏไธญๅ››้ขไฝ“ๆถ‚ๆˆ็บข่‰ฒๅˆ—ๅ‡บๆˆ‘ๅฆ‚ๆžœๅฆ‚ไฝ•ไธ€ๆญฅๅšๆญฅๅš
INFO     2025-11-06 23:39:41,337 Token usage statistics: Input: 2656, Output: 39                                          
INFO     2025-11-06 23:39:41,340 :๐Ÿ”ง:Executing tool: [get_scene_info]...                                                  
INFO     2025-11-06 23:39:58,278 Token usage statistics: Input: 2904, Output: 352                                         
INFO     2025-11-06 23:39:58,280 :๐Ÿ”ง:Executing tool: [execute_blender_code]...                                            
INFO     2025-11-06 23:40:02,864 Token usage statistics: Input: 3272, Output: 41                                          
INFO     2025-11-06 23:40:02,874 :๐Ÿ”ง:Executing tool: [get_viewport_screenshot]...                                         
INFO     2025-11-06 23:40:02,956 Shutting down MCP server: [blender]                                                      
Traceback (most recent call last):
  File "/home/guyuming/mcpclihost/lib/python3.13/site-packages/mcp_cli_host/cmd/app.py", line 624, in main
    await chat_session.run_mcp_host()
  File "/home/guyuming/mcpclihost/lib/python3.13/site-packages/mcp_cli_host/cmd/app.py", line 568, in run_mcp_host
    await self.run_promt(
    ...<3 lines>...
    )
  File "/home/guyuming/mcpclihost/lib/python3.13/site-packages/mcp_cli_host/cmd/app.py", line 409, in run_promt
    await self.run_promt(
    ...<2 lines>...
    )
  File "/home/guyuming/mcpclihost/lib/python3.13/site-packages/mcp_cli_host/cmd/app.py", line 409, in run_promt
    await self.run_promt(
    ...<2 lines>...
    )
  File "/home/guyuming/mcpclihost/lib/python3.13/site-packages/mcp_cli_host/cmd/app.py", line 392, in run_promt
    text=content.text
         ^^^^^^^^^^^^
  File "/home/guyuming/mcpclihost/lib/python3.13/site-packages/pydantic/main.py", line 1026, in __getattr__
    raise AttributeError(f'{type(self).__name__!r} object has no attribute {item!r}')
AttributeError: 'ImageContent' object has no attribute 'text'
ERROR    2025-11-06 23:40:02,969 'ImageContent' object has no attribute 'text'                                            
ERROR    2025-11-06 23:40:02,971 'ImageContent' object has no attribute 'text'                                            
         โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Traceback (most recent call last) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
         โ”‚ /home/guyuming/mcpclihost/lib/python3.13/site-packages/mcp_cli_host/cmd/app.py:624 in main                    โ”‚
         โ”‚                                                                                                               โ”‚
         โ”‚   621 โ”‚   โ”‚   โ”‚   roots=args.roots,                                                                           โ”‚
         โ”‚   622 โ”‚   โ”‚   โ”‚   sys_prompt=args.sys_prompt)                                                                 โ”‚
         โ”‚   623 โ”‚   โ”‚                                                                                                   โ”‚
         โ”‚ โฑ 624 โ”‚   โ”‚   await chat_session.run_mcp_host()                                                               โ”‚
         โ”‚   625 โ”‚   except Exception as e:                                                                              โ”‚
         โ”‚   626 โ”‚   โ”‚   traceback.print_exception(e)                                                                    โ”‚
         โ”‚   627 โ”‚   โ”‚   log.error(f"{e}")                                                                               โ”‚
         โ”‚                                                                                                               โ”‚
         โ”‚ /home/guyuming/mcpclihost/lib/python3.13/site-packages/mcp_cli_host/cmd/app.py:568 in run_mcp_host            โ”‚
         โ”‚                                                                                                               โ”‚
         โ”‚   565 โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   if state:                                                                           โ”‚
         โ”‚   566 โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   continue                                                                        โ”‚
         โ”‚   567 โ”‚   โ”‚   โ”‚   โ”‚   โ”‚                                                                                       โ”‚
         โ”‚ โฑ 568 โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   await self.run_promt(                                                               โ”‚
         โ”‚   569 โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   provider=provider,                                                              โ”‚
         โ”‚   570 โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   prompt=user_input,                                                              โ”‚
         โ”‚   571 โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   messages=prompt_messages                                                        โ”‚
         โ”‚                                                                                                               โ”‚
         โ”‚ /home/guyuming/mcpclihost/lib/python3.13/site-packages/mcp_cli_host/cmd/app.py:409 in run_promt               โ”‚
         โ”‚                                                                                                               โ”‚
         โ”‚   406 โ”‚   โ”‚   ))                                                                                              โ”‚
         โ”‚   407 โ”‚   โ”‚                                                                                                   โ”‚
         โ”‚   408 โ”‚   โ”‚   if len(tool_call_results) > 0:                                                                  โ”‚
         โ”‚ โฑ 409 โ”‚   โ”‚   โ”‚   await self.run_promt(                                                                       โ”‚
         โ”‚   410 โ”‚   โ”‚   โ”‚   โ”‚   provider=provider,                                                                      โ”‚
         โ”‚   411 โ”‚   โ”‚   โ”‚   โ”‚   prompt=""                                                                               โ”‚
         โ”‚   412 โ”‚   โ”‚   โ”‚   )                                                                                           โ”‚
         โ”‚                                                                                                               โ”‚
         โ”‚ /home/guyuming/mcpclihost/lib/python3.13/site-packages/mcp_cli_host/cmd/app.py:409 in run_promt               โ”‚
         โ”‚                                                                                                               โ”‚
         โ”‚   406 โ”‚   โ”‚   ))                                                                                              โ”‚
         โ”‚   407 โ”‚   โ”‚                                                                                                   โ”‚
         โ”‚   408 โ”‚   โ”‚   if len(tool_call_results) > 0:                                                                  โ”‚
         โ”‚ โฑ 409 โ”‚   โ”‚   โ”‚   await self.run_promt(                                                                       โ”‚
         โ”‚   410 โ”‚   โ”‚   โ”‚   โ”‚   provider=provider,                                                                      โ”‚
         โ”‚   411 โ”‚   โ”‚   โ”‚   โ”‚   prompt=""                                                                               โ”‚
         โ”‚   412 โ”‚   โ”‚   โ”‚   )                                                                                           โ”‚
         โ”‚                                                                                                               โ”‚
         โ”‚ /home/guyuming/mcpclihost/lib/python3.13/site-packages/mcp_cli_host/cmd/app.py:392 in run_promt               โ”‚
         โ”‚                                                                                                               โ”‚
         โ”‚   389 โ”‚   โ”‚   โ”‚   for content in tool_call_res.content:                                                       โ”‚
         โ”‚   390 โ”‚   โ”‚   โ”‚   โ”‚   contents.append(TextContent(                                                            โ”‚
         โ”‚   391 โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   type=content.type,                                                                  โ”‚
         โ”‚ โฑ 392 โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   text=content.text                                                                   โ”‚
         โ”‚   393 โ”‚   โ”‚   โ”‚   โ”‚   ))                                                                                      โ”‚
         โ”‚   394 โ”‚   โ”‚   โ”‚                                                                                               โ”‚
         โ”‚   395 โ”‚   โ”‚   โ”‚   result = CallToolResultWithID(                                                              โ”‚
         โ”‚                                                                                                               โ”‚
         โ”‚ /home/guyuming/mcpclihost/lib/python3.13/site-packages/pydantic/main.py:1026 in __getattr__                   โ”‚
         โ”‚                                                                                                               โ”‚
         โ”‚   1023 โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   return super().__getattribute__(item)  # Raises AttributeError                 โ”‚
         โ”‚        if appropriate                                                                                         โ”‚
         โ”‚   1024 โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   else:                                                                              โ”‚
         โ”‚   1025 โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   # this is the current error                                                    โ”‚
         โ”‚ โฑ 1026 โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   โ”‚   raise AttributeError(f'{type(self).__name__!r} object has no                   โ”‚
         โ”‚        attribute {item!r}')                                                                                   โ”‚
         โ”‚   1027 โ”‚   โ”‚                                                                                                  โ”‚
         โ”‚   1028 โ”‚   โ”‚   def __setattr__(self, name: str, value: Any) -> None:                                          โ”‚
         โ”‚   1029 โ”‚   โ”‚   โ”‚   if (setattr_handler := self.__pydantic_setattr_handlers__.get(name)) is not                โ”‚
         โ”‚        None:                                                                                                  โ”‚
         โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
         AttributeError: 'ImageContent' object has no attribute 'text'                                                    
usage: mcpclihost [-h] [--config CONFIG] [--message-window MESSAGE_WINDOW] -m MODEL [--debug] [--base-url BASE_URL]
                  [--roots [ROOTS ...]] [--sys-prompt SYS_PROMPT]

options:
  -h, --help            show this help message and exit
  --config CONFIG       config file (default is $HOME/mcp.json)
  --message-window MESSAGE_WINDOW
                        number of messages to keep in context
  -m, --model MODEL     model to use (format: provider:model, e.g. azure:gpt-4-0613 or ollama:qwen2.5:3b)
  --debug               enable debug logging
  --base-url BASE_URL   base URL for OpenAI API (defaults to api.openai.com)
  --roots [ROOTS ...]   clients to expose filesystem โ€œrootsโ€ to servers
  --sys-prompt SYS_PROMPT
                        system prompts to expose to clients
(mcpclihost) guyuming@localhost ~/mcpclihost $ 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions