Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
df34285
test: add mock data files for templates endpoint
JanKulhavy Apr 16, 2026
48602c5
feat: add Templates endpoint class and unit tests
JanKulhavy Apr 16, 2026
fe24fea
feat: wire Templates endpoint into Make client and exports
JanKulhavy Apr 16, 2026
c2861c5
style: align listPublic with codebase conventions
JanKulhavy Apr 16, 2026
62af959
feat: add MCP tool definitions for templates endpoint
JanKulhavy Apr 18, 2026
21ca17a
test: add integration tests for templates endpoint
JanKulhavy Apr 18, 2026
b237c0b
chore: format templates files and fix conditional expects
JanKulhavy Apr 18, 2026
4d9ce92
feat: add getPublic and getPublicBlueprint methods for templates
JanKulhavy Apr 18, 2026
4d853ca
refactor(templates): drop private templates, keep public only
JanKulhavy Apr 18, 2026
9a6c6a7
chore(scripts): add usedApps filter to templates smoke test
JanKulhavy Apr 18, 2026
b672277
remove: file
JanKulhavy Apr 18, 2026
b7161bb
feat(templates): update template names and enhance documentation for …
JanKulhavy Apr 18, 2026
ab9c170
feat(templates): rename templates to public-templates and update rela…
JanKulhavy Apr 18, 2026
b2d609b
Merge branch 'main' into feat/templates
JanKulhavy Apr 18, 2026
d333930
Update src/endpoints/public-templates.mcp.ts
JanKulhavy Apr 18, 2026
c710f30
Merge remote-tracking branch 'origin/main' into feat/templates
JanKulhavy Apr 24, 2026
d9e6142
Update test/public-templates.integration.test.ts
patriksimek Apr 25, 2026
87d394e
refactor: rename templates to publicTemplates for consistency
patriksimek Apr 25, 2026
82fe4fb
refactor: rename templates to publicTemplates for consistency
patriksimek Apr 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ const make = new Make('your-api-key', 'eu2.make.com', {
- **Organizations** - Top-level account and billing management
- **Scenarios** - Scenario management
- **Teams** - Team management and collaboration
- **Public Templates** - Public template discovery and blueprint export (read-only)
- **Users** - Current user information and authentication

## Custom Apps Development Endpoints
Expand Down Expand Up @@ -205,6 +206,7 @@ All tools are organized into the following categories:
- `organizations`
- `scenarios`
- `teams`
- `public-templates`
- `users`
- `sdk.apps`
- `sdk.connections`
Expand Down
92 changes: 92 additions & 0 deletions src/endpoints/public-templates.tools.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
import type { Make } from '../make.js';

export const tools = [
{
name: 'public-templates_list',
title: 'List public templates',
description:
'Search and list public (approved) templates available for anyone. Supports name-based search for template discovery. Results are sorted by usage by default.',
category: 'public-templates',
scope: 'templates:read',
annotations: {
readOnlyHint: true,
},
inputSchema: {
type: 'object',
properties: {
name: { type: 'string', description: 'Search public templates by name' },
usedApps: {
type: 'array',
items: { type: 'string' },
description: 'Filter public templates by apps used',
},
includeEn: {
type: 'boolean',
description: 'Whether to include English-language public templates in results',
},
},
},
examples: [{ name: 'webhook' }],
execute: async (make: Make, args?: { name?: string; usedApps?: string[]; includeEn?: boolean }) => {
return await make.publicTemplates.list({ ...(args ?? {}), cols: ['*'] });
},
},
{
name: 'public-templates_get',
title: 'Get public template',
description:
'Get details of a public template by its URL slug (e.g. "12289-add-webhook-data-to-a-google-sheet"). Use this for templates discovered via public-templates_list.',
category: 'public-templates',
scope: 'templates:read',
scopeId: 'templateUrl',
identifier: 'templateUrl',
resourceId: 'templateUrl',
annotations: {
readOnlyHint: true,
},
inputSchema: {
type: 'object',
properties: {
templateUrl: {
type: 'string',
description:
'The URL slug of the public template (e.g. "12289-add-webhook-data-to-a-google-sheet")',
},
},
required: ['templateUrl'],
},
examples: [{ templateUrl: '12289-add-webhook-data-to-a-google-sheet' }],
execute: async (make: Make, args: { templateUrl: string }) => {
return await make.publicTemplates.get(args.templateUrl, { cols: ['*'] });
},
},
{
name: 'public-templates_get-blueprint',
title: 'Get public template blueprint',
description:
'Get the full blueprint of a public template including scenario flow, controller configuration, scheduling, and metadata. Use this for templates discovered via public-templates_list.',
category: 'public-templates',
scope: 'templates:read',
scopeId: 'templateUrl',
identifier: 'templateUrl',
resourceId: 'templateUrl',
annotations: {
readOnlyHint: true,
},
inputSchema: {
type: 'object',
properties: {
templateUrl: {
type: 'string',
description:
'The URL slug of the public template (e.g. "12289-add-webhook-data-to-a-google-sheet")',
},
},
required: ['templateUrl'],
},
examples: [{ templateUrl: '12289-add-webhook-data-to-a-google-sheet' }],
execute: async (make: Make, args: { templateUrl: string }) => {
return await make.publicTemplates.getBlueprint(args.templateUrl);
},
},
];
180 changes: 180 additions & 0 deletions src/endpoints/public-templates.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
import type { FetchFunction, Pagination, PickColumns } from '../types.js';
import type { Blueprint } from './blueprints.js';
import type { Scheduling } from './scenarios.js';

/**
* Represents a publicly available approved template in Make.
* Public templates can be discovered and used by all Make users.
*/
export type PublicTemplate = {
/** Unique identifier of the public template */
id: number;
/** Name of the public template */
name: string;
/** Human-readable description of what the public template does, or null if not set */
description: string | null;
/** URL slug identifying this public template */
url: string;
/** List of app identifiers used in the public template */
usedApps: string[];
/** Number of times this public template has been used */
usage: number;
};

/**
* Blueprint payload returned by the public-template blueprint endpoint.
* Wraps the scenario blueprint together with its scheduling and controller configuration.
*/
export type PublicTemplateBlueprint = {
/** The scenario blueprint definition (modules, flow, metadata). Scheduling is exposed at the top level of this payload instead. */
blueprint: Omit<Blueprint, 'scheduling' | 'interface'>;
/** Controller configuration for the scenario */
controller: {
/** Controller name */
name: string;
/** Controller-tracked module state, keyed by module ID */
modules: Record<string, unknown>;
/** Next ID to assign when adding a module */
idSequence: number;
};
/** Scheduling configuration for the scenario */
scheduling: Scheduling;
/** Language code for the public template (e.g. "en") */
language: string;
/** Additional metadata for the public template, or null if not set */
metadata: Record<string, unknown> | null;
};

/**
* Options for listing public (approved) templates.
* @template C Keys of the PublicTemplate type to include in the response
*/
export type ListPublicTemplatesOptions<C extends keyof PublicTemplate = never> = {
/** Specific columns/fields to include in the response */
cols?: C[] | ['*'];
/** Pagination options */
pg?: Partial<Pagination<PublicTemplate>>;
/** Search public templates by name */
name?: string;
/** Filter public templates by apps used */
usedApps?: string[];
/** Whether to include English-language public templates in results */
includeEn?: boolean;
};

/**
* Options for getting a single public template.
* @template C Keys of the PublicTemplate type to include in the response
*/
export type GetPublicTemplateOptions<C extends keyof PublicTemplate = never> = {
/** Specific columns/fields to include in the response */
cols?: C[] | ['*'];
};

/**
* Response format for listing public templates.
*/
type ListPublicTemplatesResponse<C extends keyof PublicTemplate = never> = {
/** List of public templates matching the query */
templatesPublic: PickColumns<PublicTemplate, C>[];
/** Pagination information */
pg: Pagination<PublicTemplate>;
};

/**
* Response format for getting a single public template.
*/
type GetPublicTemplateResponse<C extends keyof PublicTemplate = never> = {
/** The requested public template */
templatePublic: PickColumns<PublicTemplate, C>;
};

/**
* Class providing methods for working with public Make templates.
* Public templates are approved scenario configurations that can be
* discovered and used by any Make user.
*/
export class PublicTemplates {
readonly #fetch: FetchFunction;

/**
* Create a new PublicTemplates instance.
* @param fetch Function for making API requests
*/
constructor(fetch: FetchFunction) {
this.#fetch = fetch;
}

/**
* List public (approved) templates available for anyone.
* Supports name-based search for template discovery.
* Results are sorted by usage in descending order by default.
* @param options Optional parameters for searching, filtering, and pagination
* @returns Promise with the list of public templates
*
* @example
* ```typescript
* // Search public templates by name
* const templates = await make.publicTemplates.list({ name: 'webhook' });
*
* // Filter by apps used
* const gmailTemplates = await make.publicTemplates.list({ usedApps: ['gmail'] });
* ```
*/
async list<C extends keyof PublicTemplate = never>(
options: ListPublicTemplatesOptions<C> = {},
): Promise<PickColumns<PublicTemplate, C>[]> {
return (
await this.#fetch<ListPublicTemplatesResponse<C>>('/templates/public', {
query: {
name: options.name,
usedApps: options.usedApps,
includeEn: options.includeEn,
cols: options.cols,
pg: options.pg,
},
})
).templatesPublic;
}

/**
* Get a single public template by its URL slug.
* Use this for templates discovered via {@link list}.
* @param templateUrl The URL slug of the template (e.g. "12289-add-webhook-data-to-a-google-sheet")
* @param options Optional parameters for field selection
* @returns Promise with the public template details
*
* @example
* ```typescript
* const template = await make.publicTemplates.get('12289-add-webhook-data-to-a-google-sheet');
* ```
*/
async get<C extends keyof PublicTemplate = never>(
templateUrl: string,
options: GetPublicTemplateOptions<C> = {},
): Promise<PickColumns<PublicTemplate, C>> {
return (
await this.#fetch<GetPublicTemplateResponse<C>>(`/templates/public/${templateUrl}`, {
query: {
cols: options.cols,
},
})
).templatePublic;
}

