figmanage 1.2.9 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/README.md +10 -8
  2. package/dist/cli/analytics.js +3 -2
  3. package/dist/cli/branching.js +9 -3
  4. package/dist/cli/comments.js +10 -4
  5. package/dist/cli/components.js +21 -4
  6. package/dist/cli/compound-commands.js +13 -12
  7. package/dist/cli/export.js +3 -2
  8. package/dist/cli/files.js +14 -8
  9. package/dist/cli/helpers.d.ts +1 -0
  10. package/dist/cli/helpers.js +10 -0
  11. package/dist/cli/libraries.js +2 -1
  12. package/dist/cli/navigate.js +11 -10
  13. package/dist/cli/org.js +13 -12
  14. package/dist/cli/permissions.js +13 -7
  15. package/dist/cli/projects.js +12 -6
  16. package/dist/cli/reading.js +3 -2
  17. package/dist/cli/teams.js +9 -3
  18. package/dist/cli/variables.js +29 -7
  19. package/dist/cli/versions.js +3 -2
  20. package/dist/cli/webhooks.js +14 -4
  21. package/dist/helpers.d.ts +11 -0
  22. package/dist/helpers.js +41 -0
  23. package/dist/mcp.js +18 -6
  24. package/dist/operations/analytics.js +1 -1
  25. package/dist/operations/components.d.ts +8 -2
  26. package/dist/operations/components.js +4 -2
  27. package/dist/operations/compound-manager.js +8 -9
  28. package/dist/operations/compound.d.ts +3 -0
  29. package/dist/operations/compound.js +14 -8
  30. package/dist/operations/files.js +1 -1
  31. package/dist/operations/libraries.js +1 -1
  32. package/dist/operations/org.js +1 -1
  33. package/dist/operations/reading.js +2 -0
  34. package/dist/operations/teams.js +1 -1
  35. package/dist/operations/variables.js +11 -0
  36. package/dist/operations/webhooks.d.ts +4 -1
  37. package/dist/operations/webhooks.js +2 -1
  38. package/dist/tools/analytics.js +6 -5
  39. package/dist/tools/branching.js +7 -6
  40. package/dist/tools/comments.js +14 -9
  41. package/dist/tools/components.js +24 -15
  42. package/dist/tools/compound-manager.js +10 -7
  43. package/dist/tools/compound.js +34 -22
  44. package/dist/tools/export.js +6 -5
  45. package/dist/tools/files.js +13 -12
  46. package/dist/tools/libraries.js +6 -3
  47. package/dist/tools/navigate.js +29 -18
  48. package/dist/tools/org.js +25 -24
  49. package/dist/tools/permissions.js +14 -11
  50. package/dist/tools/projects.js +10 -9
  51. package/dist/tools/reading.js +11 -7
  52. package/dist/tools/register.d.ts +8 -2
  53. package/dist/tools/register.js +9 -14
  54. package/dist/tools/setup.d.ts +10 -0
  55. package/dist/tools/setup.js +181 -0
  56. package/dist/tools/teams.js +7 -6
  57. package/dist/tools/variables.js +12 -8
  58. package/dist/tools/versions.js +6 -5
  59. package/dist/tools/webhooks.js +15 -12
  60. package/package.json +1 -1
@@ -1,5 +1,6 @@
1
1
  import { z } from 'zod';
2
- import { defineTool, toolResult, toolError, figmaId } from './register.js';
2
+ import { defineTool, toolResult, toolError, toolSummary, figmaId } from './register.js';
3
+ import { formatApiError } from '../helpers.js';
3
4
  import { listWebhooks, createWebhook, updateWebhook, deleteWebhook, } from '../operations/webhooks.js';
