2manytabs-mcp-host 2.1.0 → 3.1.0

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.
@@ -1,11 +1,12 @@
1
1
  import { z } from 'zod';
2
2
  import { callExtension } from '../bridge.js';
3
+ import { GROUP_TITLE_DESCRIBE, groupTitleNote } from '../lib/tabs.js';
3
4
 
4
5
  export const updateTabGroupTool = {
5
6
  name: 'update_tab_group',
6
7
  title: 'Update Tab Group',
7
8
  description:
8
- 'Update properties of an existing native Chrome Tab Group, including ' +
9
+ 'Update properties of an existing native browser tab group, including ' +
9
10
  'its title, color, or collapsed/expanded state.',
10
11
  annotations: {
11
12
  readOnlyHint: false,
@@ -14,21 +15,24 @@ export const updateTabGroupTool = {
14
15
  openWorldHint: true,
15
16
  },
16
17
  inputSchema: {
17
- group_id: z.number().int()
18
- .describe('The numeric ID of the tab group to update (obtained from list_tab_groups or list_tabs).'),
18
+ group_id: z.union([z.number().int(), z.string()])
19
+ .describe('The ID (number or composite like "chrome:5") of the tab group to update (obtained from list_tab_groups or list_tabs).'),
19
20
  title: z.string().optional()
20
- .describe('New title for the group.'),
21
+ .describe(GROUP_TITLE_DESCRIBE),
21
22
  color: z.enum(['grey', 'blue', 'red', 'yellow', 'green', 'pink', 'purple', 'cyan', 'orange']).optional()
22
23
  .describe('New color for the group.'),
23
24
  collapsed: z.boolean().optional()
24
25
  .describe('Whether the group should be collapsed (true) or expanded (false).'),
26
+ browser: z.string().optional()
27
+ .describe('Optional browser hint ("chrome", "firefox") if ids are numeric.'),
25
28
  },
26
29
 
27
- execute: async ({ group_id, title, color, collapsed }) => {
28
- const res = await callExtension('update_group', { group_id, title, color, collapsed });
30
+ execute: async ({ group_id, title, color, collapsed, browser }) => {
31
+ const res = await callExtension('update_group', { group_id, title, color, collapsed, browser });
29
32
  return JSON.stringify({
30
33
  message: `Successfully updated tab group ${group_id}.`,
31
34
  groupId: res.updated,
35
+ title_note: groupTitleNote(title),
32
36
  }, null, 2);
33
37
  },
34
38
  };
@@ -14,18 +14,20 @@ export const updateTabTool = {
14
14
  openWorldHint: true,
15
15
  },
16
16
  inputSchema: {
17
- tab_id: z.number().int()
18
- .describe('The numeric ID of the tab to update.'),
17
+ tab_id: z.union([z.number().int(), z.string()])
18
+ .describe('The numeric ID (or composite like "chrome:123") of the tab to update.'),
19
19
  url: z.string().optional()
20
20
  .describe('A new URL to navigate the tab to. If no protocol is provided, https:// will be prepended.'),
21
21
  pinned: z.boolean().optional()
22
22
  .describe('Set to true to pin the tab, or false to unpin it.'),
23
23
  muted: z.boolean().optional()
24
24
  .describe('Set to true to mute the tab, or false to unmute it.'),
25
+ browser: z.string().optional()
26
+ .describe('Optional browser hint ("chrome", "firefox") if tab_id is numeric.'),
25
27
  },
26
28
 
27
- execute: async ({ tab_id, url, pinned, muted }) => {
28
- const res = await callExtension('update_tab', { tab_id, url, pinned, muted });
29
+ execute: async ({ tab_id, url, pinned, muted, browser }) => {
30
+ const res = await callExtension('update_tab', { tab_id, url, pinned, muted, browser });
29
31
  return JSON.stringify({
30
32
  message: `Successfully updated tab ${tab_id}.`,
31
33
  tabId: res.updated,