/**
* Get the blueprint (scenario definition) for a public template by its URL slug.
* The full response object is returned directly since the API returns a flat
* structure rather than wrapping the blueprint in a named property.
* @param templateUrl The URL slug of the template (e.g. "12289-add-webhook-data-to-a-google-sheet")
* @returns Promise with the full blueprint response
*
* @example
* ```typescript
* const blueprint = await make.publicTemplates.getBlueprint('12289-add-webhook-data-to-a-google-sheet');
* ```
*/
async getBlueprint(templateUrl: string): Promise<PublicTemplateBlueprint> {
return await this.#fetch<PublicTemplateBlueprint>(`/templates/public/${templateUrl}/blueprint`);
}
}
7 changes: 7 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,11 @@ export type {
UpdateSDKWebhookBody,
} from './endpoints/sdk/webhooks.js';
export type { Team, Teams, CreateTeamBody, ListTeamsOptions, GetTeamOptions } from './endpoints/teams.js';
export type {
PublicTemplate,
PublicTemplateBlueprint,
PublicTemplates,
ListPublicTemplatesOptions,
GetPublicTemplateOptions,
} from './endpoints/public-templates.js';
export type { User, Users } from './endpoints/users.js';
8 changes: 8 additions & 0 deletions src/make.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { Devices } from './endpoints/devices.js';
import { Functions } from './endpoints/functions.js';
import { Organizations } from './endpoints/organizations.js';
import { Enums } from './endpoints/enums.js';
import { PublicTemplates } from './endpoints/public-templates.js';
import { SDKApps } from './endpoints/sdk/apps.js';
import { SDKModules } from './endpoints/sdk/modules.js';
import { SDKConnections } from './endpoints/sdk/connections.js';
Expand Down Expand Up @@ -163,6 +164,12 @@ export class Make {
*/
public readonly enums: Enums;

/**
* Access to public template endpoints.
* Public templates are approved, read-only scenario configurations discoverable and usable by any Make user.
*/
public readonly publicTemplates: PublicTemplates;

/**
* Access to SDK-related endpoints
*/
Expand Down Expand Up @@ -248,6 +255,7 @@ export class Make {
this.organizations = new Organizations(this.fetch.bind(this));
this.enums = new Enums(this.fetch.bind(this));
this.credentialRequests = new CredentialRequests(this.fetch.bind(this));
this.publicTemplates = new PublicTemplates(this.fetch.bind(this));
this.sdk = {
apps: new SDKApps(this.fetch.bind(this)),
modules: new SDKModules(this.fetch.bind(this)),
Expand Down
2 changes: 2 additions & 0 deletions src/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { tools as FoldersTools } from './endpoints/folders.tools.js';
import { tools as IncompleteExecutionsTools } from './endpoints/incomplete-executions.tools.js';
import { tools as DataStructuresTools } from './endpoints/data-structures.tools.js';
import { tools as EnumsTools } from './endpoints/enums.tools.js';
import { tools as PublicTemplatesTools } from './endpoints/public-templates.tools.js';

/**
* JSON Schema definition for input parameters.
Expand Down Expand Up @@ -196,4 +197,5 @@ export const MakeTools = [
...OrganizationsTools,
...UsersTools,
...EnumsTools,
...PublicTemplatesTools,
] as MakeTool[];
34 changes: 34 additions & 0 deletions test/mocks/public-templates/blueprint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"blueprint": {
"name": "Http template example",
"flow": [
{
"id": 1,
"module": "http:ActionSendData",
"version": 3,
"parameters": {},
"mapper": {
"url": "https://example.com",
"method": "get"
},
"metadata": {
"expect": []
}
}
],
"metadata": {
"version": 1
}
},
"controller": {
"name": "Http template example",
"modules": {},
Comment thread
JanKulhavy marked this conversation as resolved.
"idSequence": 2
},
"scheduling": {
"type": "indefinitely",
"interval": 900
},
"language": "en",
"metadata": null
}
10 changes: 10 additions & 0 deletions test/mocks/public-templates/get.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"templatePublic": {
"id": 13,
"name": "Http template example",
"description": null,
"url": "13-http-template-example",
"usedApps": ["http"],
"usage": 321
}
}
Loading