Skip to main content
Glama

shader_create

Generate and integrate a custom shader into Unity projects using a name, optional content, and target folder path for streamlined asset creation and management.

Instructions

Create a new shader in Unity project

Input Schema

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

Implementation Reference

  • Handler implementation in executeTool that validates input and delegates to UnityHttpAdapter.createShader
    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}` }] }; }
  • Tool registration including name, description, and input schema in getTools()
    { 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'] } },
  • Adapter helper method that performs HTTP POST to Unity server's 'shader/create' endpoint
    async createShader(name: string, content?: string, folder?: string): Promise<any> { return this.call('shader/create', { name, content, folder }); }

Other Tools

Related 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