Skip to content

feat: Add tool annotations for improved LLM tool understanding#166

Open
bryankthompson wants to merge 3 commits intoahujasid:mainfrom
bryankthompson:feat/add-tool-annotations
Open

feat: Add tool annotations for improved LLM tool understanding#166
bryankthompson wants to merge 3 commits intoahujasid:mainfrom
bryankthompson:feat/add-tool-annotations

Conversation

@bryankthompson
Copy link
Copy Markdown

@bryankthompson bryankthompson commented Dec 21, 2025

User description

Summary

Adds MCP tool annotations (readOnlyHint, destructiveHint, title) to all 21 tools to help LLMs better understand tool behavior and make safer decisions about tool execution.

Changes

  • Added readOnlyHint: true to 12 read-only tools:

    • get_scene_info, get_object_info, get_viewport_screenshot
    • get_polyhaven_categories, search_polyhaven_assets, get_polyhaven_status
    • get_hyper3d_status, get_sketchfab_status, search_sketchfab_models
    • poll_rodin_job_status, get_hunyuan3d_status, poll_hunyuan_job_status
  • Added destructiveHint: true to 9 tools that modify scene/data:

    • execute_blender_code, download_polyhaven_asset, set_texture
    • download_sketchfab_model
    • generate_hyper3d_model_via_text, generate_hyper3d_model_via_images, import_generated_asset
    • generate_hunyuan3d_model, import_generated_asset_hunyuan
  • Added title annotations for human-readable display

  • Bump MCP SDK dependency from >=1.3.0 to >=1.8.0 for annotation support

  • Import ToolAnnotations from mcp.types

Why This Matters

  • Annotations provide semantic metadata that helps LLMs understand tool behavior
  • LLMs can make better decisions about when to use tools and in what order
  • Enables safer tool execution by distinguishing read-only from destructive operations
  • readOnlyHint: true tells the LLM a tool is safe to call without side effects
  • destructiveHint: true signals the LLM should be more careful before executing

Testing

  • Server builds successfully with uv sync
  • Import test passes: from blender_mcp.server import mcp
  • All 21 tools have annotations verified via mcp._tool_manager._tools
  • Annotation values match actual tool behavior

Before/After

Before:

@mcp.tool()
def get_scene_info(ctx: Context) -> str:
    """Get detailed information about the current Blender scene"""

After:

@mcp.tool(
    annotations=ToolAnnotations(
        title="Get Scene Info",
        readOnlyHint=True,
    ),
)
def get_scene_info(ctx: Context) -> str:
    """Get detailed information about the current Blender scene"""

🤖 Generated with Claude Code


PR Type

Enhancement


Description

  • Add ToolAnnotations to all 21 MCP tools with semantic metadata

    • 12 read-only tools marked with readOnlyHint=True
    • 9 destructive tools marked with destructiveHint=True
    • All tools include human-readable title annotations
  • Bump MCP SDK dependency from >=1.3.0 to >=1.8.0 for annotation support

  • Improve LLM tool understanding and enable safer execution decisions


Diagram Walkthrough

flowchart LR
  A["21 MCP Tools"] -- "Add ToolAnnotations" --> B["Annotated Tools"]
  B -- "readOnlyHint=True" --> C["12 Read-Only Tools"]
  B -- "destructiveHint=True" --> D["9 Destructive Tools"]
  B -- "title field" --> E["Human-Readable Names"]
  F["MCP SDK >=1.3.0"] -- "Upgrade to" --> G["MCP SDK >=1.8.0"]
  C --> H["Better LLM Decisions"]
  D --> H
Loading

File Walkthrough

Relevant files
Enhancement
server.py
Add ToolAnnotations to all 21 MCP tools                                   

