Skip to main content
Glama

shader_create

Create new shaders in Unity projects by specifying name, content, and folder location to customize visual effects.

Instructions

Create a new shader in Unity project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of the shader (without .shader extension)
contentNoShader content (optional, will use template if not provided)
folderNoTarget folder path (default: Assets/Shaders)

Implementation Reference

  • Handler for the shader_create tool. Validates the 'name' parameter and calls the adapter's createShader method, returning success message with path and GUID.
    case 'shader_create': {
      if (!args.name) {
        throw new Error('name is required');
      }
      const result = await this.adapter.createShader(args.name, args.content, args.folder);
      return {
        content: [{
          type: 'text',
          text: `Shader created successfully:\nPath: ${result.path}\nGUID: ${result.guid}`
        }]
      };
  • Input schema defining parameters for shader_create: name (required), optional content and folder.
    inputSchema: {
      type: 'object',
      properties: {
        name: {
          type: 'string',
          description: 'Name of the shader (without .shader extension)'
        },
        content: {
          type: 'string',
          description: 'Shader content (optional, will use template if not provided)'
        },
        folder: {
          type: 'string',
          description: 'Target folder path (default: Assets/Shaders)'
        }
      },
      required: ['name']
  • Tool registration object added to the tools array in getTools() method.
    {
      name: 'shader_create',
      description: 'Create a new shader in Unity project',
      inputSchema: {
        type: 'object',
        properties: {
          name: {
            type: 'string',
            description: 'Name of the shader (without .shader extension)'
          },
          content: {
            type: 'string',
            description: 'Shader content (optional, will use template if not provided)'
          },
          folder: {
            type: 'string',
            description: 'Target folder path (default: Assets/Shaders)'
          }
        },
        required: ['name']
      }
    },
  • Helper method in UnityHttpAdapter that forwards the create shader request to the Unity HTTP server via the generic call method.
    async createShader(name: string, content?: string, folder?: string): Promise<any> {
      return this.call('shader/create', { name, content, folder });
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool creates a shader but doesn't mention whether this requires specific permissions, if it overwrites existing files, what happens on failure, or the expected output format. For a creation tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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

Conciseness5/5

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

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is front-loaded with the core action and resource, making it easy to parse quickly. Every word earns its place, achieving optimal conciseness.

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

Completeness2/5

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

Given the complexity of creating a shader in Unity, the lack of annotations, and no output schema, the description is insufficient. It doesn't explain what a shader is in this context, potential side effects, error handling, or return values. For a tool with 3 parameters and no structured safety hints, more context is needed to ensure reliable use.

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 input schema has 100% description coverage, clearly documenting all three parameters (name, content, folder). The description adds no additional parameter semantics beyond what the schema provides, such as examples or constraints. However, the baseline score of 3 is appropriate since the schema adequately covers the 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 action ('Create') and resource ('new shader in Unity project'), making the purpose immediately understandable. However, it doesn't differentiate this tool from its sibling 'shader_delete' or 'shader_read' beyond the obvious verb difference, missing an opportunity to clarify its specific role in the shader management workflow.

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 like 'script_create' or 'folder_create' for related assets, nor does it mention prerequisites such as needing an active Unity project. The description assumes context without explicitly stating it, leaving the agent to infer 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/zabaglione/mcp-server-unity'

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