4
5
  const eventTypeEnum = z.enum([
5
6
  'FILE_UPDATE',
@@ -15,17 +16,19 @@ defineTool({
15
16
  auth: 'pat',
16
17
  register(server, config) {
17
18
  server.registerTool('list_webhooks', {
18
- description: 'List webhooks for a team.',
19
+ description: 'List webhook subscriptions for a team. Returns webhook IDs, endpoints, event types, and status.',
19
20
  inputSchema: {
20
21
  team_id: figmaId.describe('Team ID'),
21
22
  },
22
23
  }, async ({ team_id }) => {
23
24
  try {
24
- const webhooks = await listWebhooks(config, { team_id });
25
- return toolResult(JSON.stringify(webhooks, null, 2));
25
+ const result = await listWebhooks(config, { team_id });
26
+ if (result.count === 0)
27
+ return toolResult('No webhooks configured for this team.');
28
+ return toolSummary(`${result.count} webhook(s).`, result, 'Use create_webhook to add, or update_webhook/delete_webhook to manage.');
26
29
  }
27
30
  catch (e) {
28
- return toolError(`Failed to list webhooks: ${e.response?.status || e.message}`);
31
+ return toolError(`Failed to list webhooks: ${formatApiError(e)}`);
29
32
  }
30
33
  });
31
34
  },
@@ -48,10 +51,10 @@ defineTool({
48
51
  }, async ({ team_id, event_type, endpoint, passcode, description }) => {
49
52
  try {
50
53
  const result = await createWebhook(config, { team_id, event_type, endpoint, passcode, description });
51
- return toolResult(JSON.stringify(result, null, 2));
54
+ return toolSummary(`Created webhook ${result.id || 'unknown'} for ${result.event_type || event_type} events.`, result);
52
55
  }
53
56
  catch (e) {
54
- return toolError(`Failed to create webhook: ${e.response?.status || e.message}`);
57
+ return toolError(`Failed to create webhook: ${formatApiError(e)}`);
55
58
  }
56
59
  });
57
60
  },
@@ -63,7 +66,7 @@ defineTool({
63
66
  mutates: true,
64
67
  register(server, config) {
65
68
  server.registerTool('update_webhook', {
66
- description: 'Update a webhook.',
69
+ description: "Update a webhook's endpoint, event type, passcode, description, or status (ACTIVE/PAUSED).",
67
70
  inputSchema: {
68
71
  webhook_id: figmaId.describe('Webhook ID'),
69
72
  event_type: eventTypeEnum.optional().describe('Event type to subscribe to'),
@@ -75,10 +78,10 @@ defineTool({
75
78
  }, async ({ webhook_id, event_type, endpoint, passcode, description, status }) => {
76
79
  try {
77
80
  const result = await updateWebhook(config, { webhook_id, event_type, endpoint, passcode, description, status });
78
- return toolResult(JSON.stringify(result, null, 2));
81
+ return toolSummary(`Updated webhook ${result.id || webhook_id}.`, result);
79
82
  }
80
83
  catch (e) {
81
- return toolError(`Failed to update webhook: ${e.response?.status || e.message}`);
84
+ return toolError(`Failed to update webhook: ${formatApiError(e)}`);
82
85
  }
83
86
  });
84
87
  },
@@ -91,7 +94,7 @@ defineTool({
91
94
  destructive: true,
92
95
  register(server, config) {
93
96
  server.registerTool('delete_webhook', {
94
- description: 'Delete a webhook.',
97
+ description: 'Permanently delete a webhook. The webhook stops receiving events immediately. Cannot be undone.',
95
98
  inputSchema: {
96
99
  webhook_id: figmaId.describe('Webhook ID'),
97
100
  },
@@ -101,7 +104,7 @@ defineTool({
101
104
  return toolResult(`Deleted webhook ${webhook_id}`);
102
105
  }
103
106
  catch (e) {
104
- return toolError(`Failed to delete webhook: ${e.response?.status || e.message}`);
107
+ return toolError(`Failed to delete webhook: ${formatApiError(e)}`);
105
108
  }
106
109
  });
107
110
  },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "figmanage",
3
3
  "mcpName": "io.github.dannykeane/figmanage",
4
- "version": "1.2.9",
4
+ "version": "1.3.1",
5
5
  "description": "MCP server for managing your Figma workspace from the terminal.",
6
6
  "type": "module",
7
7
  "main": "dist/index.js",