transloadit_list_templates
Retrieve and manage Assembly Templates for media processing workflows, including built-in and custom templates with filtering options.
Instructions
List Assembly Templates (owned and/or builtin). Tip: pass include_builtin: "exclusively-latest" to list builtins only.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | ||
| page_size | No | ||
| sort | No | ||
| order | No | ||
| keywords | No | ||
| include_builtin | No | ||
| include_content | No |
Implementation Reference
- Handler function for the transloadit_list_templates tool, which uses the Transloadit API client to list templates.
async ({ page, page_size, sort, order, keywords, include_builtin, include_content }, extra) => { const liveClient = createLiveClient(options, extra) if ('error' in liveClient) { return buildToolResponse({ status: 'error', templates: [], errors: [ { code: 'mcp_missing_auth', message: 'Missing TRANSLOADIT_KEY/TRANSLOADIT_SECRET or Authorization: Bearer token for live API calls.', }, ], }) } try { const response = await liveClient.client.listTemplates({ page, pagesize: page_size, sort, order, keywords, include_builtin, }) const parsed = listTemplatesResponseSchema.safeParse(response) if (!parsed.success) { throw new Error('Unexpected listTemplates response shape.') } const items = parsed.data.items ?? [] const includeContent = include_content ?? false const templates = await Promise.all( items.map(async (item) => { const base = mapTemplateListItem(item) if (!includeContent) return base const steps = await loadTemplateSteps(liveClient.client, item) return steps ? { ...base, steps } : base }), ) return buildToolResponse({ status: 'ok', templates, page, page_size: page_size, total: parsed.data.count ?? items.length, }) } catch (error) { const message = error instanceof Error ? error.message : 'Failed to list templates.' - packages/mcp-server/src/server.ts:1046-1054 (registration)Registration of the transloadit_list_templates tool in the server using registerTool.
server.registerTool( 'transloadit_list_templates', { title: 'List templates', description: 'List Assembly Templates (owned and/or builtin). Tip: pass include_builtin: "exclusively-latest" to list builtins only.', inputSchema: listTemplatesInputSchema, outputSchema: listTemplatesOutputSchema, },