@@ -412,13 +412,11 @@ const extractTemplateSteps = (content: unknown): Record<string, unknown> | undef
412412}
413413
414414const mapBuiltinTemplate = ( template : ApiTemplateRecord ) : BuiltinTemplate | undefined => {
415- const slug = isNonEmptyString ( template . name )
416- ? template . name
417- : isNonEmptyString ( template . id )
418- ? template . id
419- : undefined
415+ const name = isNonEmptyString ( template . name ) ? template . name : undefined
416+ const id = isNonEmptyString ( template . id ) ? template . id : undefined
417+ const slug = name ?. startsWith ( 'builtin/' ) ? name : id ?. startsWith ( 'builtin/' ) ? id : undefined
420418
421- if ( ! slug || ! slug . startsWith ( 'builtin/' ) ) return undefined
419+ if ( ! slug ) return undefined
422420
423421 const steps = extractTemplateSteps ( template . content )
424422 if ( ! steps ) return undefined
@@ -438,6 +436,7 @@ const mapBuiltinTemplate = (template: ApiTemplateRecord): BuiltinTemplate | unde
438436}
439437
440438const fetchBuiltinTemplates = async ( client : Transloadit ) : Promise < BuiltinTemplate [ ] > => {
439+ // NOTE: Builtin templates are curated; we intentionally fetch the first page only for now.
441440 const response = await client . listTemplates ( {
442441 include_builtin : 'exclusively-latest' ,
443442 page : 1 ,
@@ -478,6 +477,7 @@ export const createTransloaditMcpServer = (
478477 version : options . serverVersion ?? packageJson . version ,
479478 } )
480479
480+ // Builtin templates supersede the old golden template tool; no legacy alias by design.
481481 server . registerTool (
482482 'transloadit_lint_assembly_instructions' ,
483483 {
@@ -835,3 +835,8 @@ export const createTransloaditMcpServer = (
835835
836836 return server
837837}
838+
839+ // Expose tiny internals for unit tests only.
840+ export const __test__ = {
841+ mapBuiltinTemplate,
842+ }
0 commit comments