Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ All tools are organized into the following categories:
- `hooks`
- `incomplete-executions`
- `keys`
- `labels`
- `scenario-labels`
- `on-prem-agent`
- `organizations`
- `private-spaces`
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@makehq/sdk",
"version": "1.6.11",
"version": "1.6.12",
"description": "Make TypeScript SDK",
"license": "MIT",
"author": "Make",
Expand Down
24 changes: 12 additions & 12 deletions src/endpoints/scenario-labels.tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ const LABEL_COLOURS: ScenarioLabelColour[] = [

export const tools: MakeTool[] = [
{
name: 'labels_list',
name: 'scenario-labels_list',
title: 'List scenario labels',
description:
"List a team's scenario label catalog, including how many scenarios carry each label. Scenario labels are team-scoped tags that can be assigned to scenarios, independent of folders. If you do not know the teamId, find it via organizations_list (each organization lists its teams) or teams_list, or ask the user — never guess IDs.",
category: 'labels',
category: 'scenario-labels',
scope: 'scenarios:read',
scopeId: 'teamId',
identifier: 'teamId',
Expand All @@ -41,11 +41,11 @@ export const tools: MakeTool[] = [
},
},
{
name: 'labels_create',
name: 'scenario-labels_create',
title: 'Create scenario label',
description:
'Create a new scenario label in a team. Labels are team-scoped tags that can be assigned to scenarios. If you do not know the teamId, call users_me to learn it.',
category: 'labels',
category: 'scenario-labels',
scope: 'scenarios:write',
scopeId: 'teamId',
identifier: 'teamId',
Expand Down Expand Up @@ -78,11 +78,11 @@ export const tools: MakeTool[] = [
},
},
{
name: 'labels_update',
name: 'scenario-labels_update',
title: 'Update scenario label',
description:
'Update the name, colour, or description of an existing scenario label. Provide at least one property to change; omitted properties are left unchanged. Changes are reflected on every scenario carrying the label.',
category: 'labels',
category: 'scenario-labels',
scope: 'scenarios:write',
scopeId: 'labelId',
identifier: 'labelId',
Expand Down Expand Up @@ -122,11 +122,11 @@ export const tools: MakeTool[] = [
},
},
{
name: 'labels_delete',
name: 'scenario-labels_delete',
title: 'Delete scenario label',
description:
'Delete a scenario label. The label is removed from the team catalog and unassigned from every scenario carrying it. This cannot be undone.',
category: 'labels',
category: 'scenario-labels',
scope: 'scenarios:write',
scopeId: 'labelId',
identifier: 'labelId',
Expand All @@ -150,11 +150,11 @@ export const tools: MakeTool[] = [
},
},
{
name: 'labels_assign',
name: 'scenario-labels_assign',
title: 'Assign scenario label',
description:
'Assign a scenario label to a scenario. The label and the scenario must belong to the same team. Assigning an already-assigned label succeeds without changes. To label many scenarios, call this tool once per scenario.',
category: 'labels',
category: 'scenario-labels',
scope: 'scenarios:write',
scopeId: 'labelId',
identifier: 'labelId',
Expand All @@ -180,11 +180,11 @@ export const tools: MakeTool[] = [
},
},
{
name: 'labels_unassign',
name: 'scenario-labels_unassign',
title: 'Unassign scenario label',
description:
'Remove a scenario label from a scenario. Removing an already-absent assignment succeeds without changes. The label itself stays in the team catalog.',
category: 'labels',
category: 'scenario-labels',
scope: 'scenarios:write',
scopeId: 'labelId',
identifier: 'labelId',
Expand Down
2 changes: 1 addition & 1 deletion src/endpoints/scenarios.tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export const tools: MakeTool[] = [
type: 'array',
items: { type: 'number' },
description:
'Only return scenarios carrying at least one of these scenario label IDs. Use labels_list to discover label IDs.',
'Only return scenarios carrying at least one of these scenario label IDs. Use scenario-labels_list to discover label IDs.',
},
},
required: ['teamId'],
Expand Down
40 changes: 20 additions & 20 deletions test/scenario-labels-tools.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,75 +23,75 @@ function getTool(name: string) {
return tool;
}

describe('MCP tools: labels', () => {
describe('MCP tools: scenario-labels', () => {
const make = new Make(MAKE_API_KEY, MAKE_ZONE);

it('Should execute labels_list', async () => {
it('Should execute scenario-labels_list', async () => {
mockFetch(`GET https://make.local/api/v2/scenario-labels?teamId=${TEAM_ID}`, listMock);

const tool = getTool('labels_list');
const tool = getTool('scenario-labels_list');
const result = await tool.execute(make, { teamId: TEAM_ID });

expect(result).toStrictEqual(listMock.labels);
});

it('Should execute labels_create', async () => {
it('Should execute scenario-labels_create', async () => {
mockFetch('POST https://make.local/api/v2/scenario-labels', createMock, req => {
expect(req.body).toStrictEqual({ teamId: TEAM_ID, name: 'critical', colour: 'danger' });
});

const tool = getTool('labels_create');
const tool = getTool('scenario-labels_create');
const result = await tool.execute(make, { teamId: TEAM_ID, name: 'critical', colour: 'danger' });

expect(result).toStrictEqual(createMock.label);
});

it('Should execute labels_update and separate labelId from the body', async () => {
it('Should execute scenario-labels_update and separate labelId from the body', async () => {
mockFetch(`PATCH https://make.local/api/v2/scenario-labels/${LABEL_ID}`, updateMock, req => {
expect(req.body).toStrictEqual({ name: 'high-priority', colour: 'warning' });
});

const tool = getTool('labels_update');
const tool = getTool('scenario-labels_update');
const result = await tool.execute(make, { labelId: LABEL_ID, name: 'high-priority', colour: 'warning' });

expect(result).toStrictEqual(updateMock.label);
});

it('Should execute labels_delete', async () => {
it('Should execute scenario-labels_delete', async () => {
mockFetch(`DELETE https://make.local/api/v2/scenario-labels/${LABEL_ID}`, deleteMock);

const tool = getTool('labels_delete');
const tool = getTool('scenario-labels_delete');
const result = await tool.execute(make, { labelId: LABEL_ID });

expect(result).toBe('Label has been deleted.');
});

it('Should execute labels_assign', async () => {
it('Should execute scenario-labels_assign', async () => {
mockFetch(
`POST https://make.local/api/v2/scenario-labels/${LABEL_ID}/scenarios/${SCENARIO_ID}`,
assignMock,
);

const tool = getTool('labels_assign');
const tool = getTool('scenario-labels_assign');
const result = await tool.execute(make, { labelId: LABEL_ID, scenarioId: SCENARIO_ID });

expect(result).toBe('Label has been assigned to the scenario.');
});

it('Should execute labels_unassign', async () => {
it('Should execute scenario-labels_unassign', async () => {
mockFetch(
`DELETE https://make.local/api/v2/scenario-labels/${LABEL_ID}/scenarios/${SCENARIO_ID}`,
assignMock,
);

const tool = getTool('labels_unassign');
const tool = getTool('scenario-labels_unassign');
const result = await tool.execute(make, { labelId: LABEL_ID, scenarioId: SCENARIO_ID });

expect(result).toBe('Label has been removed from the scenario.');
});

it('Should declare the assignment tools as idempotent scenarios:write tools targeting the scenario', () => {
for (const name of ['labels_assign', 'labels_unassign']) {
for (const name of ['scenario-labels_assign', 'scenario-labels_unassign']) {
const tool = getTool(name);
expect(tool.scope).toBe('scenarios:write');
expect(tool.scopeId).toBe('labelId');
Expand All @@ -101,29 +101,29 @@ describe('MCP tools: labels', () => {
}
});

it('Should declare labels_list as a read-only scenarios:read tool scoped by teamId', () => {
const tool = getTool('labels_list');
it('Should declare scenario-labels_list as a read-only scenarios:read tool scoped by teamId', () => {
const tool = getTool('scenario-labels_list');

expect(tool.category).toBe('labels');
expect(tool.category).toBe('scenario-labels');
expect(tool.scope).toBe('scenarios:read');
expect(tool.scopeId).toBe('teamId');
expect(tool.inputSchema.required).toStrictEqual(['teamId']);
expect(tool.annotations?.readOnlyHint).toBe(true);
});

it('Should declare the label mutation tools as scenarios:write with correct scoping', () => {
const create = getTool('labels_create');
const create = getTool('scenario-labels_create');
expect(create.scope).toBe('scenarios:write');
expect(create.scopeId).toBe('teamId');
expect(create.inputSchema.required).toStrictEqual(['teamId', 'name', 'colour']);

const update = getTool('labels_update');
const update = getTool('scenario-labels_update');
expect(update.scope).toBe('scenarios:write');
expect(update.scopeId).toBe('labelId');
expect(update.resourceId).toBe('labelId');
expect(update.inputSchema.required).toStrictEqual(['labelId']);

const del = getTool('labels_delete');
const del = getTool('scenario-labels_delete');
expect(del.scope).toBe('scenarios:write');
expect(del.scopeId).toBe('labelId');
expect(del.resourceId).toBe('labelId');
Expand Down