Skip to main content
Glama

get-studio-templates

Retrieve available studio templates for generating images using your Orshot API key. Access pre-designed templates to create images from prompts in Claude, Cursor, or other MCP-supported applications.

Instructions

Get all available studio templates for the user using their API key

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
apiKeyNoOrshot API key for authentication (optional if set in environment)

Implementation Reference

  • src/index.ts:1164-1255 (registration)
    Registration of the 'get-studio-templates' tool using server.tool(), including inline schema and handler function.
      "get-studio-templates",
      "Get all available studio templates for the user using their API key",
      {
        apiKey: z.string().optional().describe("Orshot API key for authentication (optional if set in environment)"),
      },
      async (args) => {
        const { apiKey } = args;
        const actualApiKey = apiKey || DEFAULT_API_KEY;
        
        if (!actualApiKey) {
          return {
            content: [
              {
                type: "text",
                text: "No API key provided. Please provide an API key parameter or set ORSHOT_API_KEY environment variable.",
              },
            ],
          };
        }
    
        try {
          const response = await fetch(`${ORSHOT_API_BASE}/v1/studio/templates`, {
            method: "GET",
            headers: {
              "Authorization": `Bearer ${actualApiKey}`,
              "Content-Type": "application/json",
            },
          });
    
          if (!response.ok) {
            throw new Error(`HTTP error! status: ${response.status}`);
          }
    
          const studioTemplates = await response.json();
          const templatesArray = Array.isArray(studioTemplates) ? studioTemplates : [];
    
          if (templatesArray.length === 0) {
            return {
              content: [
                {
                  type: "text",
                  text: "No studio templates found for your account. You may need to create templates in Orshot Studio first.",
                },
              ],
            };
          }
    
          const templateList = templatesArray.map((template: any, index: number) => {
            const modifications = template.modifications || [];
            const modificationsList = modifications.length > 0 
              ? modifications.map((mod: any) => `    - ${mod.key || mod.id}: ${mod.helpText || 'No description'} ${mod.example ? `(e.g., "${mod.example}")` : ''}`).join('\n')
              : '    - No modifications available';
    
            const dimensions = template.canvas_width && template.canvas_height 
              ? `${template.canvas_width}Ɨ${template.canvas_height}px` 
              : 'Unknown';
    
            return `${index + 1}. **${template.name || 'Untitled'}**
       ID: ${template.id}
       Description: ${template.description || 'No description'}
       Dimensions: ${dimensions}
       ${template.created_at ? `Created: ${new Date(template.created_at).toLocaleDateString()}` : ''}
       ${template.updated_at ? `Updated: ${new Date(template.updated_at).toLocaleDateString()}` : ''}
       ${template.thumbnail_url ? `Thumbnail: ${template.thumbnail_url}` : ''}
       Available Modifications:
    ${modificationsList}`;
          }).join('\n\n');
    
          return {
            content: [
              {
                type: "text",
                text: `Found ${templatesArray.length} studio template(s):\n\n${templateList}
    
    šŸ’” **Tip**: You can now use either the template ID (${templatesArray[0]?.id}) or name ("${templatesArray[0]?.name}") when generating images!`,
              },
            ],
          };
    
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Failed to fetch studio templates: ${error instanceof Error ? error.message : 'Unknown error'}`,
              },
            ],
          };
        }
      }
    );
  • Input schema for the tool using Zod: optional apiKey string.
      apiKey: z.string().optional().describe("Orshot API key for authentication (optional if set in environment)"),
    },
    async (args) => {
  • Handler function that fetches studio templates from Orshot API (/v1/studio/templates), processes the list, formats a detailed markdown list with template details (ID, name, description, dimensions, created/updated dates, thumbnail, modifications), handles API key validation, errors, and empty results.
        const { apiKey } = args;
        const actualApiKey = apiKey || DEFAULT_API_KEY;
        
        if (!actualApiKey) {
          return {
            content: [
              {
                type: "text",
                text: "No API key provided. Please provide an API key parameter or set ORSHOT_API_KEY environment variable.",
              },
            ],
          };
        }
    
        try {
          const response = await fetch(`${ORSHOT_API_BASE}/v1/studio/templates`, {
            method: "GET",
            headers: {
              "Authorization": `Bearer ${actualApiKey}`,
              "Content-Type": "application/json",
            },
          });
    
          if (!response.ok) {
            throw new Error(`HTTP error! status: ${response.status}`);
          }
    
          const studioTemplates = await response.json();
          const templatesArray = Array.isArray(studioTemplates) ? studioTemplates : [];
    
          if (templatesArray.length === 0) {
            return {
              content: [
                {
                  type: "text",
                  text: "No studio templates found for your account. You may need to create templates in Orshot Studio first.",
                },
              ],
            };
          }
    
          const templateList = templatesArray.map((template: any, index: number) => {
            const modifications = template.modifications || [];
            const modificationsList = modifications.length > 0 
              ? modifications.map((mod: any) => `    - ${mod.key || mod.id}: ${mod.helpText || 'No description'} ${mod.example ? `(e.g., "${mod.example}")` : ''}`).join('\n')
              : '    - No modifications available';
    
            const dimensions = template.canvas_width && template.canvas_height 
              ? `${template.canvas_width}Ɨ${template.canvas_height}px` 
              : 'Unknown';
    
            return `${index + 1}. **${template.name || 'Untitled'}**
       ID: ${template.id}
       Description: ${template.description || 'No description'}
       Dimensions: ${dimensions}
       ${template.created_at ? `Created: ${new Date(template.created_at).toLocaleDateString()}` : ''}
       ${template.updated_at ? `Updated: ${new Date(template.updated_at).toLocaleDateString()}` : ''}
       ${template.thumbnail_url ? `Thumbnail: ${template.thumbnail_url}` : ''}
       Available Modifications:
    ${modificationsList}`;
          }).join('\n\n');
    
          return {
            content: [
              {
                type: "text",
                text: `Found ${templatesArray.length} studio template(s):\n\n${templateList}
    
    šŸ’” **Tip**: You can now use either the template ID (${templatesArray[0]?.id}) or name ("${templatesArray[0]?.name}") when generating images!`,
              },
            ],
          };
    
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Failed to fetch studio templates: ${error instanceof Error ? error.message : 'Unknown error'}`,
              },
            ],
          };
        }
      }
    );
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It mentions authentication via API key but doesn't disclose whether this is a read-only operation, what format the templates are returned in, if there are rate limits, or if it requires specific permissions. The description is functional but lacks important operational context.

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 a single, efficient sentence that states the core purpose without unnecessary words. It's appropriately sized for a simple retrieval tool, though it could be slightly more front-loaded by mentioning the resource first (e.g., 'Retrieve all available studio templates...').

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?

For a simple retrieval tool with one optional parameter and no output schema, the description is minimally adequate. However, it lacks context about what 'studio templates' are, how they differ from library templates, and what the return structure looks like. With no annotations and no output schema, more completeness would be helpful for agent understanding.

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?

Schema description coverage is 100%, so the schema already fully documents the single optional 'apiKey' parameter. The description adds no additional parameter semantics beyond what's in the schema (e.g., no clarification on authentication precedence or format requirements). Baseline 3 is appropriate when schema does the heavy lifting.

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 verb 'Get' and the resource 'all available studio templates', specifying the scope is for 'the user using their API key'. It distinguishes from siblings like 'get-library-templates' by focusing on studio templates, but doesn't explicitly contrast with other studio-related tools like 'generate-image-from-studio'.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when to choose this over 'get-library-templates' for library templates, or when to use it before 'generate-image-from-studio' for generating images from studio templates. No exclusions or prerequisites are stated.

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/rishimohan/orshot-mcp-server'

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