Skip to main content
Glama

set_material

Apply or create materials for 3D objects in Blender by specifying object names, material names, and RGB color values.

Instructions

Set or create a material for an object.

Parameters:
- object_name: Name of the object to apply the material to
- material_name: Optional name of the material to use or create
- color: Optional [R, G, B] color values (0.0-1.0)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
object_nameYes
material_nameNo
colorNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool handler for 'set_material'. Forwards parameters to Blender backend via send_command and handles response/error.
    @mcp.tool()
    def set_material(
        ctx: Context, object_name: str, material_name: str = None, color: List[float] = None
    ) -> str:
        """
        Set or create a material for an object.
    
        Parameters:
        - object_name: Name of the object to apply the material to
        - material_name: Optional name of the material to use or create
        - color: Optional [R, G, B] color values (0.0-1.0)
        """
        try:
            # Get the global connection
            blender = get_blender_connection()
    
            params = {"object_name": object_name}
    
            if material_name:
                params["material_name"] = material_name
            if color:
                params["color"] = color
    
            result = blender.send_command("set_material", params)
            return f"Applied material to {object_name}: {result.get('material_name', 'unknown')}"
        except Exception as e:
            logger.error(f"Error setting material: {str(e)}")
            return f"Error setting material: {str(e)}"
  • Input schema defined by function parameters and docstring: required object_name (str), optional material_name (str), color (List[float]), returns str.
    def set_material(
        ctx: Context, object_name: str, material_name: str = None, color: List[float] = None
    ) -> str:
        """
        Set or create a material for an object.
    
        Parameters:
        - object_name: Name of the object to apply the material to
        - material_name: Optional name of the material to use or create
        - color: Optional [R, G, B] color values (0.0-1.0)
        """
  • src/server.py:418-418 (registration)
    The tool is registered using the @mcp.tool() decorator.
    @mcp.tool()
  • Mentioned in asset_creation_strategy prompt as fallback tool for basic materials.
    - set_material() for basic colors and materials
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions 'set or create' but doesn't clarify if this is a read-only or destructive operation, what permissions are needed, or how errors are handled. The description is minimal and misses key behavioral traits like side effects or response format.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and well-structured, with a clear purpose statement followed by a bulleted parameter list. Every sentence adds value, and there's no redundant information. It could be slightly improved by front-loading more context, but it's efficient overall.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (3 parameters, no annotations, but has an output schema), the description is minimally adequate. It covers the basic action and parameters but lacks completeness in usage guidelines, behavioral details, and integration with sibling tools. The output schema helps, but the description should do more to compensate for missing annotations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description lists parameters with brief explanations, adding some meaning beyond the input schema, which has 0% description coverage. It clarifies 'object_name' as the target, 'material_name' as optional for use or creation, and 'color' as RGB values. However, it doesn't fully compensate for the schema gap, lacking details on defaults or interactions between parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Set or create a material for an object.' It specifies the verb ('set or create'), resource ('material'), and target ('object'), making the action clear. However, it doesn't explicitly differentiate from sibling tools like 'set_texture' or 'modify_object', which might handle similar operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. The description lacks context about prerequisites, such as whether the object must exist, or when to choose this over tools like 'set_texture' or 'modify_object'. It only lists parameters without explaining usage scenarios.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/VAST-AI-Research/tripo-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server