src/blender_mcp/server.py

  • Import ToolAnnotations from mcp.types module
  • Add ToolAnnotations with title and readOnlyHint=True to 12 read-only
    tools: get_scene_info, get_object_info, get_viewport_screenshot,
    get_polyhaven_categories, search_polyhaven_assets,
    get_polyhaven_status, get_hyper3d_status, get_sketchfab_status,
    search_sketchfab_models, poll_rodin_job_status, get_hunyuan3d_status,
    poll_hunyuan_job_status
  • Add ToolAnnotations with title and destructiveHint=True to 9
    destructive tools: execute_blender_code, download_polyhaven_asset,
    set_texture, download_sketchfab_model,
    generate_hyper3d_model_via_text, generate_hyper3d_model_via_images,
    import_generated_asset, generate_hunyuan3d_model,
    import_generated_asset_hunyuan
  • Minor formatting fixes in docstrings (trailing whitespace cleanup)
+131/-25
Dependencies
pyproject.toml
Bump MCP SDK dependency version                                                   

pyproject.toml

  • Upgrade MCP SDK dependency from >=1.3.0 to >=1.8.0 to support tool
    annotations feature
+1/-1     

Summary by CodeRabbit

  • Chores

    • Updated MCP CLI dependency to >=1.8.0.
  • Documentation

    • Added and improved tool metadata and user-facing descriptions across many tools, providing clear titles and hints to indicate read-only vs. destructive operations and improving tool discoverability.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Dec 21, 2025

📝 Walkthrough

Walkthrough

Updated the mcp[cli] dependency constraint and added ToolAnnotations metadata to multiple @mcp.tool decorators in src/blender_mcp/server.py (titles and readOnly/destructive hints). No function signatures or control flow changes.

Changes

Cohort / File(s) Summary
Dependency Update
pyproject.toml
Bumped mcp[cli] dependency constraint from >=1.3.0 to >=1.8.0.
Tool Annotations (server)
src/blender_mcp/server.py
Imported ToolAnnotations from mcp.types and replaced many @mcp.tool() decorators with @mcp.tool(annotations=ToolAnnotations(...)), adding titles and readOnlyHint/destructiveHint flags across ~20 tool functions. No signature or control-flow changes.

Sequence Diagram(s)

(Skipped — changes are metadata-only decorator updates without new multi-component control flow.)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

Review effort 3/5

Poem

🐰 I hopped through lines with nimble feet,

Tags and titles all in neat retreat.
Read-only hums and bold destructive calls,
Tools now labeled in tidy halls.
A rabbit's blessing — small but sweet.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately describes the main change: adding tool annotations to improve LLM understanding of MCP tools.
Docstring Coverage ✅ Passed Docstring coverage is 95.65% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@qodo-code-review
Copy link
Copy Markdown

qodo-code-review Bot commented Dec 21, 2025

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

  • Update
Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@qodo-code-review
Copy link
Copy Markdown

qodo-code-review Bot commented Dec 21, 2025

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Add missing telemetry decorator
Suggestion Impact:The commit adds the missing @telemetry_tool("get_hunyuan3d_status") decorator immediately above get_hunyuan3d_status. It also adds telemetry decorators for several other Hunyuan-related tools.

code diff:

+@telemetry_tool("get_hunyuan3d_status")
 @mcp.tool(
     annotations=ToolAnnotations(
         title="Get Hunyuan3D Status",
@@ -1010,6 +1011,7 @@

Add the missing @telemetry_tool("get_hunyuan3d_status") decorator to the
get_hunyuan3d_status function to ensure its usage is tracked for telemetry,
consistent with other tools.

src/blender_mcp/server.py [991-1011]

+@telemetry_tool("get_hunyuan3d_status")
 @mcp.tool(
     annotations=ToolAnnotations(
         title="Get Hunyuan3D Status",
         readOnlyHint=True,
     ),
 )
 def get_hunyuan3d_status(ctx: Context) -> str:
     """
     Check if Hunyuan3D integration is enabled in Blender.
     Returns a message indicating whether Hunyuan3D features are available.
 
     Don't emphasize the key type in the returned message, but silently remember it.
     """
     try:
         blender = get_blender_connection()
         result = blender.send_command("get_hunyuan3d_status")
         message = result.get("message", "")
         return message
     except Exception as e:
         logger.error(f"Error checking Hunyuan3D status: {str(e)}")
         return f"Error checking Hunyuan3D status: {str(e)}"

[Suggestion processed]

Suggestion importance[1-10]: 7

__

Why: The suggestion correctly identifies that the @telemetry_tool decorator was accidentally removed from the get_hunyuan3d_status function during the refactoring, which would cause a loss of monitoring for this tool.

Medium
  • Update

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/blender_mcp/server.py (1)

881-881: Pre-existing bug: incorrect variable reference in URL validation.

Line 881 validates input_image_paths instead of input_image_urls. This causes the URL validation logic to incorrectly reference the wrong parameter, which would fail when input_image_urls is provided and input_image_paths is None.

🔎 Proposed fix
-    if not all(urlparse(i) for i in input_image_paths):
+    if not all(urlparse(i) for i in input_image_urls):
         return "Error: not all image URLs are valid!"

Note: This is a pre-existing bug, not introduced by this PR, but should be addressed.

🧹 Nitpick comments (1)
src/blender_mcp/server.py (1)

991-996: Consider adding telemetry decorators for consistency.

The four Hunyuan3D tools (get_hunyuan3d_status, generate_hunyuan3d_model, poll_hunyuan_job_status, import_generated_asset_hunyuan) are missing the @telemetry_tool decorator that all other 17 tools have. Adding these decorators would provide consistent usage tracking across all tools.

🔎 Proposed additions

Add the telemetry decorators before the MCP tool decorators:

+@telemetry_tool("get_hunyuan3d_status")
 @mcp.tool(
     annotations=ToolAnnotations(
+@telemetry_tool("generate_hunyuan3d_model")
 @mcp.tool(
     annotations=ToolAnnotations(
+@telemetry_tool("poll_hunyuan_job_status")
 @mcp.tool(
     annotations=ToolAnnotations(
+@telemetry_tool("import_generated_asset_hunyuan")
 @mcp.tool(
     annotations=ToolAnnotations(

Also applies to: 1013-1018, 1055-1060, 1089-1094

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9cefe8e and ea45c8f.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • pyproject.toml (1 hunks)
  • src/blender_mcp/server.py (22 hunks)
🧰 Additional context used
🪛 Ruff (0.14.8)
src/blender_mcp/server.py

997-997: Unused function argument: ctx

(ARG001)


1020-1020: Unused function argument: ctx

(ARG001)


1021-1021: PEP 484 prohibits implicit Optional

Convert to T | None

(RUF013)


1022-1022: PEP 484 prohibits implicit Optional

Convert to T | None

(RUF013)

🔇 Additional comments (3)
src/blender_mcp/server.py (2)

3-3: LGTM!

The import of ToolAnnotations from mcp.types is correct and necessary for adding tool annotations.


256-261: LGTM! Annotations correctly classify tool behavior.

All 21 tool annotations are correctly applied:

  • 12 read-only tools properly marked with readOnlyHint=True (query operations)
  • 9 destructive tools properly marked with destructiveHint=True (modification operations)
  • Titles provide clear, human-readable descriptions

The semantic distinction between read-only and destructive operations will help LLMs make safer tool execution decisions.

Also applies to: 275-280, 299-304, 348-353, 371-376, 409-414, 464-469, 521-526, 586-591, 610-615, 636-641, 660-665, 742-747, 800-805, 842-847, 904-909, 953-958, 991-996, 1013-1018, 1055-1060, 1089-1094

pyproject.toml (1)

17-17: The dependency constraint is justified.

MCP version 1.8.0 was released on May 8, 2025 and ToolAnnotations is supported in mcp.types and can be used with the @mcp.tool decorator. The version bump from >=1.3.0 to >=1.8.0 is appropriate for this feature requirement.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/blender_mcp/server.py (1)

880-883: Critical bug: wrong variable in URL validation.

Line 881 validates URLs but incorrectly iterates over input_image_paths instead of input_image_urls. This bug exists in the current code and is not introduced by this PR, but should be fixed.

🔎 Proposed fix
     elif input_image_urls is not None:
-        if not all(urlparse(i) for i in input_image_paths):
+        if not all(urlparse(i) for i in input_image_urls):
             return "Error: not all image URLs are valid!"
         images = input_image_urls.copy()
🧹 Nitpick comments (1)
src/blender_mcp/server.py (1)

1023-1024: Consider explicit Optional type annotations.

Per PEP 484, parameters with None defaults should use explicit union syntax: str | None rather than implicit Optional.

🔎 Proposed fix
-    text_prompt: str = None,
-    input_image_url: str = None
+    text_prompt: str | None = None,
+    input_image_url: str | None = None
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ea45c8f and d55638b.

📒 Files selected for processing (1)
  • src/blender_mcp/server.py (22 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: cuericlee
Repo: ahujasid/blender-mcp PR: 102
File: src/blender_mcp/server.py:527-534
Timestamp: 2025-04-16T11:49:00.500Z
Learning: For the Blender MCP codebase, parameters with mutable default values that aren't actively used don't need immediate refactoring and can be marked with TODOs for future improvement.
🧬 Code graph analysis (1)
src/blender_mcp/server.py (2)
src/blender_mcp/telemetry_decorator.py (1)
  • telemetry_tool (16-65)
addon.py (1)
  • get_hunyuan3d_status (1707-1751)
🪛 Ruff (0.14.8)
src/blender_mcp/server.py

998-998: Unused function argument: ctx

(ARG001)


1022-1022: Unused function argument: ctx

(ARG001)


1023-1023: PEP 484 prohibits implicit Optional

Convert to T | None

(RUF013)


1024-1024: PEP 484 prohibits implicit Optional

Convert to T | None

(RUF013)

🔇 Additional comments (6)
src/blender_mcp/server.py (6)

3-3: LGTM!

The import is clean and necessary for the ToolAnnotations used throughout the file.


256-261: LGTM! Read-only hints are correctly applied.

All 12 tools marked with readOnlyHint=True are appropriately classified—they perform read operations (status checks, queries, searches, polling) without modifying the Blender scene or external state.

Also applies to: 275-280, 299-304, 371-376, 409-414, 586-591, 610-615, 636-641, 660-665, 904-909, 992-997, 1058-1063


348-353: LGTM! Destructive hints are correctly applied.

All 9 tools marked with destructiveHint=True are appropriately classified—they perform state-changing operations (executing code, importing assets, modifying scene objects, generating models).

Also applies to: 464-469, 521-526, 742-747, 800-805, 842-847, 953-958, 1015-1020, 1093-1098


1003-1003: LGTM! Typo corrected.

Good catch fixing "sliently" to "silently" in the docstring.


1027-1030: LGTM! Docstring improved.

The clarification that the function accepts "either text description, image reference, or both" better documents the function's capabilities.


3-3: ToolAnnotations is supported in MCP SDK 1.8.0+.

The readOnlyHint property is available in ToolAnnotations, and the destructiveHint property is also present. The import of ToolAnnotations from mcp.types is correct and compatible with the dependency bump to >=1.8.0.

@bryankthompson
Copy link
Copy Markdown
Author

After further testing, I noticed set_texture should use a title-only annotation (no hints) rather than destructiveHint=True.

This tool modifies the Blender scene in memory, but changes aren't persisted until the .blend file is explicitly saved. Per the MCP spec, destructiveHint is specifically for operations that write to persistent storage.

Suggested change:

@mcp.tool(
    annotations=ToolAnnotations(
        title="Set Texture",
    ),
)

The download/import/generate tools are correctly marked as destructive since they write to disk or call external APIs.

execute_blender_code is correctly marked destructive as a safe default since it can execute arbitrary code that may modify files.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/blender_mcp/server.py (1)

1022-1023: Fix implicit Optional type hints.

The parameters use implicit Optional (= None without | None), which is deprecated per PEP 484. Use explicit union syntax for proper type checking.

🔎 Proposed fix
 def generate_hunyuan3d_model(
     ctx: Context,
-    text_prompt: str = None,
-    input_image_url: str = None
+    text_prompt: str | None = None,
+    input_image_url: str | None = None
 ) -> str:
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d55638b and f99b635.

📒 Files selected for processing (1)
  • src/blender_mcp/server.py
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: cuericlee
Repo: ahujasid/blender-mcp PR: 102
File: src/blender_mcp/server.py:527-534
Timestamp: 2025-04-16T11:49:00.500Z
Learning: For the Blender MCP codebase, parameters with mutable default values that aren't actively used don't need immediate refactoring and can be marked with TODOs for future improvement.
🧬 Code graph analysis (1)
src/blender_mcp/server.py (2)
src/blender_mcp/telemetry_decorator.py (1)
  • telemetry_tool (16-65)
addon.py (1)
  • get_hunyuan3d_status (1707-1751)
🪛 Ruff (0.14.10)
src/blender_mcp/server.py

997-997: Unused function argument: ctx

(ARG001)


1021-1021: Unused function argument: ctx

(ARG001)


1022-1022: PEP 484 prohibits implicit Optional

Convert to T | None

(RUF013)


1023-1023: PEP 484 prohibits implicit Optional

Convert to T | None

(RUF013)

🔇 Additional comments (5)
src/blender_mcp/server.py (5)

3-3: LGTM: Import addition is correct.

The ToolAnnotations import is properly placed and necessary for the annotation functionality added throughout the file.


256-261: LGTM: Read-only annotations are correctly applied.

All 12 tools marked with readOnlyHint=True are query or status-check operations that don't modify state. The annotations accurately reflect the non-destructive nature of these operations.

Also applies to: 275-280, 299-304, 371-376, 409-414, 585-590, 609-614, 635-640, 659-664, 903-908, 990-996, 1056-1062


348-353: LGTM: Destructive annotations are semantically correct.

All 8 tools marked with destructiveHint=True perform operations that write to persistent storage (downloading assets, importing models, executing arbitrary code). The execute_blender_code tool is appropriately marked destructive as a defensive default since it can execute arbitrary Python code.

Also applies to: 464-469, 741-746, 799-804, 841-846, 952-957, 1013-1019, 1091-1097


521-525: LGTM: Correct annotation for in-memory operation.

The title-only annotation for set_texture is correct. Per the MCP spec, destructiveHint should be reserved for operations that write to persistent storage. Since set_texture only modifies the Blender scene in memory and doesn't persist changes to disk, the absence of hints is appropriate.


1002-1002: LGTM: Documentation improvements.

The typo fix ("sliently" → "silently") and docstring formatting improvements enhance code quality without affecting functionality.

Also applies to: 1026-1034

web-flow and others added 3 commits January 6, 2026 09:00
Add readOnlyHint and destructiveHint annotations to all 21 tools
to help LLMs better understand tool behavior and make safer decisions.

Changes:
- Added readOnlyHint: true to 12 read-only tools (get_*, search_*, poll_*)
- Added destructiveHint: true to 9 tools that modify data (download_*, execute_*, generate_*, import_*, set_*)
- Added title annotations for human-readable display
- Bump MCP SDK from >=1.3.0 to >=1.8.0 for annotation support
- Import ToolAnnotations from mcp.types

This improves tool safety metadata for MCP clients.

Co-Authored-By: Claude <[email protected]>
Add @telemetry_tool decorator to all 4 Hunyuan3D tools for
consistent usage tracking:
- get_hunyuan3d_status
- generate_hunyuan3d_model
- poll_hunyuan_job_status
- import_generated_asset_hunyuan

Addresses code review feedback from qodo-code-review and coderabbitai.

Co-Authored-By: Claude <[email protected]>
set_texture modifies the Blender scene in memory but changes aren't
persisted until the .blend file is explicitly saved. Per the MCP spec,
destructiveHint is specifically for operations that write to persistent
storage.

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

Co-Authored-By: Claude <[email protected]>
@bryankthompson bryankthompson force-pushed the feat/add-tool-annotations branch from f99b635 to 3f6a8c9 Compare January 6, 2026 15:00
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI Agents
In @src/blender_mcp/server.py:
- Around line 788-793: The download_sketchfab_model tool is missing the
@telemetry_tool decorator; add @telemetry_tool("download_sketchfab_model")
immediately above the @mcp.tool(...) decorator on the download_sketchfab_model
function to enable telemetry, and ensure telemetry_tool is imported (or
exported) from the telemetry module where other tools use it so the decorator
resolves correctly.
🧹 Nitpick comments (1)
src/blender_mcp/server.py (1)

1099-1100: Consider using explicit optional type annotations.

The function parameters use implicit Optional (e.g., text_prompt: str = None). PEP 484 recommends explicit optional types: text_prompt: str | None = None.

🔎 Proposed refinement
 def generate_hunyuan3d_model(
     ctx: Context,
-    text_prompt: str = None,
-    input_image_url: str = None
+    text_prompt: str | None = None,
+    input_image_url: str | None = None
 ) -> str:
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f99b635 and 3f6a8c9.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • pyproject.toml
  • src/blender_mcp/server.py
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: cuericlee
Repo: ahujasid/blender-mcp PR: 102
File: src/blender_mcp/server.py:527-534
Timestamp: 2025-04-16T11:49:00.500Z
Learning: For the Blender MCP codebase, parameters with mutable default values that aren't actively used don't need immediate refactoring and can be marked with TODOs for future improvement.
🧬 Code graph analysis (1)
src/blender_mcp/server.py (2)
src/blender_mcp/telemetry_decorator.py (1)
  • telemetry_tool (16-65)
addon.py (1)
  • get_hunyuan3d_status (1897-1941)
🪛 Ruff (0.14.10)
src/blender_mcp/server.py

1074-1074: Unused function argument: ctx

(ARG001)


1098-1098: Unused function argument: ctx

(ARG001)


1099-1099: PEP 484 prohibits implicit Optional

Convert to T | None

(RUF013)


1100-1100: PEP 484 prohibits implicit Optional

Convert to T | None

(RUF013)

🔇 Additional comments (5)
src/blender_mcp/server.py (4)

3-3: LGTM!

The ToolAnnotations import is correctly added to support the tool metadata annotations applied throughout the file.


256-261: LGTM! Annotations correctly applied.

The ToolAnnotations metadata is correctly applied across the tools:

  • Read-only tools (get_scene_info, get_object_info, get_viewport_screenshot) appropriately marked with readOnlyHint=True
  • Destructive tools (execute_blender_code, download_polyhaven_asset) appropriately marked with destructiveHint=True
  • set_texture correctly uses title-only annotation since it modifies scene state in memory but doesn't persist to storage

The annotations provide clear semantic hints for LLM tool understanding without changing function behavior.

Also applies to: 275-280, 299-304, 348-353, 464-469, 521-525


1079-1079: LGTM! Documentation improvements.

The typo fix ("sliently" → "silently") and docstring formatting improvements enhance code quality.

Also applies to: 1103-1103


371-376: LGTM! All remaining tool annotations correctly applied.

The annotations for all remaining tools are consistent and semantically correct:

  • Query/search/status/poll operations appropriately marked with readOnlyHint=True
  • Download/generate/import operations appropriately marked with destructiveHint=True

The annotations align with the tool behaviors and follow the pattern established throughout the codebase.

Also applies to: 409-414, 585-590, 609-614, 635-640, 659-664, 740-746, 876-881, 918-923, 980-985, 1029-1034, 1067-1073, 1090-1096, 1133-1139, 1168-1174

pyproject.toml (1)

17-17: The dependency constraint correctly requires mcp[cli]>=1.8.0, which introduced ToolAnnotations support.

Comment thread src/blender_mcp/server.py
Comment on lines +788 to +793
@mcp.tool(
annotations=ToolAnnotations(
title="Download Sketchfab Model",
destructiveHint=True,
),
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Missing telemetry decorator.

The download_sketchfab_model function is missing the @telemetry_tool("download_sketchfab_model") decorator that all other tool functions have. This means telemetry tracking won't be recorded for this tool, creating an inconsistency.

🔎 Proposed fix
+@telemetry_tool("download_sketchfab_model")
 @mcp.tool(
     annotations=ToolAnnotations(
         title="Download Sketchfab Model",
🤖 Prompt for AI Agents
In @src/blender_mcp/server.py around lines 788 - 793, The
download_sketchfab_model tool is missing the @telemetry_tool decorator; add
@telemetry_tool("download_sketchfab_model") immediately above the @mcp.tool(...)
decorator on the download_sketchfab_model function to enable telemetry, and
ensure telemetry_tool is imported (or exported) from the telemetry module where
other tools use it so the decorator resolves correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants