@mondaydotcomorg/agent-toolkit 4.0.0 → 4.0.2

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.
@@ -1299,7 +1299,34 @@ import e from"util";import a,{Readable as t}from"stream";import i from"path";imp
1299
1299
  }
1300
1300
  }
1301
1301
  }
1302
- `;async function SE(e){const a=await e.request(IE);return a.me?.account?.slug??null}function NE(e,a){return`https://${e}.monday.com/workspaces/${a}`}const AE={userIds:g.array(g.string()).max(xE).optional().describe("Specific user IDs to fetch.[IMPORTANT] ALWAYS use when you have user IDs in context. PREFER over general search. RETURNS: user profiles including team memberships"),teamIds:g.array(g.string()).max(TE).optional().describe("Specific team IDs to fetch.[IMPORTANT] ALWAYS use when you have team IDs in context, NEVER fetch all teams if specific IDs are available.\n RETURNS: Team details with owners and optional member data."),name:g.string().optional().describe("Name-based USER search ONLY. STANDALONE parameter - cannot be combined with others. PREFERRED method for finding users when you know names. Performs fuzzy matching.\n CRITICAL: This parameter searches for USERS ONLY, NOT teams. To search for teams, use teamIds parameter instead."),getMe:g.boolean().optional().describe('[TOP PRIORITY] Use ALWAYS when requesting current user information. Examples of when it should be used: ["get my user" or "get my teams"].\n This parameter CONFLICTS with all others. '),includeTeams:g.boolean().optional().describe("[AVOID] This fetches all teams in the account. To fetch a specific user's teams just fetch that user by id and you will get their team memberships."),teamsOnly:g.boolean().optional().describe("Fetch only teams, no users returned. Combine with includeTeamMembers for member details."),includeTeamMembers:g.boolean().optional().describe("Set to true only when you need additional member details for teams other than names and ids.")};const DE={itemId:g.number().describe("The id of the item to which the update will be added"),groupId:g.string().describe("The id of the group to which the item will be moved")};const OE={type:g.enum(["ids","object_ids","workspace_ids"]).describe("Query type of ids parameter that is used query by: ids, object_ids, or workspace_ids"),ids:g.array(g.string()).min(1).describe("Array of ID values for this query type (at least 1 required)"),limit:g.number().optional().describe("Number of docs per page (default: 25). Affects pagination - if you get exactly this many results, there may be more pages."),order_by:g.nativeEnum(fb).optional().describe("The order in which to retrieve your docs. The default shows created_at with the newest docs listed first. This argument will not be applied if you query docs by specific ids."),page:g.number().optional().describe("The page number to return (starts at 1). Use this to paginate through large result sets. Check response for has_more_pages indicator.")};const kE={workspace_id:g.number().describe("The ID of the workspace to get information for")};const RE=ow`
1302
+ `;async function SE(e){const a=await e.request(IE);return a.me?.account?.slug??null}function NE(e,a){return`https://${e}.monday.com/workspaces/${a}`}const AE={userIds:g.array(g.string()).max(xE).optional().describe("Specific user IDs to fetch.[IMPORTANT] ALWAYS use when you have user IDs in context. PREFER over general search. RETURNS: user profiles including team memberships"),teamIds:g.array(g.string()).max(TE).optional().describe("Specific team IDs to fetch.[IMPORTANT] ALWAYS use when you have team IDs in context, NEVER fetch all teams if specific IDs are available.\n RETURNS: Team details with owners and optional member data."),name:g.string().optional().describe("Name-based USER search ONLY. STANDALONE parameter - cannot be combined with others. PREFERRED method for finding users when you know names. Performs fuzzy matching.\n CRITICAL: This parameter searches for USERS ONLY, NOT teams. To search for teams, use teamIds parameter instead."),getMe:g.boolean().optional().describe('[TOP PRIORITY] Use ALWAYS when requesting current user information. Examples of when it should be used: ["get my user" or "get my teams"].\n This parameter CONFLICTS with all others. '),includeTeams:g.boolean().optional().describe("[AVOID] This fetches all teams in the account. To fetch a specific user's teams just fetch that user by id and you will get their team memberships."),teamsOnly:g.boolean().optional().describe("Fetch only teams, no users returned. Combine with includeTeamMembers for member details."),includeTeamMembers:g.boolean().optional().describe("Set to true only when you need additional member details for teams other than names and ids.")};const DE={itemId:g.number().describe("The id of the item to which the update will be added"),groupId:g.string().describe("The id of the group to which the item will be moved")};const OE=ow`
1303
+ query GetDocVersionHistory($docId: ID!, $since: String, $until: String) {
1304
+ doc_version_history(doc_id: $docId, since: $since, until: $until) {
1305
+ doc_id
1306
+ restoring_points {
1307
+ date
1308
+ user_ids
1309
+ type
1310
+ }
1311
+ }
1312
+ }
1313
+ `,kE=ow`
1314
+ query GetDocVersionDiff($docId: ID!, $date: String!, $prevDate: String!) {
1315
+ doc_version_diff(doc_id: $docId, date: $date, prev_date: $prevDate) {
1316
+ doc_id
1317
+ blocks {
1318
+ id
1319
+ type
1320
+ summary
1321
+ changes {
1322
+ added
1323
+ deleted
1324
+ changed
1325
+ }
1326
+ }
1327
+ }
1328
+ }
1329
+ `,RE=g.enum(["ids","object_ids","workspace_ids"]),CE={mode:g.enum(["content","version_history"]).optional().default("content").describe('The operation mode. "content" (default) fetches documents with their markdown content. "version_history" fetches the edit history of a single document.'),type:RE.optional().describe('Query type for content mode: "ids", "object_ids", or "workspace_ids". Required when mode is "content".'),ids:g.array(g.string()).optional().describe('Array of ID values matching the query type. Required when mode is "content".'),limit:g.number().optional().describe("Number of docs per page (default: 25). Only used in content mode."),order_by:g.nativeEnum(fb).optional().describe("Order in which to retrieve docs. Only used in content mode."),page:g.number().optional().describe("Page number to return (starts at 1). Only used in content mode."),doc_id:g.string().optional().describe('The document ID to get version history for. This is the id field from content mode (not the object_id). Required when mode is "version_history".'),since:g.string().optional().describe('ISO 8601 date string to filter version history from (e.g., "2026-03-15T00:00:00Z"). Defaults to 24 hours ago. Only used in version_history mode.'),until:g.string().optional().describe('ISO 8601 date string to filter version history until (e.g., "2026-03-16T23:59:59Z"). Defaults to now. Only used in version_history mode.'),include_diff:g.boolean().optional().default(!1).describe("If true, fetches content diffs between consecutive restoring points. May be slower due to additional API calls. Only used in version_history mode.")};const $E={workspace_id:g.number().describe("The ID of the workspace to get information for")};const LE=ow`
1303
1330
  query listWorkspaces($limit: Int!, $page: Int!, $membershipKind: WorkspaceMembershipKind!) {
1304
1331
  workspaces(limit: $limit, page: $page, membership_kind: $membershipKind) {
1305
1332
  id
@@ -1307,7 +1334,7 @@ import e from"util";import a,{Readable as t}from"stream";import i from"path";imp
1307
1334
  description
1308
1335
  }
1309
1336
  }
1310
- `,CE=100,$E=e=>e.toLocaleLowerCase().replace(/[^\p{L}\d]/gu,"");function LE(e){const a=e.workspaces?.filter((e=>null!==e));return a||[]}function FE(e){return Array.isArray(e)&&e.length>0}const PE={searchTerm:g.string().optional().describe("Optional search term used to filter workspaces. [IMPORTANT] Only alphanumeric characters are supported."),limit:g.number().min(1).max(CE).default(CE).describe("Number of workspaces to return. Default is (100), lower for a smaller response size"),page:g.number().min(1).default(1).describe("Page number to return. Default is 1.")};const jE=ow`
1337
+ `,FE=100,PE=e=>e.toLocaleLowerCase().replace(/[^\p{L}\d]/gu,"");function jE(e){const a=e.workspaces?.filter((e=>null!==e));return a||[]}function VE(e){return Array.isArray(e)&&e.length>0}const UE={searchTerm:g.string().optional().describe("Optional search term used to filter workspaces. [IMPORTANT] Only alphanumeric characters are supported."),limit:g.number().min(1).max(FE).default(FE).describe("Number of workspaces to return. Default is (100), lower for a smaller response size"),page:g.number().min(1).default(1).describe("Page number to return. Default is 1.")};const BE=ow`
1311
1338
  query getItemBoard($itemId: ID!) {
1312
1339
  items(ids: [$itemId]) {
1313
1340
  id
@@ -1320,7 +1347,7 @@ import e from"util";import a,{Readable as t}from"stream";import i from"path";imp
1320
1347
  }
1321
1348
  }
1322
1349
  }
1323
- `,VE=ow`
1350
+ `,ME=ow`
1324
1351
  mutation createDoc($location: CreateDocInput!) {
1325
1352
  create_doc(location: $location) {
1326
1353
  id
@@ -1329,7 +1356,7 @@ import e from"util";import a,{Readable as t}from"stream";import i from"path";imp
1329
1356
  name
1330
1357
  }
1331
1358
  }
1332
- `,UE=ow`
1359
+ `,qE=ow`
1333
1360
  mutation addContentToDocFromMarkdown($docId: ID!, $markdown: String!, $afterBlockId: String) {
1334
1361
  add_content_to_doc_from_markdown(docId: $docId, markdown: $markdown, afterBlockId: $afterBlockId) {
1335
1362
  success
@@ -1337,11 +1364,11 @@ import e from"util";import a,{Readable as t}from"stream";import i from"path";imp
1337
1364
  error
1338
1365
  }
1339
1366
  }
1340
- `,BE=ow`
1367
+ `,GE=ow`
1341
1368
  mutation updateDocName($docId: ID!, $name: String!) {
1342
1369
  update_doc_name(docId: $docId, name: $name)
1343
1370
  }
1344
- `,ME=g.enum(["workspace","item"]),qE=g.discriminatedUnion("type",[g.object({type:g.literal(ME.enum.workspace).describe("Create document in workspace"),workspace_id:g.number().describe("Workspace ID under which to create the new document"),doc_kind:g.nativeEnum(Mg).optional().describe("Document kind (public/private/share). Defaults to public."),folder_id:g.number().optional().describe("Optional folder ID to place the document inside a specific folder")}),g.object({type:g.literal(ME.enum.item).describe("Create document attached to item"),item_id:g.number().describe("Item ID to attach the new document to"),column_id:g.string().optional().describe("ID of an existing 'doc' column on the board which contains the item. If not provided, the tool will create a new doc column automatically when creating a doc on an item.")})]),GE={doc_name:g.string().describe("Name for the new document."),markdown:g.string().describe("Markdown content that will be imported into the newly created document as blocks."),location:g.enum(["workspace","item"]).describe("Location where the document should be created - either in a workspace or attached to an item"),workspace_id:g.number().optional().describe('[REQUIRED - use only when location="workspace"] Workspace ID under which to create the new document'),doc_kind:g.nativeEnum(Mg).optional().describe('[OPTIONAL - use only when location="workspace"] Document kind (public/private/share). Defaults to public.'),folder_id:g.number().optional().describe('[OPTIONAL - use only when location="workspace"] Optional folder ID to place the document inside a specific folder'),item_id:g.number().optional().describe('[REQUIRED - use only when location="item"] Item ID to attach the new document to'),column_id:g.string().optional().describe('[OPTIONAL - use only when location="item"] ID of an existing "doc" column on the board which contains the item. If not provided, the tool will create a new doc column automatically when creating a doc on an item.')};const HE=ow`
1371
+ `,HE=g.enum(["workspace","item"]),zE=g.discriminatedUnion("type",[g.object({type:g.literal(HE.enum.workspace).describe("Create document in workspace"),workspace_id:g.number().describe("Workspace ID under which to create the new document"),doc_kind:g.nativeEnum(Mg).optional().describe("Document kind (public/private/share). Defaults to public."),folder_id:g.number().optional().describe("Optional folder ID to place the document inside a specific folder")}),g.object({type:g.literal(HE.enum.item).describe("Create document attached to item"),item_id:g.number().describe("Item ID to attach the new document to"),column_id:g.string().optional().describe("ID of an existing 'doc' column on the board which contains the item. If not provided, the tool will create a new doc column automatically when creating a doc on an item.")})]),WE={doc_name:g.string().describe("Name for the new document."),markdown:g.string().describe("Markdown content that will be imported into the newly created document as blocks."),location:g.enum(["workspace","item"]).describe("Location where the document should be created - either in a workspace or attached to an item"),workspace_id:g.number().optional().describe('[REQUIRED - use only when location="workspace"] Workspace ID under which to create the new document'),doc_kind:g.nativeEnum(Mg).optional().describe('[OPTIONAL - use only when location="workspace"] Document kind (public/private/share). Defaults to public.'),folder_id:g.number().optional().describe('[OPTIONAL - use only when location="workspace"] Optional folder ID to place the document inside a specific folder'),item_id:g.number().optional().describe('[REQUIRED - use only when location="item"] Item ID to attach the new document to'),column_id:g.string().optional().describe('[OPTIONAL - use only when location="item"] ID of an existing "doc" column on the board which contains the item. If not provided, the tool will create a new doc column automatically when creating a doc on an item.')};const YE=ow`
1345
1372
  mutation addContentToDocFromMarkdown($docId: ID!, $markdown: String!, $afterBlockId: String) {
1346
1373
  add_content_to_doc_from_markdown(docId: $docId, markdown: $markdown, afterBlockId: $afterBlockId) {
1347
1374
  success
@@ -1349,7 +1376,7 @@ import e from"util";import a,{Readable as t}from"stream";import i from"path";imp
1349
1376
  error
1350
1377
  }
1351
1378
  }
1352
- `,zE=ow`
1379
+ `,KE=ow`
1353
1380
  query getDocByObjectId($objectId: [ID!]) {
1354
1381
  docs(object_ids: $objectId) {
1355
1382
  id
@@ -1357,7 +1384,7 @@ import e from"util";import a,{Readable as t}from"stream";import i from"path";imp
1357
1384
  url
1358
1385
  }
1359
1386
  }
1360
- `,WE=ow`
1387
+ `,QE=ow`
1361
1388
  query getDocById($docId: [ID!]) {
1362
1389
  docs(ids: $docId) {
1363
1390
  id
@@ -1365,7 +1392,7 @@ import e from"util";import a,{Readable as t}from"stream";import i from"path";imp
1365
1392
  url
1366
1393
  }
1367
1394
  }
1368
- `,YE={doc_id:g.string().min(1).optional().describe("The document ID (the id field returned by read_docs). Provide this OR object_id. Takes priority if both are provided."),object_id:g.string().min(1).optional().describe("The document object ID (the object_id field from read_docs, also visible in the document URL). Will be resolved to a doc_id. Provide this OR doc_id."),markdown:g.string().describe("Markdown content to add to the document."),after_block_id:g.string().optional().describe("Block ID after which to insert the new content. If omitted, content is appended at the end. To insert at the beginning, pass the first block ID from read_docs. Block IDs can be obtained from read_docs or from a previous add_content_to_doc response.")};const KE=ow`
1395
+ `,JE={doc_id:g.string().min(1).optional().describe("The document ID (the id field returned by read_docs). Provide this OR object_id. Takes priority if both are provided."),object_id:g.string().min(1).optional().describe("The document object ID (the object_id field from read_docs, also visible in the document URL). Will be resolved to a doc_id. Provide this OR doc_id."),markdown:g.string().describe("Markdown content to add to the document."),after_block_id:g.string().optional().describe("Block ID after which to insert the new content. If omitted, content is appended at the end. To insert at the beginning, pass the first block ID from read_docs. Block IDs can be obtained from read_docs or from a previous add_content_to_doc response.")};const XE=ow`
1369
1396
  mutation CreateDashboard(
1370
1397
  $name: String!
1371
1398
  $workspace_id: ID!
@@ -1387,14 +1414,14 @@ import e from"util";import a,{Readable as t}from"stream";import i from"path";imp
1387
1414
  board_folder_id
1388
1415
  }
1389
1416
  }
1390
- `,QE=ow`
1417
+ `,ZE=ow`
1391
1418
  query GetAllWidgetsSchema {
1392
1419
  all_widgets_schema {
1393
1420
  widget_type
1394
1421
  schema
1395
1422
  }
1396
1423
  }
1397
- `,JE=ow`
1424
+ `,eI=ow`
1398
1425
  mutation CreateWidget($parent: WidgetParentInput!, $kind: ExternalWidget!, $name: String!, $settings: JSON!) {
1399
1426
  create_widget(parent: $parent, kind: $kind, name: $name, settings: $settings) {
1400
1427
  id
@@ -1406,14 +1433,14 @@ import e from"util";import a,{Readable as t}from"stream";import i from"path";imp
1406
1433
  }
1407
1434
  }
1408
1435
  }
1409
- `,XE={name:g.string().min(1,"Dashboard name is required").describe("Human-readable dashboard title (UTF-8 chars)"),workspace_id:g.string().describe("ID of the workspace that will own the dashboard"),board_ids:g.array(g.string()).min(1,"At least one board ID is required").max(50,"A maximum of 50 board IDs are allowed").describe("List of board IDs as strings (min 1 element)"),kind:g.nativeEnum(rb).default(rb.Public).describe("Visibility level: PUBLIC or PRIVATE"),board_folder_id:g.string().optional().describe("Optional folder ID within workspace to place this dashboard (if not provided, dashboard will be placed in workspace root)")};const ZE={parent_container_id:g.string().describe("ID of the parent container (dashboard ID or board view ID)"),parent_container_type:g.nativeEnum(Ly).describe("Type of parent container: DASHBOARD or BOARD_VIEW"),widget_kind:g.nativeEnum(gb).describe("Type of widget to create: i.e CHART, NUMBER, BATTERY"),widget_name:g.string().min(1,"Widget name is required").max(255,"Widget name must be 255 characters or less").describe("Widget display name (1-255 UTF-8 chars)"),settings:g.record(g.unknown()).optional().describe("Widget-specific settings as JSON object conforming to widget schema. Use all_widgets_schema tool to get the required schema for each widget type.")};const eI=ow`
1436
+ `,aI={name:g.string().min(1,"Dashboard name is required").describe("Human-readable dashboard title (UTF-8 chars)"),workspace_id:g.string().describe("ID of the workspace that will own the dashboard"),board_ids:g.array(g.string()).min(1,"At least one board ID is required").max(50,"A maximum of 50 board IDs are allowed").describe("List of board IDs as strings (min 1 element)"),kind:g.nativeEnum(rb).default(rb.Public).describe("Visibility level: PUBLIC or PRIVATE"),board_folder_id:g.string().optional().describe("Optional folder ID within workspace to place this dashboard (if not provided, dashboard will be placed in workspace root)")};const tI={parent_container_id:g.string().describe("ID of the parent container (dashboard ID or board view ID)"),parent_container_type:g.nativeEnum(Ly).describe("Type of parent container: DASHBOARD or BOARD_VIEW"),widget_kind:g.nativeEnum(gb).describe("Type of widget to create: i.e CHART, NUMBER, BATTERY"),widget_name:g.string().min(1,"Widget name is required").max(255,"Widget name must be 255 characters or less").describe("Widget display name (1-255 UTF-8 chars)"),settings:g.record(g.unknown()).optional().describe("Widget-specific settings as JSON object conforming to widget schema. Use all_widgets_schema tool to get the required schema for each widget type.")};const iI=ow`
1410
1437
  mutation updateWorkspace($id: ID!, $attributes: UpdateWorkspaceAttributesInput!) {
1411
1438
  update_workspace(id: $id, attributes: $attributes) {
1412
1439
  id
1413
1440
  name
1414
1441
  }
1415
1442
  }
1416
- `,aI={id:g.string().describe("The ID of the workspace to update"),attributeAccountProductId:g.number().optional().describe("The target account product's ID to move the workspace to"),attributeDescription:g.string().optional().describe("The description of the workspace to update"),attributeKind:g.nativeEnum(Fy).optional().describe("The kind of the workspace to update (open / closed / template)"),attributeName:g.string().optional().describe("The name of the workspace to update")};const tI=ow`
1443
+ `,nI={id:g.string().describe("The ID of the workspace to update"),attributeAccountProductId:g.number().optional().describe("The target account product's ID to move the workspace to"),attributeDescription:g.string().optional().describe("The description of the workspace to update"),attributeKind:g.nativeEnum(Fy).optional().describe("The kind of the workspace to update (open / closed / template)"),attributeName:g.string().optional().describe("The name of the workspace to update")};const oI=ow`
1417
1444
  mutation updateFolder(
1418
1445
  $folderId: ID!
1419
1446
  $name: String
@@ -1440,7 +1467,7 @@ import e from"util";import a,{Readable as t}from"stream";import i from"path";imp
1440
1467
  name
1441
1468
  }
1442
1469
  }
1443
- `,iI={folderId:g.string().describe("The ID of the folder to update"),name:g.string().optional().describe("The new name of the folder"),color:g.nativeEnum(wb).optional().describe("The new color of the folder"),fontWeight:g.nativeEnum(Tb).optional().describe("The new font weight of the folder"),customIcon:g.nativeEnum(xb).optional().describe("The new custom icon of the folder"),parentFolderId:g.string().optional().describe("The ID of the new parent folder"),workspaceId:g.string().optional().describe("The ID of the workspace containing the folder"),accountProductId:g.string().optional().describe("The account product ID associated with the folder"),position_object_id:g.string().optional().describe("The ID of the object to position the folder relative to. If this parameter is provided, position_object_type must be also provided."),position_object_type:g.nativeEnum(Xb).optional().describe("The type of object to position the folder relative to. If this parameter is provided, position_object_id must be also provided."),position_is_after:g.boolean().optional().describe("Whether to position the folder after the object")};const nI=ow`
1470
+ `,rI={folderId:g.string().describe("The ID of the folder to update"),name:g.string().optional().describe("The new name of the folder"),color:g.nativeEnum(wb).optional().describe("The new color of the folder"),fontWeight:g.nativeEnum(Tb).optional().describe("The new font weight of the folder"),customIcon:g.nativeEnum(xb).optional().describe("The new custom icon of the folder"),parentFolderId:g.string().optional().describe("The ID of the new parent folder"),workspaceId:g.string().optional().describe("The ID of the workspace containing the folder"),accountProductId:g.string().optional().describe("The account product ID associated with the folder"),position_object_id:g.string().optional().describe("The ID of the object to position the folder relative to. If this parameter is provided, position_object_type must be also provided."),position_object_type:g.nativeEnum(Xb).optional().describe("The type of object to position the folder relative to. If this parameter is provided, position_object_id must be also provided."),position_is_after:g.boolean().optional().describe("Whether to position the folder after the object")};const sI=ow`
1444
1471
  mutation createWorkspace(
1445
1472
  $name: String!
1446
1473
  $workspaceKind: WorkspaceKind!
@@ -1457,7 +1484,7 @@ import e from"util";import a,{Readable as t}from"stream";import i from"path";imp
1457
1484
  name
1458
1485
  }
1459
1486
  }
1460
- `,oI={name:g.string().describe("The name of the new workspace to be created"),workspaceKind:g.nativeEnum(Fy).describe("The kind of workspace to create"),description:g.string().optional().describe("The description of the new workspace"),accountProductId:g.string().optional().describe("The account product ID associated with the workspace")};const rI=ow`
1487
+ `,pI={name:g.string().describe("The name of the new workspace to be created"),workspaceKind:g.nativeEnum(Fy).describe("The kind of workspace to create"),description:g.string().optional().describe("The description of the new workspace"),accountProductId:g.string().optional().describe("The account product ID associated with the workspace")};const dI=ow`
1461
1488
  mutation createFolder(
1462
1489
  $workspaceId: ID!
1463
1490
  $name: String!
@@ -1478,7 +1505,7 @@ import e from"util";import a,{Readable as t}from"stream";import i from"path";imp
1478
1505
  name
1479
1506
  }
1480
1507
  }
1481
- `,sI={workspaceId:g.string().describe("The ID of the workspace where the folder will be created"),name:g.string().describe("The name of the folder to be created"),color:g.nativeEnum(wb).optional().describe("The color of the folder"),fontWeight:g.nativeEnum(Tb).optional().describe("The font weight of the folder"),customIcon:g.nativeEnum(xb).optional().describe("The custom icon of the folder"),parentFolderId:g.string().optional().describe("The ID of the parent folder")};const pI=ow`
1508
+ `,cI={workspaceId:g.string().describe("The ID of the workspace where the folder will be created"),name:g.string().describe("The name of the folder to be created"),color:g.nativeEnum(wb).optional().describe("The color of the folder"),fontWeight:g.nativeEnum(Tb).optional().describe("The font weight of the folder"),customIcon:g.nativeEnum(xb).optional().describe("The custom icon of the folder"),parentFolderId:g.string().optional().describe("The ID of the parent folder")};const lI=ow`
1482
1509
  mutation updateBoardHierarchy($boardId: ID!, $attributes: UpdateBoardHierarchyAttributesInput!) {
1483
1510
  update_board_hierarchy(board_id: $boardId, attributes: $attributes) {
1484
1511
  success
@@ -1488,7 +1515,7 @@ import e from"util";import a,{Readable as t}from"stream";import i from"path";imp
1488
1515
  }
1489
1516
  }
1490
1517
  }
1491
- `,dI=ow`
1518
+ `,mI=ow`
1492
1519
  mutation updateOverviewHierarchy($overviewId: ID!, $attributes: UpdateOverviewHierarchyAttributesInput!) {
1493
1520
  update_overview_hierarchy(overview_id: $overviewId, attributes: $attributes) {
1494
1521
  success
@@ -1498,7 +1525,7 @@ import e from"util";import a,{Readable as t}from"stream";import i from"path";imp
1498
1525
  }
1499
1526
  }
1500
1527
  }
1501
- `,cI={objectType:g.nativeEnum(Xb).describe("The type of object to move"),id:g.string().describe("The ID of the object to move"),position_object_id:g.string().optional().describe("The ID of the object to position the object relative to. If this parameter is provided, position_object_type must be also provided."),position_object_type:g.nativeEnum(Xb).optional().describe("The type of object to position the object relative to. If this parameter is provided, position_object_id must be also provided."),position_is_after:g.boolean().optional().describe("Whether to position the object after the object"),parentFolderId:g.string().optional().describe("The ID of the new parent folder. Required if moving to a different folder."),workspaceId:g.string().optional().describe("The ID of the workspace containing the object. Required if moving to a different workspace."),accountProductId:g.string().optional().describe("The ID of the account product containing the object. Required if moving to a different account product.")};const lI=ow`
1528
+ `,uI={objectType:g.nativeEnum(Xb).describe("The type of object to move"),id:g.string().describe("The ID of the object to move"),position_object_id:g.string().optional().describe("The ID of the object to position the object relative to. If this parameter is provided, position_object_type must be also provided."),position_object_type:g.nativeEnum(Xb).optional().describe("The type of object to position the object relative to. If this parameter is provided, position_object_id must be also provided."),position_is_after:g.boolean().optional().describe("Whether to position the object after the object"),parentFolderId:g.string().optional().describe("The ID of the new parent folder. Required if moving to a different folder."),workspaceId:g.string().optional().describe("The ID of the workspace containing the object. Required if moving to a different workspace."),accountProductId:g.string().optional().describe("The ID of the account product containing the object. Required if moving to a different account product.")};const fI=ow`
1502
1529
  query aggregateBoardInsights($query: AggregateQueryInput!, $boardId: ID!) {
1503
1530
  boards(ids: [$boardId]) {
1504
1531
  name
@@ -1520,7 +1547,7 @@ import e from"util";import a,{Readable as t}from"stream";import i from"path";imp
1520
1547
  }
1521
1548
  }
1522
1549
  }
1523
- `,mI=new Set([Sg.Case,Sg.Between,Sg.Left,Sg.Raw,Sg.None,Sg.CountKeys]),uI=Object.values(Sg).filter((e=>!mI.has(e))),fI=new Set([Sg.Left,Sg.Trim,Sg.Upper,Sg.Lower,Sg.DateTruncDay,Sg.DateTruncWeek,Sg.DateTruncMonth,Sg.DateTruncQuarter,Sg.DateTruncYear,Sg.Color,Sg.Label,Sg.EndDate,Sg.StartDate,Sg.Hour,Sg.PhoneCountryShortName,Sg.Person,Sg.Upper,Sg.Lower,Sg.Order,Sg.Length,Sg.Flatten,Sg.IsDone]);function hI(e){return{column_id:e}}new Set([Sg.Count,Sg.CountDistinct,Sg.CountSubitems,Sg.CountItems,Sg.First,Sg.Sum,Sg.Average,Sg.Median,Sg.Min,Sg.Max,Sg.MinMax]);const vI={boardId:g.number().describe("The id of the board to get insights for"),aggregations:g.array(g.object({function:g.enum(uI).describe("The function of the aggregation. For simple column value leave undefined").optional(),columnId:g.string().describe("The id of the column to aggregate")})).describe('The aggregations to get. Before sending the aggregations, use get_board_info tool to check "aggregationGuidelines" key for information. Transformative functions and plain columns (no function) must be in group by.').optional(),groupBy:g.array(g.string()).describe("The columns to group by. All columns in the group by must be in the aggregations as well without a function.").optional(),limit:g.number().describe("The limit of the results").max(1e3).optional().default(1e3),filters:CT,filtersOperator:$T,orderBy:g.array(g.object({columnId:g.string().describe("The id of the column to order by"),direction:g.nativeEnum(jb).optional().default(jb.Asc).describe("The direction to order by")})).optional().describe("The columns to order by, will control the order of the items in the response")};const gI=ow`
1550
+ `,hI=new Set([Sg.Case,Sg.Between,Sg.Left,Sg.Raw,Sg.None,Sg.CountKeys]),vI=Object.values(Sg).filter((e=>!hI.has(e))),gI=new Set([Sg.Left,Sg.Trim,Sg.Upper,Sg.Lower,Sg.DateTruncDay,Sg.DateTruncWeek,Sg.DateTruncMonth,Sg.DateTruncQuarter,Sg.DateTruncYear,Sg.Color,Sg.Label,Sg.EndDate,Sg.StartDate,Sg.Hour,Sg.PhoneCountryShortName,Sg.Person,Sg.Upper,Sg.Lower,Sg.Order,Sg.Length,Sg.Flatten,Sg.IsDone]);function bI(e){return{column_id:e}}new Set([Sg.Count,Sg.CountDistinct,Sg.CountSubitems,Sg.CountItems,Sg.First,Sg.Sum,Sg.Average,Sg.Median,Sg.Min,Sg.Max,Sg.MinMax]);const yI={boardId:g.number().describe("The id of the board to get insights for"),aggregations:g.array(g.object({function:g.enum(vI).describe("The function of the aggregation. For simple column value leave undefined").optional(),columnId:g.string().describe("The id of the column to aggregate")})).describe('The aggregations to get. Before sending the aggregations, use get_board_info tool to check "aggregationGuidelines" key for information. Transformative functions and plain columns (no function) must be in group by.').optional(),groupBy:g.array(g.string()).describe("The columns to group by. All columns in the group by must be in the aggregations as well without a function.").optional(),limit:g.number().describe("The limit of the results").max(1e3).optional().default(1e3),filters:CT,filtersOperator:$T,orderBy:g.array(g.object({columnId:g.string().describe("The id of the column to order by"),direction:g.nativeEnum(jb).optional().default(jb.Asc).describe("The direction to order by")})).optional().describe("The columns to order by, will control the order of the items in the response")};const _I=ow`
1524
1551
  query GetBoards($page: Int!, $limit: Int!, $workspace_ids: [ID]) {
1525
1552
  boards(page: $page, limit: $limit, workspace_ids: $workspace_ids) {
1526
1553
  id
@@ -1528,7 +1555,7 @@ import e from"util";import a,{Readable as t}from"stream";import i from"path";imp
1528
1555
  url
1529
1556
  }
1530
1557
  }
1531
- `,bI=ow`
1558
+ `,wI=ow`
1532
1559
  query GetDocs($page: Int!, $limit: Int!, $workspace_ids: [ID]) {
1533
1560
  docs(page: $page, limit: $limit, workspace_ids: $workspace_ids) {
1534
1561
  id
@@ -1536,14 +1563,14 @@ import e from"util";import a,{Readable as t}from"stream";import i from"path";imp
1536
1563
  url
1537
1564
  }
1538
1565
  }
1539
- `,yI=ow`
1566
+ `,xI=ow`
1540
1567
  query GetFolders($page: Int!, $limit: Int!, $workspace_ids: [ID]) {
1541
1568
  folders(page: $page, limit: $limit, workspace_ids: $workspace_ids) {
1542
1569
  id
1543
1570
  name
1544
1571
  }
1545
1572
  }
1546
- `,_I=ow`
1573
+ `,TI=ow`
1547
1574
  query SearchDev($query: String!, $limit: Int!, $filters: SearchFiltersInput!) {
1548
1575
  search(query: $query, limit: $limit, filters: $filters) {
1549
1576
  __typename
@@ -1564,14 +1591,14 @@ import e from"util";import a,{Readable as t}from"stream";import i from"path";imp
1564
1591
  }
1565
1592
  }
1566
1593
  }
1567
- `,wI=100,xI={searchTerm:g.string().optional().describe("The search term to use for the search."),searchType:g.nativeEnum(KT).describe("The type of search to perform."),limit:g.number().max(wI).optional().default(wI).describe("The number of items to get. The max and default value is 100."),page:g.number().optional().default(1).describe("The page number to get. The default value is 1."),workspaceIds:g.array(g.number()).optional().describe("The ids of the workspaces to search in. [IMPORTANT] Only pass this param if user explicitly asked to search within specific workspaces.")};const TI=g.object({id:g.string().describe("The ID of the entity to mention"),type:g.nativeEnum(Wb).describe("The type of mention: User, Team, Board, or Project")}),EI=g.array(TI),II={itemId:g.number().describe("The id of the item to which the update will be added"),body:g.string().describe("The update text to be created. Do not use @ to mention users, use the mentionsList field instead."),mentionsList:g.string().optional().describe('Optional JSON array of mentions in the format: [{"id": "123", "type": "User"}, {"id": "456", "type": "Team"}]. Valid types are: User, Team, Board, Project')};const SI=ow`
1594
+ `,EI=100,II={searchTerm:g.string().optional().describe("The search term to use for the search."),searchType:g.nativeEnum(KT).describe("The type of search to perform."),limit:g.number().max(EI).optional().default(EI).describe("The number of items to get. The max and default value is 100."),page:g.number().optional().default(1).describe("The page number to get. The default value is 1."),workspaceIds:g.array(g.number()).optional().describe("The ids of the workspaces to search in. [IMPORTANT] Only pass this param if user explicitly asked to search within specific workspaces.")};const SI=g.object({id:g.string().describe("The ID of the entity to mention"),type:g.nativeEnum(Wb).describe("The type of mention: User, Team, Board, or Project")}),NI=g.array(SI),AI={itemId:g.number().describe("The id of the item to which the update will be added"),body:g.string().describe("The update text to be created. Do not use @ to mention users, use the mentionsList field instead."),mentionsList:g.string().optional().describe('Optional JSON array of mentions in the format: [{"id": "123", "type": "User"}, {"id": "456", "type": "Team"}]. Valid types are: User, Team, Board, Project')};const DI=ow`
1568
1595
  mutation updateAssetsOnItem($boardId: ID!, $itemId: ID!, $columnId: String!, $files: [FileInput!]!) {
1569
1596
  update_assets_on_item(board_id: $boardId, item_id: $itemId, column_id: $columnId, files: $files) {
1570
1597
  id
1571
1598
  name
1572
1599
  }
1573
1600
  }
1574
- `,NI=g.object({fileType:g.enum(["google_drive","dropbox","box","onedrive","link","asset","doc"]).describe('The type of file: "asset" for uploaded files (requires assetId), "doc" for monday docs (requires objectId), "link" for generic links, "google_drive", "dropbox", "box", "onedrive" for cloud storage links (all link types require linkToFile)'),name:g.string().describe("File display name"),linkToFile:g.string().optional().describe("File link URL. Required for link, google_drive, dropbox, box, and onedrive file types"),assetId:g.number().optional().describe("The asset's ID. Required when fileType is 'asset'"),objectId:g.number().optional().describe("The doc's ID. Required when fileType is 'doc'")}),AI={boardId:g.string().describe("The board's unique identifier"),itemId:g.string().describe("The item's unique identifier"),columnId:g.string().describe("The file or doc column's unique identifier"),files:g.array(NI).describe("Array of file values to set on the column")};const DI=ow`
1601
+ `,OI=g.object({fileType:g.enum(["google_drive","dropbox","box","onedrive","link","asset","doc"]).describe('The type of file: "asset" for uploaded files (requires assetId), "doc" for monday docs (requires objectId), "link" for generic links, "google_drive", "dropbox", "box", "onedrive" for cloud storage links (all link types require linkToFile)'),name:g.string().describe("File display name"),linkToFile:g.string().optional().describe("File link URL. Required for link, google_drive, dropbox, box, and onedrive file types"),assetId:g.number().optional().describe("The asset's ID. Required when fileType is 'asset'"),objectId:g.number().optional().describe("The doc's ID. Required when fileType is 'doc'")}),kI={boardId:g.string().describe("The board's unique identifier"),itemId:g.string().describe("The item's unique identifier"),columnId:g.string().describe("The file or doc column's unique identifier"),files:g.array(OI).describe("Array of file values to set on the column")};const RI=ow`
1575
1602
  query getUserContext {
1576
1603
  me {
1577
1604
  id
@@ -1599,7 +1626,7 @@ import e from"util";import a,{Readable as t}from"stream";import i from"path";imp
1599
1626
  }
1600
1627
  }
1601
1628
  }
1602
- `,OI=ow`
1629
+ `,CI=ow`
1603
1630
  query getFavoriteDetails(
1604
1631
  $boardIds: [ID!]
1605
1632
  $folderIds: [ID!]
@@ -1623,7 +1650,7 @@ import e from"util";import a,{Readable as t}from"stream";import i from"path";imp
1623
1650
  name
1624
1651
  }
1625
1652
  }
1626
- `,kI={[Lb.Board]:"boardIds",[Lb.Folder]:"folderIds",[Lb.Workspace]:"workspaceIds",[Lb.Dashboard]:"dashboardIds"},RI={[Lb.Board]:"boards",[Lb.Folder]:"folders",[Lb.Workspace]:"workspaces",[Lb.Dashboard]:"dashboards"};const CI=ow`
1653
+ `,$I={[Lb.Board]:"boardIds",[Lb.Folder]:"folderIds",[Lb.Workspace]:"workspaceIds",[Lb.Dashboard]:"dashboardIds"},LI={[Lb.Board]:"boards",[Lb.Folder]:"folders",[Lb.Workspace]:"workspaces",[Lb.Dashboard]:"dashboards"};const FI=ow`
1627
1654
  query GetNotetakerMeetings(
1628
1655
  $limit: Int
1629
1656
  $cursor: String
@@ -1676,7 +1703,7 @@ import e from"util";import a,{Readable as t}from"stream";import i from"path";imp
1676
1703
  }
1677
1704
  }
1678
1705
  }
1679
- `,$I={ids:g.array(g.string()).optional().describe("Filter by specific meeting IDs. Use this to fetch one or more specific meetings in a single call."),access:g.enum(["OWN","SHARED_WITH_ME","SHARED_WITH_ACCOUNT","ALL"]).optional().default("OWN").describe("Filter meetings by access level. OWN: meetings the user participated in or invited the bot to. SHARED_WITH_ME: meetings shared with the user or their team. SHARED_WITH_ACCOUNT: meetings shared with the entire account. ALL: all meetings the user has access to."),limit:g.number().min(1).max(100).optional().default(25).describe("Maximum number of notetaker meetings to return per page (1-100)."),cursor:g.string().optional().describe("Cursor for pagination. Use cursor from the previous page_info to fetch the next page."),search:g.string().optional().describe("Search notetaker meetings by title, participant name, or email."),include_summary:g.boolean().optional().default(!1).describe("Whether to include the AI-generated summary for each meeting."),include_topics:g.boolean().optional().default(!1).describe("Whether to include discussion topics and talking points for each meeting."),include_action_items:g.boolean().optional().default(!1).describe("Whether to include action items for each meeting."),include_transcript:g.boolean().optional().default(!1).describe("Whether to include the full transcript for each meeting. Transcripts can be very large.")};g.enum(["enable","disable","status","list","detailed","reset"]).describe('Action to perform: "list" or "detailed" to discover available tools, "status" to check current states, "enable" to activate needed tools, "disable" to deactivate tools, "reset" to restore defaults'),g.string().optional().describe("Name of the tool to manage (required for enable/disable/status/reset)");const LI=ow`
1706
+ `,PI={ids:g.array(g.string()).optional().describe("Filter by specific meeting IDs. Use this to fetch one or more specific meetings in a single call."),access:g.enum(["OWN","SHARED_WITH_ME","SHARED_WITH_ACCOUNT","ALL"]).optional().default("OWN").describe("Filter meetings by access level. OWN: meetings the user participated in or invited the bot to. SHARED_WITH_ME: meetings shared with the user or their team. SHARED_WITH_ACCOUNT: meetings shared with the entire account. ALL: all meetings the user has access to."),limit:g.number().min(1).max(100).optional().default(25).describe("Maximum number of notetaker meetings to return per page (1-100)."),cursor:g.string().optional().describe("Cursor for pagination. Use cursor from the previous page_info to fetch the next page."),search:g.string().optional().describe("Search notetaker meetings by title, participant name, or email."),include_summary:g.boolean().optional().default(!1).describe("Whether to include the AI-generated summary for each meeting."),include_topics:g.boolean().optional().default(!1).describe("Whether to include discussion topics and talking points for each meeting."),include_action_items:g.boolean().optional().default(!1).describe("Whether to include action items for each meeting."),include_transcript:g.boolean().optional().default(!1).describe("Whether to include the full transcript for each meeting. Transcripts can be very large.")};g.enum(["enable","disable","status","list","detailed","reset"]).describe('Action to perform: "list" or "detailed" to discover available tools, "status" to check current states, "enable" to activate needed tools, "disable" to deactivate tools, "reset" to restore defaults'),g.string().optional().describe("Name of the tool to manage (required for enable/disable/status/reset)");const jI=ow`
1680
1707
  query getSprintsByIds($ids: [ID!]) {
1681
1708
  items(ids: $ids) {
1682
1709
  id
@@ -1711,7 +1738,7 @@ import e from"util";import a,{Readable as t}from"stream";import i from"path";imp
1711
1738
  }
1712
1739
  }
1713
1740
  }
1714
- `,FI={SPRINT_TASKS:"sprint_tasks",SPRINT_TIMELINE:"sprint_timeline",SPRINT_COMPLETION:"sprint_completion",SPRINT_START_DATE:"sprint_start_date",SPRINT_END_DATE:"sprint_end_date",SPRINT_ACTIVATION:"sprint_activation"},PI={...FI,SPRINT_SUMMARY:"sprint_summary",SPRINT_CAPACITY:"sprint_capacity"},jI="BOARD_NOT_FOUND:",VI="SPRINT_NOT_FOUND:",UI="DOCUMENT_NOT_FOUND:",BI="DOCUMENT_INVALID:",MI="DOCUMENT_EMPTY:",qI="EXPORT_FAILED:",GI="INTERNAL_ERROR:",HI="VALIDATION_ERROR:",zI="task_sprint",WI={[PI.SPRINT_TASKS]:"Sprint Tasks",[PI.SPRINT_TIMELINE]:"Sprint Timeline",[PI.SPRINT_COMPLETION]:"Sprint Completion",[PI.SPRINT_START_DATE]:"Sprint Start Date",[PI.SPRINT_END_DATE]:"Sprint End Date",[PI.SPRINT_ACTIVATION]:"Sprint Activation",[PI.SPRINT_SUMMARY]:"Sprint Summary",[PI.SPRINT_CAPACITY]:"Sprint Capacity"},YI=uy,KI={TASK_SPRINT:"task_sprint",TASK_STATUS:"task_status"},QI=(e,a)=>e.column_values?.find((e=>e.id===a)),JI=(e,a)=>{const t=QI(e,a);return"CheckboxValue"===t?.__typename?t.checked??!1:null},XI=(e,a)=>{const t=QI(e,a);return"DateValue"===t?.__typename?t.date??null:null},ZI=(e,a)=>{const t=QI(e,a);return"DocValue"===t?.__typename&&t.file?.doc?.object_id?t.file.doc.object_id:null},eS=(e,a)=>{const t=a.filter((a=>!e.has(a)));return{isValid:0===t.length,missingColumns:t}},aS=(e,a)=>{if(!e.columns)return!1;const t=new Set(e.columns.filter((e=>null!==e)).map((e=>e.id)));return a.every((e=>t.has(e)))},tS=e=>aS(e,Object.values(FI)),iS=e=>aS(e,Object.values(KI)),nS=e=>{if(!e?.settings)return null;const a=e.settings;return a.boardIds&&Array.isArray(a.boardIds)&&a.boardIds[0]?.toString()||a.boardId?.toString()||null},oS=(e,a)=>e.columns&&e.columns.filter((e=>null!==e)).find((e=>e.id===a&&e.type===Jx.BoardRelation))||null,rS={sprintId:g.number().describe('The ID of the sprint to get the summary for (e.g., "9123456789")')};const sS=ow`
1741
+ `,VI={SPRINT_TASKS:"sprint_tasks",SPRINT_TIMELINE:"sprint_timeline",SPRINT_COMPLETION:"sprint_completion",SPRINT_START_DATE:"sprint_start_date",SPRINT_END_DATE:"sprint_end_date",SPRINT_ACTIVATION:"sprint_activation"},UI={...VI,SPRINT_SUMMARY:"sprint_summary",SPRINT_CAPACITY:"sprint_capacity"},BI="BOARD_NOT_FOUND:",MI="SPRINT_NOT_FOUND:",qI="DOCUMENT_NOT_FOUND:",GI="DOCUMENT_INVALID:",HI="DOCUMENT_EMPTY:",zI="EXPORT_FAILED:",WI="INTERNAL_ERROR:",YI="VALIDATION_ERROR:",KI="task_sprint",QI={[UI.SPRINT_TASKS]:"Sprint Tasks",[UI.SPRINT_TIMELINE]:"Sprint Timeline",[UI.SPRINT_COMPLETION]:"Sprint Completion",[UI.SPRINT_START_DATE]:"Sprint Start Date",[UI.SPRINT_END_DATE]:"Sprint End Date",[UI.SPRINT_ACTIVATION]:"Sprint Activation",[UI.SPRINT_SUMMARY]:"Sprint Summary",[UI.SPRINT_CAPACITY]:"Sprint Capacity"},JI=uy,XI={TASK_SPRINT:"task_sprint",TASK_STATUS:"task_status"},ZI=(e,a)=>e.column_values?.find((e=>e.id===a)),eS=(e,a)=>{const t=ZI(e,a);return"CheckboxValue"===t?.__typename?t.checked??!1:null},aS=(e,a)=>{const t=ZI(e,a);return"DateValue"===t?.__typename?t.date??null:null},tS=(e,a)=>{const t=ZI(e,a);return"DocValue"===t?.__typename&&t.file?.doc?.object_id?t.file.doc.object_id:null},iS=(e,a)=>{const t=a.filter((a=>!e.has(a)));return{isValid:0===t.length,missingColumns:t}},nS=(e,a)=>{if(!e.columns)return!1;const t=new Set(e.columns.filter((e=>null!==e)).map((e=>e.id)));return a.every((e=>t.has(e)))},oS=e=>nS(e,Object.values(VI)),rS=e=>nS(e,Object.values(XI)),sS=e=>{if(!e?.settings)return null;const a=e.settings;return a.boardIds&&Array.isArray(a.boardIds)&&a.boardIds[0]?.toString()||a.boardId?.toString()||null},pS=(e,a)=>e.columns&&e.columns.filter((e=>null!==e)).find((e=>e.id===a&&e.type===Jx.BoardRelation))||null,dS={sprintId:g.number().describe('The ID of the sprint to get the summary for (e.g., "9123456789")')};const cS=ow`
1715
1742
  query GetSprintsBoardItemsWithColumns($boardId: ID!, $limit: Int) {
1716
1743
  boards(ids: [$boardId]) {
1717
1744
  items_page(limit: $limit) {
@@ -1747,7 +1774,7 @@ import e from"util";import a,{Readable as t}from"stream";import i from"path";imp
1747
1774
  }
1748
1775
  }
1749
1776
  }
1750
- `,pS={sprintsBoardId:g.number().describe("The ID of the monday-dev board containing the sprints"),limit:g.number().min(1).max(100).optional().default(25).describe("The number of sprints to retrieve (default: 25, max: 100)")};const dS=ow`
1777
+ `,lS={sprintsBoardId:g.number().describe("The ID of the monday-dev board containing the sprints"),limit:g.number().min(1).max(100).optional().default(25).describe("The number of sprints to retrieve (default: 25, max: 100)")};const mS=ow`
1751
1778
  query GetRecentBoards($limit: Int) {
1752
1779
  boards(limit: $limit, order_by: used_at, state: active) {
1753
1780
  id
@@ -1763,7 +1790,7 @@ import e from"util";import a,{Readable as t}from"stream";import i from"path";imp
1763
1790
  }
1764
1791
  }
1765
1792
  }
1766
- `,cS={};const lS=[class extends bu{constructor(){super(...arguments),this.name="get_monday_dev_sprints_boards",this.type=y.READ,this.annotations=gu({title:"monday-dev: Get Sprints Boards",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Discover monday-dev sprints boards and their associated tasks boards in your account.\n\n## Purpose:\nIdentifies and returns monday-dev sprints board IDs and tasks board IDs that you need to use with other monday-dev tools. \nThis tool scans your recently used boards (up to 100) to find valid monday-dev sprint management boards.\n\n## What it Returns:\n- Pairs of sprints boards and their corresponding tasks boards\n- Board IDs, names, and workspace information for each pair\n- The bidirectional relationship between each sprints board and its tasks board\n\n## Note:\nSearches recently used boards (up to 100). If none found, ask user to provide board IDs manually."}getInputSchema(){return cS}async executeInternal(e){try{const e={limit:100},a=((await this.mondayApi.request(dS,e)).boards||[]).filter((e=>null!==e));if(0===a.length)return{content:`${jI} No boards found in your account. Please verify you have access to monday.com boards.`};const t=this.extractBoardPairs(a);if(0===t.length)return{content:this.generateNotFoundMessage(a.length)};return{content:this.generateReport(t)}}catch(e){return{content:`${GI} Error retrieving sprints boards: ${e instanceof Error?e.message:"Unknown error"}`}}}generateMultiplePairsWarning(e){return`## ⚠️ Multiple SprintsBoard Detected\n**${e}** different board pairs found. Each pair is isolated and workspace-specific.\n**AI Agent - REQUIRED:** Before ANY operation, confirm with user which pair and workspace to use.\n---\n`}generatePairDetails(e,a){return`### Pair ${a+1}\n**Sprints Board:**\n- ID: \`${e.sprintsBoard.id}\`\n- Name: ${e.sprintsBoard.name}\n- Workspace: ${e.sprintsBoard.workspaceName} (ID: ${e.sprintsBoard.workspaceId})\n\n**Tasks Board:**\n- ID: \`${e.tasksBoard.id}\`\n- Name: ${e.tasksBoard.name}\n- Workspace: ${e.tasksBoard.workspaceName} (ID: ${e.tasksBoard.workspaceId})\n---\n\n`}generateTechnicalReference(){return"## 📋 Technical Reference\n\n**Sprint Operations** (all require correct board pair):\n• Add to Sprint: Update `task_sprint` column with sprint item ID\n• Remove from Sprint: Clear `task_sprint` column (set to null)\n• Search in Sprint: Filter where `task_sprint` equals sprint item ID\n• Move Between Sprints: Update `task_sprint` with new sprint item ID\n• Backlog Tasks: `task_sprint` is empty/null\n\n**Critical:** `task_sprint` column references ONLY its paired sprints board. Cross-pair operations WILL FAIL."}generateReport(e){const a=e.length>1?this.generateMultiplePairsWarning(e.length):"",t=e.map(((e,a)=>this.generatePairDetails(e,a))).join(""),i=this.generateTechnicalReference();return`# Monday-Dev Sprints Boards Discovery\n\n${a}## Boards\n\nFound **${e.length}** matched pair(s):\n\n${t}${i}`}generateNotFoundMessage(e){return`## No Monday-Dev Sprints Board Pairs Found\n\n**Boards Checked:** ${e} (recently used)\n\nNo board pairs with sprint relationships found in your recent boards.\n\n### Possible Reasons:\n1. Boards exist but not accessed recently by your account\n2. Missing access permissions to sprint/task boards\n3. Monday-dev product was not set up in account\n\n### Next Steps:\n1. Ask user to access monday-dev boards in UI to refresh recent boards list\n2. Ask user to verify permissions to view sprint and task boards\n3. Ask user to provide board IDs manually if known`}createBoardInfo(e,a,t){return{id:e,name:a?.name||t,workspaceId:a?.workspace?.id||"unknown",workspaceName:a?.workspace?.name||"Unknown"}}processSprintsBoard(e,a,t){const i=oS(e,FI.SPRINT_TASKS);if(!i)return;const n=nS(i);if(!n)return;const o=`${e.id}:${n}`;if(t.has(o))return;const r=a.get(n);t.set(o,{sprintsBoard:this.createBoardInfo(e.id,e,`Sprints Board ${e.id}`),tasksBoard:this.createBoardInfo(n,r,`Tasks Board ${n}`)})}processTasksBoard(e,a,t){const i=oS(e,zI);if(!i)return;const n=nS(i);if(!n)return;const o=`${n}:${e.id}`;if(t.has(o))return;const r=a.get(n);t.set(o,{sprintsBoard:this.createBoardInfo(n,r,`Sprints Board ${n}`),tasksBoard:this.createBoardInfo(e.id,e,`Tasks Board ${e.id}`)})}extractBoardPairs(e){const a=new Map,t=new Map(e.map((e=>[e.id,e])));for(const i of e)i.columns&&(tS(i)&&this.processSprintsBoard(i,t,a),iS(i)&&this.processTasksBoard(i,t,a));return Array.from(a.values())}},class extends bu{constructor(){super(...arguments),this.name="get_sprints_metadata",this.type=y.READ,this.annotations=gu({title:"monday-dev: Get Sprints Metadata",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get comprehensive sprint metadata from a monday-dev sprints board including:\n\n## Data Retrieved:\nA table of sprints with the following information:\n- Sprint ID\n- Sprint Name\n- Sprint timeline (planned from/to dates)\n- Sprint completion status (completed/in-progress/planned)\n- Sprint start date (actual)\n- Sprint end date (actual)\n- Sprint activation status\n- Sprint summary document object ID\n\n## Parameters:\n- **limit**: Number of sprints to retrieve (default: 25, max: 100)\n\nRequires the Main Sprints board ID of the monday-dev containing your sprints."}getInputSchema(){return pS}async executeInternal(e){try{const a=await this.validateBoardSchema(e.sprintsBoardId.toString());if(!a.success)return{content:a.error||"Board schema validation failed"};const t={boardId:e.sprintsBoardId.toString(),limit:e.limit},i=await this.mondayApi.request(sS,t),n=i.boards?.[0],o=n?.items_page?.items||[];return{content:this.generateSprintsMetadataReport(o)}}catch(e){return{content:`${GI} Error retrieving sprints metadata: ${e instanceof Error?e.message:"Unknown error"}`}}}async validateBoardSchema(e){try{const a={boardId:e.toString()},t=await this.mondayApi.request(pw,a),i=t.boards?.[0];if(!i)return{success:!1,error:`${jI} Board with ID ${e} not found. Please verify the board ID is correct and you have access to it.`};const n=i.columns||[],o=this.validateSprintsBoardSchemaFromColumns(n);return o.isValid?{success:!0}:{success:!1,error:`${HI} ${o.errorMessage}`}}catch(e){return{success:!1,error:`${GI} Error validating board schema: ${e instanceof Error?e.message:"Unknown error"}`}}}validateSprintsBoardSchemaFromColumns(e){const a=new Set(e.filter((e=>null!==e)).map((e=>e.id))),t=Object.values(FI),i=eS(a,t);if(!i.isValid){let e="BoardID provided is not a valid sprints board. Missing required columns:\n\n";return i.missingColumns.forEach((a=>{const t=(e=>WI[e]||e)(a);e+=`- ${t}\n`})),{isValid:!1,errorMessage:e}}return{isValid:!0,errorMessage:""}}generateSprintsMetadataReport(e){let a="# Sprints Metadata Report\n\n";return a+=`**Total Sprints:** ${e.length}\n\n`,a+="| Sprint Name | Sprint ID | Status | Timeline (Planned) | Start Date (Actual) | End Date (Actual) | Completion | Summary Document ObjectID |\n",a+="|-------------|-----------|--------|--------------------|---------------------|-------------------|------------|---------------------------|\n",e.forEach((e=>{const t=e.name||"Unknown",i=e.id,n=JI(e,PI.SPRINT_ACTIVATION),o=JI(e,PI.SPRINT_COMPLETION),r=XI(e,PI.SPRINT_START_DATE),s=XI(e,PI.SPRINT_END_DATE),p=((e,a)=>{const t=QI(e,a);if("TimelineValue"===t?.__typename&&t.from&&t.to)return{from:t.from.split("T")[0],to:t.to.split("T")[0]};return null})(e,PI.SPRINT_TIMELINE),d=ZI(e,PI.SPRINT_SUMMARY);let c=YI.Planned;o?c=YI.Completed:(n||r)&&(c=YI.Active);const l=p?`${p.from} to ${p.to}`:"Not set";a+=`| ${t} | ${i} | ${c} | ${l} | ${r||"Not started"} | ${s||"Not ended"} | ${o?"Yes":"No"} | ${d||"No document"} |\n`})),a+="\n## Status Definitions:\n",a+=`- **${YI.Planned}**: Sprint not yet started (no activation, no start date)\n`,a+=`- **${YI.Active}**: Sprint is active (activated but not completed)\n`,a+=`- **${YI.Completed}**: Sprint is finished\n\n`,a}},class extends bu{constructor(){super(...arguments),this.name="get_sprint_summary",this.type=y.READ,this.annotations=gu({title:"monday-dev: Get Sprint Summary",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Get the complete summary and analysis of a sprint.\n\n## Purpose:\nUnlock deep insights into completed sprint performance. \n\nThe sprint summary content including:\n- **Scope Management**: Analysis of planned vs. unplanned tasks, scope creep\n- **Velocity & Performance**: Individual velocity, task completion rates, workload distribution per team member\n- **Task Distribution**: Breakdown of completed tasks by type (Feature, Bug, Tech Debt, Infrastructure, etc.)\n- **AI Recommendations**: Action items, process improvements, retrospective focus areas\n\n## Requirements:\n- Sprint must be completed and must be created after 1/1/2025 \n\n## Important Note:\nWhen viewing the section "Completed by Assignee", you\'ll see user IDs in the format "@user-12345678". the 8 digits after the @is the user ID. To retrieve the actual owner names, use the list_users_and_teams tool with the user ID and set includeTeams=false for optimal performance.\n\n'}getInputSchema(){return rS}async executeInternal(e){try{const a=await this.getSprintMetadata(e.sprintId);if(!a.success)return{content:a.error||`${GI} Unknown error occurred while getting sprint metadata`};const t=await this.readSprintSummaryDocument(a.documentObjectId);return t.success?{content:t.content}:{content:t.error||`${GI} Unknown error occurred while reading document content`}}catch(e){return{content:`${GI} Error retrieving sprint summary: ${e instanceof Error?e.message:"Unknown error"}`}}}async getSprintMetadata(e){try{const a={ids:[String(e)]},t=(await this.mondayApi.request(LI,a)).items||[];if(0===t.length)return{success:!1,error:`${VI} Sprint with ID ${e} not found. Please verify the sprint ID is correct.`};const i=t[0];if(!i)return{success:!1,error:`${VI} Sprint with ID ${e} not found.`};const n=((e,a=[])=>{const t=new Set((e.column_values||[]).map((e=>e.id))),i=[...Object.values(FI),...a];return eS(t,i)})(i,[PI.SPRINT_SUMMARY]);if(!n.isValid)return{success:!1,error:`${HI} Sprint item is missing required columns: ${n.missingColumns.join(", ")}. This may not be a valid sprint board item.`};const o=ZI(i,PI.SPRINT_SUMMARY);return o?{success:!0,documentObjectId:o,sprintName:i.name}:{success:!1,error:`${UI} No sprint summary document found for sprint "${i.name}" (ID: ${e}). Sprint summary is only available for completed sprints that have analysis documents.`}}catch(e){return{success:!1,error:`${GI} Error getting sprint item: ${e instanceof Error?e.message:"Unknown error"}`}}}async readSprintSummaryDocument(e){try{const a={object_ids:[e],limit:1},t=(await this.mondayApi.request(yw,a)).docs||[];if(0===t.length)return{success:!1,error:`${UI} Document with object ID ${e} not found or not accessible.`};const i=t[0];if(!i||!i.id)return{success:!1,error:`${BI} Document data is invalid for object ID ${e}.`};const n={docId:i.id,blockIds:[]},o=await this.mondayApi.request(_w,n);if(!o.export_markdown_from_doc?.success)return{success:!1,error:`${qI} Failed to export markdown from document: ${o.export_markdown_from_doc?.error||"Unknown error"}`};const r=o.export_markdown_from_doc.markdown;return r?{success:!0,content:r}:{success:!1,error:`${MI} Document content is empty or could not be retrieved.`}}catch(e){return{success:!1,error:`${GI} Error reading document: ${e instanceof Error?e.message:"Unknown error"}`}}}}],mS=[class extends bu{constructor(){super(...arguments),this.name="delete_item",this.type=y.WRITE,this.annotations=gu({title:"Delete Item",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an item"}getInputSchema(){return DT}async executeInternal(e){const a={id:e.itemId.toString()},t=await this.mondayApi.request(rw,a);return{content:`Item ${t.delete_item?.id} successfully deleted`}}},class extends bu{constructor(){super(...arguments),this.name="get_board_items_page",this.type=y.READ,this.annotations=gu({title:"Get Board Items Page",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get all items from a monday.com board with pagination support and optional column values and item descriptions. Returns structured JSON with item details, creation/update timestamps, and pagination info. Use the 'nextCursor' parameter from the response to get the next page of results when 'has_more' is true. To retrieve an item's description (the rich-text body/details of a monday.com item), set 'includeItemDescription' to true — the response will include the item description's document blocks with their content, type, and id. Use this whenever the user asks about an item's description, body, details, or notes. [REQUIRED PRECONDITION]: Before using this tool, if new columns were added to the board or if you are not familiar with the board's structure (column IDs, column types, status labels, etc.), first use get_board_info to understand the board metadata. This is essential for constructing proper filters and knowing which columns are available. VIEW-BASED FILTERING: If the user refers to a board view by name (e.g. \"show me items in the 'Overdue' view\"), first call get_board_info to get the board's views, find the matching view by name, then extract its filter field and pass it as the filters argument here."}getInputSchema(){return QT}async executeInternal(e){const a=!e.cursor;if(a&&e.searchTerm)try{if(e.itemIds=await this.getItemIdsFromSmartSearchAsync(e),0===e.itemIds.length)return{content:"No items found matching the specified searchTerm"}}catch(a){fT(a),e.filters=this.rebuildFiltersWithManualSearch(e.searchTerm,e.filters)}const t={boardId:e.boardId.toString(),limit:e.limit,cursor:e.cursor||void 0,includeColumns:e.includeColumns,columnIds:e.columnIds,includeSubItems:e.includeSubItems,includeDescription:e.includeItemDescription};a&&(e.itemIds||e.filters||e.orderBy)&&(t.queryParams={ids:e.itemIds?.map((e=>e.toString())),operator:e.filtersOperator,rules:e.filters?.map((e=>({column_id:e.columnId.toString(),compare_value:e.compareValue,operator:e.operator,compare_attribute:e.compareAttribute}))),order_by:e.orderBy?.map((e=>({column_id:e.columnId,direction:e.direction})))});const i=await this.mondayApi.request(zT,t);return{content:this.mapResult(i,e)}}rebuildFiltersWithManualSearch(e,a){return(a=(a=a??[]).filter((e=>"name"!==e.columnId))).push({columnId:"name",operator:Ub.ContainsText,compareValue:e}),a}mapResult(e,a){const t=e.boards?.[0],i=t?.items_page,n=i?.items||[];return{board:{id:t?.id,name:t?.name},items:n.map((e=>this.mapItem(e,a))),pagination:{has_more:!!i?.cursor,nextCursor:i?.cursor||null,count:n.length}}}mapItem(e,a){const t={id:e.id,name:e.name,url:e.url,created_at:e.created_at,updated_at:e.updated_at};if(a.includeColumns&&e.column_values){t.column_values={};for(const a of e.column_values)t.column_values[a.id]=this.getColumnValueData(a)}if(a.includeItemDescription&&"description"in e&&e.description){const a=(e.description.blocks??[]).filter((e=>!!e)).map((e=>({id:e.id,type:e.type,content:e.content})));t.item_description={id:e.description.id,blocks:a}}return a.includeSubItems&&"subitems"in e&&e.subitems&&(t.subitems=e.subitems.slice(0,a.subItemLimit).map((e=>this.mapItem(e,a)))),t}getColumnValueData(e){switch(e.type){case Jx.BoardRelation:return e.linked_items;case Jx.Formula:return e.display_value;case Jx.Mirror:return"Column value type is not supported"}if(e.text)return e.text;try{return JSON.parse(e.value)}catch{return e.value||null}}async getItemIdsFromSmartSearchAsync(e){const a={query:e.searchTerm,limit:100,filters:{entities:[{items:{board_ids:[e.boardId.toString()]}}]}},t=await this.mondayApi.request(WT,a,{versionOverride:"dev",timeout:mT}),i=t.search?.filter((e=>"ItemSearchResult"===e.__typename))?.map((e=>Number(e.data.id)))??[];if(0===i.length)throw new Error("No items found for search term or new search is not enabled for this account");const n=e.itemIds??[];if(0===n.length)return i;const o=new Set(n);return i.filter((e=>o.has(e)))}},class extends bu{constructor(){super(...arguments),this.name="create_item",this.type=y.WRITE,this.annotations=gu({title:"Create Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new item with provided values, create a subitem under a parent item, or duplicate an existing item and update it with new values. Use parentItemId when creating a subitem under an existing item. Use duplicateFromItemId when copying an existing item with modifications.[REQUIRED PRECONDITION]: Before using this tool, if new columns were added to the board or if you are not familiar with the board's structure (column IDs, column types, status labels, etc.), first use get_board_info to understand the board metadata. This is essential for constructing proper column values and knowing which columns are available."}getInputSchema(){return this.context?.boardId?hT:vT}async executeInternal(e){const a=this.context?.boardId??e.boardId;if(e.duplicateFromItemId&&e.parentItemId)throw new Error("Cannot specify both parentItemId and duplicateFromItemId. Please provide only one of these parameters.");return e.duplicateFromItemId?await this.duplicateAndUpdateItem(e,a):e.parentItemId?await this.createSubitem(e):await this.createNewItem(e,a)}async duplicateAndUpdateItem(e,a){try{const t={boardId:a.toString(),itemId:e.duplicateFromItemId.toString()},i=await this.mondayApi.request(rT,t);if(!i.duplicate_item?.id)throw new Error("Failed to duplicate item: no item duplicated");let n;try{n=JSON.parse(e.columnValues)}catch(e){throw new Error("Invalid JSON in columnValues")}const o={...n,name:e.name},r=new Sw(this.mondayApi,this.apiToken,{boardId:a});return await r.execute({itemId:parseInt(i.duplicate_item.id),columnValues:JSON.stringify(o)}),{content:{message:`Item ${i.duplicate_item.id} duplicated from ${e.duplicateFromItemId}`,item_id:i.duplicate_item.id,item_name:i.duplicate_item.name,item_url:i.duplicate_item.url,board_id:a}}}catch(e){uT(e,"duplicate item")}}async createSubitem(e){const a={parentItemId:e.parentItemId.toString(),itemName:e.name,columnValues:e.columnValues};try{const t=await this.mondayApi.request(sT,a);if(!t.create_subitem?.id)throw new Error("Failed to create subitem: no subitem created");return{content:{message:`Subitem ${t.create_subitem.id} created under ${e.parentItemId}`,item_id:t.create_subitem.id,item_name:t.create_subitem.name,item_url:t.create_subitem.url}}}catch(e){uT(e,"create subitem")}}async createNewItem(e,a){try{const t={boardId:a.toString(),itemName:e.name,groupId:e.groupId,columnValues:e.columnValues},i=await this.mondayApi.request(sw,t);return{content:{message:`Item ${i.create_item?.id} successfully created`,item_id:i.create_item?.id,item_name:i.create_item?.name,item_url:i.create_item?.url,board_id:a}}}catch(e){uT(e,"create item")}}},class extends bu{constructor(){super(...arguments),this.name="create_update",this.type=y.WRITE,this.annotations=gu({title:"Create Update",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new update (comment/post) on a monday.com item. Updates can be used to add comments, notes, or discussions to items. You can optionally mention users, teams, or boards in the update. You can also reply to an existing update by using the parentId parameter."}getInputSchema(){return wT}async executeInternal(e){let a;if(e.mentionsList)try{const t=JSON.parse(e.mentionsList),i=_T.safeParse(t);if(!i.success)throw new Error(`Invalid mentionsList format: ${i.error.message}`);a=i.data}catch(e){throw new Error(`Invalid mentionsList JSON format: ${e.message}`)}try{const t={itemId:e.itemId.toString(),body:e.body,mentionsList:a,parentId:e.parentId?.toString()},i=await this.mondayApi.request(bT,t);if(!i.create_update?.id)throw new Error("Failed to create update: no update created");return{content:{message:`Update ${i.create_update.id} created on item ${e.itemId}`,update_id:i.create_update.id,item_id:e.itemId,item_name:i.create_update.item?.name,item_url:i.create_update.item?.url}}}catch(e){uT(e,"create update")}}},class extends bu{constructor(){super(...arguments),this.name="get_updates",this.type=y.READ,this.annotations=gu({title:"Get Updates",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get updates (comments/posts) from a monday.com item or board. Specify objectId and objectType (Item or Board) to retrieve updates. For Board queries, you can filter by date range using fromDate and toDate (both required together, ISO8601 format). By default, Board queries return only board discussion; set includeItemUpdates to true to also include updates on individual items. Returns update text, creator info, timestamps, and optionally replies and assets."}getInputSchema(){return IT}async executeInternal(e){try{const a=void 0!==e.fromDate,t=void 0!==e.toDate;if(a!==t)throw new Error("Both fromDate and toDate must be provided together for date range filtering");if((a||t)&&e.objectType===ET.Item)throw new Error("Date range filtering (fromDate/toDate) is only supported for Board objectType");const i={limit:e.limit??25,page:e.page??1,includeReplies:e.includeReplies??!1,includeAssets:e.includeAssets??!1};let n;n=e.objectType===ET.Item?await this.mondayApi.request(xT,{...i,itemId:e.objectId}):await this.mondayApi.request(TT,{...i,boardId:e.objectId,boardUpdatesOnly:!e.includeItemUpdates,...e.fromDate&&e.toDate?{fromDate:ST(e.fromDate),toDate:ST(e.toDate)}:{}});const o=e.objectType===ET.Item?n.items?.[0]?.updates:n.boards?.[0]?.updates;if(!o||0===o.length)return{content:`No updates found for ${e.objectType.toLowerCase()} with id ${e.objectId}`};const r=o.map((a=>{const t={id:a.id,text_body:a.text_body,created_at:a.created_at,updated_at:a.updated_at,creator:a.creator?{id:a.creator.id,name:a.creator.name}:null,item_id:a.item_id};return e.includeReplies&&a.replies&&(t.replies=a.replies.map((e=>({id:e.id,text_body:e.text_body,created_at:e.created_at,updated_at:e.updated_at,creator:e.creator?{id:e.creator.id,name:e.creator.name}:null})))),e.includeAssets&&a.assets&&(t.assets=a.assets.filter((e=>!!e)).map((e=>({id:e.id,name:e.name,url:e.url,file_extension:e.file_extension,file_size:e.file_size,created_at:e.created_at})))),t})),s=e.objectType===ET.Item?n.items?.[0]?.url:n.boards?.[0]?.url;return{content:{message:"Updates retrieved",[`${e.objectType.toLowerCase()}_id`]:e.objectId,url:s,updates:r,pagination:{page:e.page??1,limit:e.limit??25,count:r.length}}}}catch(e){uT(e,"get updates")}}},class extends bu{constructor(){super(...arguments),this.name="create_update_in_monday",this.type=y.WRITE,this.annotations=gu({title:"Create Update in Monday, after calling this tool you should",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new update (comment/post) on a monday.com item. Updates can be used to add comments, notes, or discussions to items. You can optionally mention users, teams, or boards in the update. After calling this tool you should call the full board data tool to get data, and immediately after that call the show table tool to show the data from that tool. IMPORTANT: You MUST use the COMPLETE data from the full board data tool - do NOT cut, truncate, or omit any data. Pass the entire dataset to the show table tool."}getInputSchema(){return II}async executeInternal(e){let a;if(e.mentionsList)try{const t=JSON.parse(e.mentionsList),i=EI.safeParse(t);if(!i.success)throw new Error(`Invalid mentionsList format: ${i.error.message}`);a=i.data}catch(e){throw new Error(`Invalid mentionsList JSON format: ${e.message}`)}try{const t={itemId:e.itemId.toString(),body:e.body,mentionsList:a},i=await this.mondayApi.request(bT,t);if(!i.create_update?.id)throw new Error("Failed to create update: no update created");return{content:`Update ${i.create_update.id} successfully created on item ${e.itemId}. Now we want to show the updated data, so call the full board data tool to get data, and then immediately after that call the show table tool to show the data from that tool. CRITICAL: You MUST pass the COMPLETE and FULL data from the full board data tool to the show table tool - do NOT cut, summarize, truncate, or omit ANY data. Use the entire dataset exactly as received.`}}catch(e){uT(e,"create update")}}},class extends bu{constructor(){super(...arguments),this.name="get_board_schema",this.type=y.READ,this.annotations=gu({title:"Get Board Schema",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get board schema (columns and groups) by board id"}getInputSchema(){if(!this.context?.boardId)return JT}async executeInternal(e){const a=this.context?.boardId??e.boardId,t={boardId:a.toString()},i=await this.mondayApi.request(pw,t);return{content:`The current schema of the board ${a} is: \n \n\nColumns:\n ${i.boards?.[0]?.columns?.map((e=>`Id - ${e?.id}\n Title - ${e?.title}\n Type - ${e?.type}`)).join("\n")}\n \n\nGroups:\n ${i.boards?.[0]?.groups?.map((e=>`Id - ${e?.id}\n Title - ${e?.title}`)).join("\n")}`}}},class extends bu{constructor(){super(...arguments),this.name="get_board_activity",this.type=y.READ,this.annotations=gu({title:"Get Board Activity",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0}),this.defaultLimit=1e3}getDescription(){return"Get board activity logs for a specified time range (defaults to last 30 days)"}getInputSchema(){return PT}async executeInternal(e){const a=new Date,t=new Date(a.getTime()-lT.MONTH30Days),i=e?.fromDate||t.toISOString(),n=e?.toDate||a.toISOString(),o={boardId:e.boardId.toString(),fromDate:i,toDate:n,limit:this.defaultLimit,page:1,includeData:e.includeData??!1},r=await this.mondayApi.request(FT,o),s=r.boards?.[0]?.activity_logs;if(!s||0===s.length)return{content:`No activity found for board ${e.boardId} in the specified time range (${i} to ${n}).`};const p=r.boards?.[0],d=e.includeData??!1;return{content:{message:"Board activity retrieved",board_id:e.boardId,board_name:p?.name,board_url:p?.url,data:s.filter((e=>null!=e)).map((e=>({created_at:e.created_at,event:e.event,entity:e.entity,user_id:e.user_id,...d&&e.data?{data:e.data}:{}})))}}}},class extends bu{constructor(){super(...arguments),this.name="get_board_info",this.type=y.READ,this.annotations=gu({title:"Get Board Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get comprehensive board information including metadata, structure, owners, and configuration. Also returns the board's views (e.g. table views, filter views) — each view includes its id, name, type, and a structured `filter` object. "}getInputSchema(){return HT}async executeInternal(e){const a={boardId:e.boardId.toString()},t=await this.mondayApi.request(jT,a),i=t.boards?.[0];if(!i)return{content:`Board with id ${e.boardId} not found or you don't have access to it.`};const n=await this.getSubItemsBoardAsync(i);return{content:UT(i,n)}}async getSubItemsBoardAsync(e){const a=e.columns?.find((e=>e?.type===Jx.Subtasks));if(!a)return null;const t=a.settings.boardIds[0],i=await this.mondayApi.request(VT,{boardId:t});return i.boards?.[0]??null}},class extends bu{constructor(){super(...arguments),this.name="get_full_board_data",this.type=y.READ,this.annotations=gu({title:"Get Full Board Data",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"INTERNAL USE ONLY - DO NOT CALL THIS TOOL DIRECTLY. This tool is exclusively triggered by UI components and should never be invoked directly by the agent."}getInputSchema(){return LT}async executeInternal(e){try{const a={boardId:e.boardId,itemsLimit:7};e.filters&&(a.queryParams={operator:e.filtersOperator,rules:e.filters.map((e=>({column_id:e.columnId.toString(),compare_value:e.compareValue,operator:e.operator,compare_attribute:e.compareAttribute})))});const t=await this.mondayApi.request(kT,a);if(!t.boards||0===t.boards.length||!t.boards[0])throw new Error(`Board with ID ${e.boardId} not found`);const i=t.boards[0],n=new Set;i.items_page.items.forEach((e=>{e.updates?.forEach((e=>{e.creator_id&&n.add(e.creator_id),e.replies?.forEach((e=>{e.creator_id&&n.add(e.creator_id)}))})),e.column_values.forEach((e=>{if("persons_and_teams"in e){const a=e;a.persons_and_teams?.forEach((e=>{"person"===e.kind&&e.id&&n.add(e.id)}))}}))}));const o=Array.from(n).filter((e=>!(Number(e)<0)));let r=[];if(o.length>0){const e={userIds:o},a=await this.mondayApi.request(RT,e);r=a.users?.filter((e=>null!==e))||[]}const s=new Map(r.map((e=>[e.id,e])));return{content:{board:{id:i.id,name:i.name,columns:i.columns,items:i.items_page.items.map((e=>({id:e.id,name:e.name,column_values:e.column_values,updates:e.updates?.map((e=>({id:e.id,creator_id:e.creator_id||"",creator:e.creator_id&&s.get(e.creator_id)||null,text_body:e.text_body,created_at:e.created_at,replies:e.replies?.map((e=>({id:e.id,creator_id:e.creator_id||"",creator:e.creator_id&&s.get(e.creator_id)||null,text_body:e.text_body,created_at:e.created_at})))||[]})))||[]})))},users:r,stats:{total_items:i.items_page.items.length,total_updates:i.items_page.items.reduce(((e,a)=>e+(a.updates?.length||0)),0),total_unique_creators:r.length}}}}catch(e){uT(e,"get full board data")}}},class extends bu{constructor(){super(...arguments),this.name="list_users_and_teams",this.type=y.READ,this.annotations=gu({title:"List Users and Teams",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Tool to fetch users and/or teams data. \n\n MANDATORY BEST PRACTICES:\n 1. ALWAYS use specific IDs or names when available\n 2. If no ids available, use name search if possible (USERS ONLY)\n 3. Use 'getMe: true' to get current user information\n 4. AVOID broad queries (no parameters) - use only as last resort\n\n REQUIRED PARAMETER PRIORITY (use in this order):\n 1. getMe - STANDALONE\n 2. userIds\n 3. name - STANDALONE (USERS ONLY, NOT for teams)\n 4. teamIds + teamsOnly\n 5. No parameters - LAST RESORT\n\n CRITICAL USAGE RULES:\n • userIds + teamIds requires explicit includeTeams: true flag\n • includeTeams: true fetches both users and teams, do not use this to fetch a specific user's teams rather fetch that user by id and you will get their team memberships.\n • name parameter is for USER search ONLY - it cannot be used to search for teams. Use teamIds to fetch specific teams."}getInputSchema(){return AE}async executeInternal(e){const a=e.userIds&&e.userIds.length>0,t=e.teamIds&&e.teamIds.length>0,i=e.includeTeams||!1,n=e.teamsOnly||!1,o=e.includeTeamMembers||!1,r=!!e.name;if(e.getMe||!1){if(a||t||i||n||o||r)return{content:"PARAMETER_CONFLICT: getMe is STANDALONE only. Remove all other parameters when using getMe: true for current user lookup."};const e=await this.mondayApi.request(bE);if(!e.me)return{content:"AUTHENTICATION_ERROR: Current user fetch failed. Verify API token and user permissions."};const s={users:[e.me]},p=wE(s),d=await SE(this.mondayApi);return{content:{data:p,action_name:"Users and teams",url:d?`https://${d}.monday.com/teams/all`:void 0}}}if(r){if(a||t||i||n||o)return{content:"PARAMETER_CONFLICT: name is STANDALONE only. Remove userIds, teamIds, includeTeams, teamsOnly, and includeTeamMembers when using name search."};const r={name:e.name},s=await this.mondayApi.request(gE,r);if(!s.users||0===s.users.length)return{content:`NAME_SEARCH_EMPTY: No users found matching "${e.name}". Try broader search terms or verify user exists in account.`};const p=s.users.filter((e=>null!==e)).map((e=>`• **${e.name}** (ID: ${e.id})${e.title?` - ${e.title}`:""}`)).join("\n"),d=`Found ${s.users.length} user(s) matching "${e.name}":\n\n${p}`,c=await SE(this.mondayApi);return{content:{data:d,action_name:"Users and teams",url:c?`https://${c}.monday.com/teams/all`:void 0}}}if(n&&i)return{content:"PARAMETER_CONFLICT: Cannot use teamsOnly: true with includeTeams: true. Use teamsOnly for teams-only queries or includeTeams for combined data."};if(a&&e.userIds&&e.userIds.length>xE)return{content:`LIMIT_EXCEEDED: userIds array too large (${e.userIds.length}/500). Split into batches of max 500 IDs and make multiple calls.`};if(t&&e.teamIds&&e.teamIds.length>TE)return{content:`LIMIT_EXCEEDED: teamIds array too large (${e.teamIds.length}/500). Split into batches of max 500 IDs and make multiple calls.`};let s;if(n||!a&&t&&!i)if(o){const a={teamIds:e.teamIds};s=await this.mondayApi.request(vE,a)}else{const a={teamIds:e.teamIds};s=await this.mondayApi.request(hE,a)}else if(i){const a={userIds:e.userIds,teamIds:e.teamIds,limit:EE};s=await this.mondayApi.request(fE,a)}else if(a){const a={userIds:e.userIds,limit:EE};s=await this.mondayApi.request(mE,a)}else{const e={userIds:void 0,limit:EE};s=await this.mondayApi.request(uE,e)}const p=wE(s),d=await SE(this.mondayApi);return{content:{data:p,action_name:"Users and teams",url:d?`https://${d}.monday.com/teams/all`:void 0}}}},Sw,class extends bu{constructor(){super(...arguments),this.name="move_item_to_group",this.type=y.WRITE,this.annotations=gu({title:"Move Item to Group",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Move an item to a group in a monday.com board"}getInputSchema(){return DE}async executeInternal(e){const a={itemId:e.itemId.toString(),groupId:e.groupId},t=await this.mondayApi.request(cw,a);return{content:`Item ${t.move_item_to_group?.id} successfully moved to group ${e.groupId}`}}},class extends bu{constructor(){super(...arguments),this.name="create_board",this.type=y.WRITE,this.annotations=gu({title:"Create Board",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com board"}getInputSchema(){return Nw}async executeInternal(e){const a={boardName:e.boardName,boardKind:e.boardKind,boardDescription:e.boardDescription,workspaceId:e.workspaceId},t=await this.mondayApi.request(lw,a);return{content:{message:`Board ${t.create_board?.id} successfully created`,board_id:t.create_board?.id,board_name:t.create_board?.name,board_url:t.create_board?.url}}}},class extends bu{constructor(){super(...arguments),this.name="create_form",this.type=y.WRITE,this.annotations=gu({title:"Create Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com form. This will create a new form as well as a new board for which the form’s responses will be stored. The returned board_id is the ID of the board that was created while the returned formToken can be used for all future queries and mutations to continue editing the form."}getInputSchema(){return rx}async executeInternal(e){const a={destination_workspace_id:e.destination_workspace_id,destination_folder_id:e.destination_folder_id,destination_folder_name:e.destination_folder_name,board_kind:e.board_kind,destination_name:e.destination_name,board_owner_ids:e.board_owner_ids,board_owner_team_ids:e.board_owner_team_ids,board_subscriber_ids:e.board_subscriber_ids,board_subscriber_teams_ids:e.board_subscriber_teams_ids},t=await this.mondayApi.request(jw,a);return{content:{message:"Form created successfully",board_id:t.create_form?.boardId,form_token:t.create_form?.token}}}},class extends bu{constructor(){super(...arguments),this.name="update_form",this.type=y.WRITE,this.annotations=gu({title:"Update Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0}),this.helpers=new Kx(this.mondayApi),this.actionHandlers=new Map([[Sx.setFormPassword,this.helpers.setFormPassword.bind(this.helpers)],[Sx.shortenFormUrl,this.helpers.shortenFormUrl.bind(this.helpers)],[Sx.deactivate,this.helpers.deactivateForm.bind(this.helpers)],[Sx.activate,this.helpers.activateForm.bind(this.helpers)],[Sx.createTag,this.helpers.createTag.bind(this.helpers)],[Sx.deleteTag,this.helpers.deleteTag.bind(this.helpers)],[Sx.updateTag,this.helpers.updateTag.bind(this.helpers)],[Sx.updateAppearance,this.helpers.updateAppearance.bind(this.helpers)],[Sx.updateAccessibility,this.helpers.updateAccessibility.bind(this.helpers)],[Sx.updateFeatures,this.helpers.updateFeatures.bind(this.helpers)],[Sx.updateQuestionOrder,this.helpers.updateQuestionOrder.bind(this.helpers)],[Sx.updateFormHeader,this.helpers.updateFormHeader.bind(this.helpers)]])}getDescription(){return'Update a monday.com form. Handles the following form update actions that can only be done one at a time using the correct "action" input: \n - update form\'s feature settings with the action "updateFeatures",\n - update form\'s appearance settings with the action "updateAppearance",\n - update form\'s accessibility settings with the action "updateAccessibility",\n - update form\'s title with the action "updateFormHeader",\n - update form\'s description with the action "updateFormHeader",\n - update form\'s question order with the action "updateQuestionOrder",\n - create a new form tag with the action "createTag",\n - delete a form tag with the action "deleteTag",\n - update a form tag with the action "updateTag",\n - set or update the form\'s password with the action "setFormPassword"\n - shorten form\'s url with the action "shortenFormUrl"\n - deactivate form with the action "deactivateForm"\n - reactivate form with the action "activateForm"'}getInputSchema(){return Yx}async executeInternal(e){const a=this.actionHandlers.get(e.action);return a?await a(e):{content:"Received an invalid action for the update form tool."}}},class extends bu{constructor(){super(...arguments),this.name="get_form",this.type=y.READ,this.annotations=gu({title:"Get Form",readOnlyHint:!0,destructiveHint:!1})}getDescription(){return"Get a monday.com form by its form token. Form tokens can be extracted from the form’s url. Given a form url, such as https://forms.monday.com/forms/abc123def456ghi789?r=use1, the token is the alphanumeric string that appears right after /forms/ and before the ?. In the example, the token is abc123def456ghi789."}getInputSchema(){return Qx}async executeInternal(e){const a={formToken:e.formToken},t=await this.mondayApi.request(Vw,a);return t.form?{content:{message:"Form retrieved",form_token:e.formToken,data:t.form}}:{content:`Form with token ${e.formToken} not found or you don't have access to it.`}}},class extends bu{constructor(){super(...arguments),this.name="form_questions_editor",this.type=y.WRITE,this.annotations=gu({title:"Form Questions Editor",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1}),this.helpers=new Ix(this.mondayApi),this.actionHandlers=new Map([[xx.Delete,this.helpers.deleteQuestion.bind(this.helpers)],[xx.Update,this.helpers.updateQuestion.bind(this.helpers)],[xx.Create,this.helpers.createQuestion.bind(this.helpers)]])}getDescription(){return"Create, update, or delete a question in a monday.com form"}getInputSchema(){return Ex}async executeInternal(e){const a=this.actionHandlers.get(e.action);return a?await a(e):{content:`Unknown action: ${e.action}`}}},class extends bu{constructor(){super(...arguments),this.name="create_column",this.type=y.WRITE,this.annotations=gu({title:"Create Column",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new column in a monday.com board"}getInputSchema(){return this.context?.boardId?Xx:Zx}async executeInternal(e){const a=this.context?.boardId??e.boardId,t={boardId:a?.toString()??"",columnType:e.columnType,columnTitle:e.columnTitle,columnDescription:e.columnDescription,columnSettings:"string"==typeof e.columnSettings?JSON.parse(e.columnSettings):e.columnSettings},i=await this.mondayApi.request(mw,t);return{content:{message:"Column successfully created",column_id:i.create_column?.id,column_title:i.create_column?.title}}}},class extends bu{constructor(){super(...arguments),this.name="create_group",this.type=y.WRITE,this.annotations=gu({title:"Create Group",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new group in a monday.com board. Groups are sections that organize related items. Use when users want to add structure, categorize items, or create workflow phases. Groups can be positioned relative to existing groups and assigned predefined colors. Items will always be created in the top group and so the top group should be the most relevant one for new item creation"}getInputSchema(){return oT}async executeInternal(e){const a={boardId:e.boardId,groupName:e.groupName,groupColor:e.groupColor,relativeTo:e.relativeTo,positionRelativeMethod:e.positionRelativeMethod},t=await this.mondayApi.request(iT,a);return{content:{message:"Group created successfully",group_id:t.create_group?.id,group_title:t.create_group?.title,board_id:e.boardId,group_name:e.groupName}}}},class extends bu{constructor(){super(...arguments),this.name="delete_column",this.type=y.WRITE,this.annotations=gu({title:"Delete Column",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete a column from a monday.com board"}getInputSchema(){return this.context?.boardId?NT:AT}async executeInternal(e){const a={boardId:(this.context?.boardId??e.boardId).toString(),columnId:e.columnId},t=await this.mondayApi.request(uw,a);return{content:`Column ${t.delete_column?.id} successfully deleted`}}},Tw,class extends bu{constructor(){super(...arguments),this.name="get_graphql_schema",this.type=y.ALL_API,this.annotations=gu({title:"Get GraphQL Schema",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Fetch the monday.com GraphQL schema structure including query and mutation definitions. This tool returns available query fields, mutation fields, and a list of GraphQL types in the schema. You can filter results by operation type (read/write) to focus on either queries or mutations."}getInputSchema(){return aE}async executeInternal(e){try{const a=await this.mondayApi.request(fw),t=e?.operationType,i=a.queryType?.fields?.map((e=>`- ${e.name}${e.description?`: ${e.description}`:""}`)).join("\n")||"No query fields found",n=a.mutationType?.fields?.map((e=>`- ${e.name}${e.description?`: ${e.description}`:""}`)).join("\n")||"No mutation fields found",o=a.__schema,r=o?.types?.filter((e=>e.name&&!e.name.startsWith("__"))).map((e=>`- ${e.name} (${e.kind||"unknown"})`)).join("\n")||"No types found";let s="## GraphQL Schema\n";return t&&"read"!==t||(s+=`- Query Type: ${a.__schema?.queryType?.name}\n\n`,s+=`## Query Fields\n${i}\n\n`),t&&"write"!==t||(s+=`- Mutation Type: ${a.__schema?.mutationType?.name}\n\n`,s+=`## Mutation Fields\n${n}\n\n`),s+=`## Available Types\n${r}\n\n`,s+='To get detailed information about a specific type, use the get_type_details tool with the type name.\nFor example: get_type_details(typeName: "Board") to see Board type details.',{content:s}}catch(e){return{content:`Error fetching GraphQL schema: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends bu{constructor(){super(...arguments),this.name="get_column_type_info",this.type=y.READ,this.annotations=gu({title:"Get Column Type Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Retrieves comprehensive information about a specific column type, including JSON schema definition and other metadata. Use this before creating columns with the create_column tool to understand the structure, validation rules, and available properties for column settings."}getInputSchema(){return eE}async executeInternal(e){const a={type:e.columnType},t=await this.mondayApi.request(XT,a);if(!t?.get_column_type_schema)return{content:`Information for column type "${e.columnType}" not found or not available.`};const i={schema:t.get_column_type_schema};return{content:{message:`Column type info for ${e.columnType}`,data:i,url:ZT}}}},class extends bu{constructor(){super(...arguments),this.name="get_type_details",this.type=y.ALL_API,this.annotations=gu({title:"Get Type Details",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get detailed information about a specific GraphQL type from the monday.com API schema"}getInputSchema(){return tE}async executeInternal(e){try{if(!e.typeName)return{content:"Error: typeName is required. Please provide a valid GraphQL type name."};const t=(a=e.typeName,ow`
1793
+ `,uS={};const fS=[class extends bu{constructor(){super(...arguments),this.name="get_monday_dev_sprints_boards",this.type=y.READ,this.annotations=gu({title:"monday-dev: Get Sprints Boards",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Discover monday-dev sprints boards and their associated tasks boards in your account.\n\n## Purpose:\nIdentifies and returns monday-dev sprints board IDs and tasks board IDs that you need to use with other monday-dev tools. \nThis tool scans your recently used boards (up to 100) to find valid monday-dev sprint management boards.\n\n## What it Returns:\n- Pairs of sprints boards and their corresponding tasks boards\n- Board IDs, names, and workspace information for each pair\n- The bidirectional relationship between each sprints board and its tasks board\n\n## Note:\nSearches recently used boards (up to 100). If none found, ask user to provide board IDs manually."}getInputSchema(){return uS}async executeInternal(e){try{const e={limit:100},a=((await this.mondayApi.request(mS,e)).boards||[]).filter((e=>null!==e));if(0===a.length)return{content:`${BI} No boards found in your account. Please verify you have access to monday.com boards.`};const t=this.extractBoardPairs(a);if(0===t.length)return{content:this.generateNotFoundMessage(a.length)};return{content:this.generateReport(t)}}catch(e){return{content:`${WI} Error retrieving sprints boards: ${e instanceof Error?e.message:"Unknown error"}`}}}generateMultiplePairsWarning(e){return`## ⚠️ Multiple SprintsBoard Detected\n**${e}** different board pairs found. Each pair is isolated and workspace-specific.\n**AI Agent - REQUIRED:** Before ANY operation, confirm with user which pair and workspace to use.\n---\n`}generatePairDetails(e,a){return`### Pair ${a+1}\n**Sprints Board:**\n- ID: \`${e.sprintsBoard.id}\`\n- Name: ${e.sprintsBoard.name}\n- Workspace: ${e.sprintsBoard.workspaceName} (ID: ${e.sprintsBoard.workspaceId})\n\n**Tasks Board:**\n- ID: \`${e.tasksBoard.id}\`\n- Name: ${e.tasksBoard.name}\n- Workspace: ${e.tasksBoard.workspaceName} (ID: ${e.tasksBoard.workspaceId})\n---\n\n`}generateTechnicalReference(){return"## 📋 Technical Reference\n\n**Sprint Operations** (all require correct board pair):\n• Add to Sprint: Update `task_sprint` column with sprint item ID\n• Remove from Sprint: Clear `task_sprint` column (set to null)\n• Search in Sprint: Filter where `task_sprint` equals sprint item ID\n• Move Between Sprints: Update `task_sprint` with new sprint item ID\n• Backlog Tasks: `task_sprint` is empty/null\n\n**Critical:** `task_sprint` column references ONLY its paired sprints board. Cross-pair operations WILL FAIL."}generateReport(e){const a=e.length>1?this.generateMultiplePairsWarning(e.length):"",t=e.map(((e,a)=>this.generatePairDetails(e,a))).join(""),i=this.generateTechnicalReference();return`# Monday-Dev Sprints Boards Discovery\n\n${a}## Boards\n\nFound **${e.length}** matched pair(s):\n\n${t}${i}`}generateNotFoundMessage(e){return`## No Monday-Dev Sprints Board Pairs Found\n\n**Boards Checked:** ${e} (recently used)\n\nNo board pairs with sprint relationships found in your recent boards.\n\n### Possible Reasons:\n1. Boards exist but not accessed recently by your account\n2. Missing access permissions to sprint/task boards\n3. Monday-dev product was not set up in account\n\n### Next Steps:\n1. Ask user to access monday-dev boards in UI to refresh recent boards list\n2. Ask user to verify permissions to view sprint and task boards\n3. Ask user to provide board IDs manually if known`}createBoardInfo(e,a,t){return{id:e,name:a?.name||t,workspaceId:a?.workspace?.id||"unknown",workspaceName:a?.workspace?.name||"Unknown"}}processSprintsBoard(e,a,t){const i=pS(e,VI.SPRINT_TASKS);if(!i)return;const n=sS(i);if(!n)return;const o=`${e.id}:${n}`;if(t.has(o))return;const r=a.get(n);t.set(o,{sprintsBoard:this.createBoardInfo(e.id,e,`Sprints Board ${e.id}`),tasksBoard:this.createBoardInfo(n,r,`Tasks Board ${n}`)})}processTasksBoard(e,a,t){const i=pS(e,KI);if(!i)return;const n=sS(i);if(!n)return;const o=`${n}:${e.id}`;if(t.has(o))return;const r=a.get(n);t.set(o,{sprintsBoard:this.createBoardInfo(n,r,`Sprints Board ${n}`),tasksBoard:this.createBoardInfo(e.id,e,`Tasks Board ${e.id}`)})}extractBoardPairs(e){const a=new Map,t=new Map(e.map((e=>[e.id,e])));for(const i of e)i.columns&&(oS(i)&&this.processSprintsBoard(i,t,a),rS(i)&&this.processTasksBoard(i,t,a));return Array.from(a.values())}},class extends bu{constructor(){super(...arguments),this.name="get_sprints_metadata",this.type=y.READ,this.annotations=gu({title:"monday-dev: Get Sprints Metadata",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get comprehensive sprint metadata from a monday-dev sprints board including:\n\n## Data Retrieved:\nA table of sprints with the following information:\n- Sprint ID\n- Sprint Name\n- Sprint timeline (planned from/to dates)\n- Sprint completion status (completed/in-progress/planned)\n- Sprint start date (actual)\n- Sprint end date (actual)\n- Sprint activation status\n- Sprint summary document object ID\n\n## Parameters:\n- **limit**: Number of sprints to retrieve (default: 25, max: 100)\n\nRequires the Main Sprints board ID of the monday-dev containing your sprints."}getInputSchema(){return lS}async executeInternal(e){try{const a=await this.validateBoardSchema(e.sprintsBoardId.toString());if(!a.success)return{content:a.error||"Board schema validation failed"};const t={boardId:e.sprintsBoardId.toString(),limit:e.limit},i=await this.mondayApi.request(cS,t),n=i.boards?.[0],o=n?.items_page?.items||[];return{content:this.generateSprintsMetadataReport(o)}}catch(e){return{content:`${WI} Error retrieving sprints metadata: ${e instanceof Error?e.message:"Unknown error"}`}}}async validateBoardSchema(e){try{const a={boardId:e.toString()},t=await this.mondayApi.request(pw,a),i=t.boards?.[0];if(!i)return{success:!1,error:`${BI} Board with ID ${e} not found. Please verify the board ID is correct and you have access to it.`};const n=i.columns||[],o=this.validateSprintsBoardSchemaFromColumns(n);return o.isValid?{success:!0}:{success:!1,error:`${YI} ${o.errorMessage}`}}catch(e){return{success:!1,error:`${WI} Error validating board schema: ${e instanceof Error?e.message:"Unknown error"}`}}}validateSprintsBoardSchemaFromColumns(e){const a=new Set(e.filter((e=>null!==e)).map((e=>e.id))),t=Object.values(VI),i=iS(a,t);if(!i.isValid){let e="BoardID provided is not a valid sprints board. Missing required columns:\n\n";return i.missingColumns.forEach((a=>{const t=(e=>QI[e]||e)(a);e+=`- ${t}\n`})),{isValid:!1,errorMessage:e}}return{isValid:!0,errorMessage:""}}generateSprintsMetadataReport(e){let a="# Sprints Metadata Report\n\n";return a+=`**Total Sprints:** ${e.length}\n\n`,a+="| Sprint Name | Sprint ID | Status | Timeline (Planned) | Start Date (Actual) | End Date (Actual) | Completion | Summary Document ObjectID |\n",a+="|-------------|-----------|--------|--------------------|---------------------|-------------------|------------|---------------------------|\n",e.forEach((e=>{const t=e.name||"Unknown",i=e.id,n=eS(e,UI.SPRINT_ACTIVATION),o=eS(e,UI.SPRINT_COMPLETION),r=aS(e,UI.SPRINT_START_DATE),s=aS(e,UI.SPRINT_END_DATE),p=((e,a)=>{const t=ZI(e,a);if("TimelineValue"===t?.__typename&&t.from&&t.to)return{from:t.from.split("T")[0],to:t.to.split("T")[0]};return null})(e,UI.SPRINT_TIMELINE),d=tS(e,UI.SPRINT_SUMMARY);let c=JI.Planned;o?c=JI.Completed:(n||r)&&(c=JI.Active);const l=p?`${p.from} to ${p.to}`:"Not set";a+=`| ${t} | ${i} | ${c} | ${l} | ${r||"Not started"} | ${s||"Not ended"} | ${o?"Yes":"No"} | ${d||"No document"} |\n`})),a+="\n## Status Definitions:\n",a+=`- **${JI.Planned}**: Sprint not yet started (no activation, no start date)\n`,a+=`- **${JI.Active}**: Sprint is active (activated but not completed)\n`,a+=`- **${JI.Completed}**: Sprint is finished\n\n`,a}},class extends bu{constructor(){super(...arguments),this.name="get_sprint_summary",this.type=y.READ,this.annotations=gu({title:"monday-dev: Get Sprint Summary",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Get the complete summary and analysis of a sprint.\n\n## Purpose:\nUnlock deep insights into completed sprint performance. \n\nThe sprint summary content including:\n- **Scope Management**: Analysis of planned vs. unplanned tasks, scope creep\n- **Velocity & Performance**: Individual velocity, task completion rates, workload distribution per team member\n- **Task Distribution**: Breakdown of completed tasks by type (Feature, Bug, Tech Debt, Infrastructure, etc.)\n- **AI Recommendations**: Action items, process improvements, retrospective focus areas\n\n## Requirements:\n- Sprint must be completed and must be created after 1/1/2025 \n\n## Important Note:\nWhen viewing the section "Completed by Assignee", you\'ll see user IDs in the format "@user-12345678". the 8 digits after the @is the user ID. To retrieve the actual owner names, use the list_users_and_teams tool with the user ID and set includeTeams=false for optimal performance.\n\n'}getInputSchema(){return dS}async executeInternal(e){try{const a=await this.getSprintMetadata(e.sprintId);if(!a.success)return{content:a.error||`${WI} Unknown error occurred while getting sprint metadata`};const t=await this.readSprintSummaryDocument(a.documentObjectId);return t.success?{content:t.content}:{content:t.error||`${WI} Unknown error occurred while reading document content`}}catch(e){return{content:`${WI} Error retrieving sprint summary: ${e instanceof Error?e.message:"Unknown error"}`}}}async getSprintMetadata(e){try{const a={ids:[String(e)]},t=(await this.mondayApi.request(jI,a)).items||[];if(0===t.length)return{success:!1,error:`${MI} Sprint with ID ${e} not found. Please verify the sprint ID is correct.`};const i=t[0];if(!i)return{success:!1,error:`${MI} Sprint with ID ${e} not found.`};const n=((e,a=[])=>{const t=new Set((e.column_values||[]).map((e=>e.id))),i=[...Object.values(VI),...a];return iS(t,i)})(i,[UI.SPRINT_SUMMARY]);if(!n.isValid)return{success:!1,error:`${YI} Sprint item is missing required columns: ${n.missingColumns.join(", ")}. This may not be a valid sprint board item.`};const o=tS(i,UI.SPRINT_SUMMARY);return o?{success:!0,documentObjectId:o,sprintName:i.name}:{success:!1,error:`${qI} No sprint summary document found for sprint "${i.name}" (ID: ${e}). Sprint summary is only available for completed sprints that have analysis documents.`}}catch(e){return{success:!1,error:`${WI} Error getting sprint item: ${e instanceof Error?e.message:"Unknown error"}`}}}async readSprintSummaryDocument(e){try{const a={object_ids:[e],limit:1},t=(await this.mondayApi.request(yw,a)).docs||[];if(0===t.length)return{success:!1,error:`${qI} Document with object ID ${e} not found or not accessible.`};const i=t[0];if(!i||!i.id)return{success:!1,error:`${GI} Document data is invalid for object ID ${e}.`};const n={docId:i.id,blockIds:[]},o=await this.mondayApi.request(_w,n);if(!o.export_markdown_from_doc?.success)return{success:!1,error:`${zI} Failed to export markdown from document: ${o.export_markdown_from_doc?.error||"Unknown error"}`};const r=o.export_markdown_from_doc.markdown;return r?{success:!0,content:r}:{success:!1,error:`${HI} Document content is empty or could not be retrieved.`}}catch(e){return{success:!1,error:`${WI} Error reading document: ${e instanceof Error?e.message:"Unknown error"}`}}}}],hS=[class extends bu{constructor(){super(...arguments),this.name="delete_item",this.type=y.WRITE,this.annotations=gu({title:"Delete Item",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an item"}getInputSchema(){return DT}async executeInternal(e){const a={id:e.itemId.toString()},t=await this.mondayApi.request(rw,a);return{content:`Item ${t.delete_item?.id} successfully deleted`}}},class extends bu{constructor(){super(...arguments),this.name="get_board_items_page",this.type=y.READ,this.annotations=gu({title:"Get Board Items Page",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get all items from a monday.com board with pagination support and optional column values and item descriptions. Returns structured JSON with item details, creation/update timestamps, and pagination info. Use the 'nextCursor' parameter from the response to get the next page of results when 'has_more' is true. To retrieve an item's description (the rich-text body/details of a monday.com item), set 'includeItemDescription' to true — the response will include the item description's document blocks with their content, type, and id. Use this whenever the user asks about an item's description, body, details, or notes. [REQUIRED PRECONDITION]: Before using this tool, if new columns were added to the board or if you are not familiar with the board's structure (column IDs, column types, status labels, etc.), first use get_board_info to understand the board metadata. This is essential for constructing proper filters and knowing which columns are available. VIEW-BASED FILTERING: If the user refers to a board view by name (e.g. \"show me items in the 'Overdue' view\"), first call get_board_info to get the board's views, find the matching view by name, then extract its filter field and pass it as the filters argument here."}getInputSchema(){return QT}async executeInternal(e){const a=!e.cursor;if(a&&e.searchTerm)try{if(e.itemIds=await this.getItemIdsFromSmartSearchAsync(e),0===e.itemIds.length)return{content:"No items found matching the specified searchTerm"}}catch(a){fT(a),e.filters=this.rebuildFiltersWithManualSearch(e.searchTerm,e.filters)}const t={boardId:e.boardId.toString(),limit:e.limit,cursor:e.cursor||void 0,includeColumns:e.includeColumns,columnIds:e.columnIds,includeSubItems:e.includeSubItems,includeDescription:e.includeItemDescription};a&&(e.itemIds||e.filters||e.orderBy)&&(t.queryParams={ids:e.itemIds?.map((e=>e.toString())),operator:e.filtersOperator,rules:e.filters?.map((e=>({column_id:e.columnId.toString(),compare_value:e.compareValue,operator:e.operator,compare_attribute:e.compareAttribute}))),order_by:e.orderBy?.map((e=>({column_id:e.columnId,direction:e.direction})))});const i=await this.mondayApi.request(zT,t);return{content:this.mapResult(i,e)}}rebuildFiltersWithManualSearch(e,a){return(a=(a=a??[]).filter((e=>"name"!==e.columnId))).push({columnId:"name",operator:Ub.ContainsText,compareValue:e}),a}mapResult(e,a){const t=e.boards?.[0],i=t?.items_page,n=i?.items||[];return{board:{id:t?.id,name:t?.name},items:n.map((e=>this.mapItem(e,a))),pagination:{has_more:!!i?.cursor,nextCursor:i?.cursor||null,count:n.length}}}mapItem(e,a){const t={id:e.id,name:e.name,url:e.url,created_at:e.created_at,updated_at:e.updated_at};if(a.includeColumns&&e.column_values){t.column_values={};for(const a of e.column_values)t.column_values[a.id]=this.getColumnValueData(a)}if(a.includeItemDescription&&"description"in e&&e.description){const a=(e.description.blocks??[]).filter((e=>!!e)).map((e=>({id:e.id,type:e.type,content:e.content})));t.item_description={id:e.description.id,blocks:a}}return a.includeSubItems&&"subitems"in e&&e.subitems&&(t.subitems=e.subitems.slice(0,a.subItemLimit).map((e=>this.mapItem(e,a)))),t}getColumnValueData(e){switch(e.type){case Jx.BoardRelation:return e.linked_items;case Jx.Formula:return e.display_value;case Jx.Mirror:return"Column value type is not supported"}if(e.text)return e.text;try{return JSON.parse(e.value)}catch{return e.value||null}}async getItemIdsFromSmartSearchAsync(e){const a={query:e.searchTerm,limit:100,filters:{entities:[{items:{board_ids:[e.boardId.toString()]}}]}},t=await this.mondayApi.request(WT,a,{versionOverride:"dev",timeout:mT}),i=t.search?.filter((e=>"ItemSearchResult"===e.__typename))?.map((e=>Number(e.data.id)))??[];if(0===i.length)throw new Error("No items found for search term or new search is not enabled for this account");const n=e.itemIds??[];if(0===n.length)return i;const o=new Set(n);return i.filter((e=>o.has(e)))}},class extends bu{constructor(){super(...arguments),this.name="create_item",this.type=y.WRITE,this.annotations=gu({title:"Create Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new item with provided values, create a subitem under a parent item, or duplicate an existing item and update it with new values. Use parentItemId when creating a subitem under an existing item. Use duplicateFromItemId when copying an existing item with modifications.[REQUIRED PRECONDITION]: Before using this tool, if new columns were added to the board or if you are not familiar with the board's structure (column IDs, column types, status labels, etc.), first use get_board_info to understand the board metadata. This is essential for constructing proper column values and knowing which columns are available."}getInputSchema(){return this.context?.boardId?hT:vT}async executeInternal(e){const a=this.context?.boardId??e.boardId;if(e.duplicateFromItemId&&e.parentItemId)throw new Error("Cannot specify both parentItemId and duplicateFromItemId. Please provide only one of these parameters.");return e.duplicateFromItemId?await this.duplicateAndUpdateItem(e,a):e.parentItemId?await this.createSubitem(e):await this.createNewItem(e,a)}async duplicateAndUpdateItem(e,a){try{const t={boardId:a.toString(),itemId:e.duplicateFromItemId.toString()},i=await this.mondayApi.request(rT,t);if(!i.duplicate_item?.id)throw new Error("Failed to duplicate item: no item duplicated");let n;try{n=JSON.parse(e.columnValues)}catch(e){throw new Error("Invalid JSON in columnValues")}const o={...n,name:e.name},r=new Sw(this.mondayApi,this.apiToken,{boardId:a});return await r.execute({itemId:parseInt(i.duplicate_item.id),columnValues:JSON.stringify(o)}),{content:{message:`Item ${i.duplicate_item.id} duplicated from ${e.duplicateFromItemId}`,item_id:i.duplicate_item.id,item_name:i.duplicate_item.name,item_url:i.duplicate_item.url,board_id:a}}}catch(e){uT(e,"duplicate item")}}async createSubitem(e){const a={parentItemId:e.parentItemId.toString(),itemName:e.name,columnValues:e.columnValues};try{const t=await this.mondayApi.request(sT,a);if(!t.create_subitem?.id)throw new Error("Failed to create subitem: no subitem created");return{content:{message:`Subitem ${t.create_subitem.id} created under ${e.parentItemId}`,item_id:t.create_subitem.id,item_name:t.create_subitem.name,item_url:t.create_subitem.url}}}catch(e){uT(e,"create subitem")}}async createNewItem(e,a){try{const t={boardId:a.toString(),itemName:e.name,groupId:e.groupId,columnValues:e.columnValues},i=await this.mondayApi.request(sw,t);return{content:{message:`Item ${i.create_item?.id} successfully created`,item_id:i.create_item?.id,item_name:i.create_item?.name,item_url:i.create_item?.url,board_id:a}}}catch(e){uT(e,"create item")}}},class extends bu{constructor(){super(...arguments),this.name="create_update",this.type=y.WRITE,this.annotations=gu({title:"Create Update",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new update (comment/post) on a monday.com item. Updates can be used to add comments, notes, or discussions to items. You can optionally mention users, teams, or boards in the update. You can also reply to an existing update by using the parentId parameter."}getInputSchema(){return wT}async executeInternal(e){let a;if(e.mentionsList)try{const t=JSON.parse(e.mentionsList),i=_T.safeParse(t);if(!i.success)throw new Error(`Invalid mentionsList format: ${i.error.message}`);a=i.data}catch(e){throw new Error(`Invalid mentionsList JSON format: ${e.message}`)}try{const t={itemId:e.itemId.toString(),body:e.body,mentionsList:a,parentId:e.parentId?.toString()},i=await this.mondayApi.request(bT,t);if(!i.create_update?.id)throw new Error("Failed to create update: no update created");return{content:{message:`Update ${i.create_update.id} created on item ${e.itemId}`,update_id:i.create_update.id,item_id:e.itemId,item_name:i.create_update.item?.name,item_url:i.create_update.item?.url}}}catch(e){uT(e,"create update")}}},class extends bu{constructor(){super(...arguments),this.name="get_updates",this.type=y.READ,this.annotations=gu({title:"Get Updates",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get updates (comments/posts) from a monday.com item or board. Specify objectId and objectType (Item or Board) to retrieve updates. For Board queries, you can filter by date range using fromDate and toDate (both required together, ISO8601 format). By default, Board queries return only board discussion; set includeItemUpdates to true to also include updates on individual items. Returns update text, creator info, timestamps, and optionally replies and assets."}getInputSchema(){return IT}async executeInternal(e){try{const a=void 0!==e.fromDate,t=void 0!==e.toDate;if(a!==t)throw new Error("Both fromDate and toDate must be provided together for date range filtering");if((a||t)&&e.objectType===ET.Item)throw new Error("Date range filtering (fromDate/toDate) is only supported for Board objectType");const i={limit:e.limit??25,page:e.page??1,includeReplies:e.includeReplies??!1,includeAssets:e.includeAssets??!1};let n;n=e.objectType===ET.Item?await this.mondayApi.request(xT,{...i,itemId:e.objectId}):await this.mondayApi.request(TT,{...i,boardId:e.objectId,boardUpdatesOnly:!e.includeItemUpdates,...e.fromDate&&e.toDate?{fromDate:ST(e.fromDate),toDate:ST(e.toDate)}:{}});const o=e.objectType===ET.Item?n.items?.[0]?.updates:n.boards?.[0]?.updates;if(!o||0===o.length)return{content:`No updates found for ${e.objectType.toLowerCase()} with id ${e.objectId}`};const r=o.map((a=>{const t={id:a.id,text_body:a.text_body,created_at:a.created_at,updated_at:a.updated_at,creator:a.creator?{id:a.creator.id,name:a.creator.name}:null,item_id:a.item_id};return e.includeReplies&&a.replies&&(t.replies=a.replies.map((e=>({id:e.id,text_body:e.text_body,created_at:e.created_at,updated_at:e.updated_at,creator:e.creator?{id:e.creator.id,name:e.creator.name}:null})))),e.includeAssets&&a.assets&&(t.assets=a.assets.filter((e=>!!e)).map((e=>({id:e.id,name:e.name,url:e.url,file_extension:e.file_extension,file_size:e.file_size,created_at:e.created_at})))),t})),s=e.objectType===ET.Item?n.items?.[0]?.url:n.boards?.[0]?.url;return{content:{message:"Updates retrieved",[`${e.objectType.toLowerCase()}_id`]:e.objectId,url:s,updates:r,pagination:{page:e.page??1,limit:e.limit??25,count:r.length}}}}catch(e){uT(e,"get updates")}}},class extends bu{constructor(){super(...arguments),this.name="create_update_in_monday",this.type=y.WRITE,this.annotations=gu({title:"Create Update in Monday, after calling this tool you should",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new update (comment/post) on a monday.com item. Updates can be used to add comments, notes, or discussions to items. You can optionally mention users, teams, or boards in the update. After calling this tool you should call the full board data tool to get data, and immediately after that call the show table tool to show the data from that tool. IMPORTANT: You MUST use the COMPLETE data from the full board data tool - do NOT cut, truncate, or omit any data. Pass the entire dataset to the show table tool."}getInputSchema(){return AI}async executeInternal(e){let a;if(e.mentionsList)try{const t=JSON.parse(e.mentionsList),i=NI.safeParse(t);if(!i.success)throw new Error(`Invalid mentionsList format: ${i.error.message}`);a=i.data}catch(e){throw new Error(`Invalid mentionsList JSON format: ${e.message}`)}try{const t={itemId:e.itemId.toString(),body:e.body,mentionsList:a},i=await this.mondayApi.request(bT,t);if(!i.create_update?.id)throw new Error("Failed to create update: no update created");return{content:`Update ${i.create_update.id} successfully created on item ${e.itemId}. Now we want to show the updated data, so call the full board data tool to get data, and then immediately after that call the show table tool to show the data from that tool. CRITICAL: You MUST pass the COMPLETE and FULL data from the full board data tool to the show table tool - do NOT cut, summarize, truncate, or omit ANY data. Use the entire dataset exactly as received.`}}catch(e){uT(e,"create update")}}},class extends bu{constructor(){super(...arguments),this.name="get_board_schema",this.type=y.READ,this.annotations=gu({title:"Get Board Schema",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get board schema (columns and groups) by board id"}getInputSchema(){if(!this.context?.boardId)return JT}async executeInternal(e){const a=this.context?.boardId??e.boardId,t={boardId:a.toString()},i=await this.mondayApi.request(pw,t);return{content:`The current schema of the board ${a} is: \n \n\nColumns:\n ${i.boards?.[0]?.columns?.map((e=>`Id - ${e?.id}\n Title - ${e?.title}\n Type - ${e?.type}`)).join("\n")}\n \n\nGroups:\n ${i.boards?.[0]?.groups?.map((e=>`Id - ${e?.id}\n Title - ${e?.title}`)).join("\n")}`}}},class extends bu{constructor(){super(...arguments),this.name="get_board_activity",this.type=y.READ,this.annotations=gu({title:"Get Board Activity",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0}),this.defaultLimit=1e3}getDescription(){return"Get board activity logs for a specified time range (defaults to last 30 days)"}getInputSchema(){return PT}async executeInternal(e){const a=new Date,t=new Date(a.getTime()-lT.MONTH30Days),i=e?.fromDate||t.toISOString(),n=e?.toDate||a.toISOString(),o={boardId:e.boardId.toString(),fromDate:i,toDate:n,limit:this.defaultLimit,page:1,includeData:e.includeData??!1},r=await this.mondayApi.request(FT,o),s=r.boards?.[0]?.activity_logs;if(!s||0===s.length)return{content:`No activity found for board ${e.boardId} in the specified time range (${i} to ${n}).`};const p=r.boards?.[0],d=e.includeData??!1;return{content:{message:"Board activity retrieved",board_id:e.boardId,board_name:p?.name,board_url:p?.url,data:s.filter((e=>null!=e)).map((e=>({created_at:e.created_at,event:e.event,entity:e.entity,user_id:e.user_id,...d&&e.data?{data:e.data}:{}})))}}}},class extends bu{constructor(){super(...arguments),this.name="get_board_info",this.type=y.READ,this.annotations=gu({title:"Get Board Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get comprehensive board information including metadata, structure, owners, and configuration. Also returns the board's views (e.g. table views, filter views) — each view includes its id, name, type, and a structured `filter` object. "}getInputSchema(){return HT}async executeInternal(e){const a={boardId:e.boardId.toString()},t=await this.mondayApi.request(jT,a),i=t.boards?.[0];if(!i)return{content:`Board with id ${e.boardId} not found or you don't have access to it.`};const n=await this.getSubItemsBoardAsync(i);return{content:UT(i,n)}}async getSubItemsBoardAsync(e){const a=e.columns?.find((e=>e?.type===Jx.Subtasks));if(!a)return null;const t=a.settings.boardIds[0],i=await this.mondayApi.request(VT,{boardId:t});return i.boards?.[0]??null}},class extends bu{constructor(){super(...arguments),this.name="get_full_board_data",this.type=y.READ,this.annotations=gu({title:"Get Full Board Data",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"INTERNAL USE ONLY - DO NOT CALL THIS TOOL DIRECTLY. This tool is exclusively triggered by UI components and should never be invoked directly by the agent."}getInputSchema(){return LT}async executeInternal(e){try{const a={boardId:e.boardId,itemsLimit:7};e.filters&&(a.queryParams={operator:e.filtersOperator,rules:e.filters.map((e=>({column_id:e.columnId.toString(),compare_value:e.compareValue,operator:e.operator,compare_attribute:e.compareAttribute})))});const t=await this.mondayApi.request(kT,a);if(!t.boards||0===t.boards.length||!t.boards[0])throw new Error(`Board with ID ${e.boardId} not found`);const i=t.boards[0],n=new Set;i.items_page.items.forEach((e=>{e.updates?.forEach((e=>{e.creator_id&&n.add(e.creator_id),e.replies?.forEach((e=>{e.creator_id&&n.add(e.creator_id)}))})),e.column_values.forEach((e=>{if("persons_and_teams"in e){const a=e;a.persons_and_teams?.forEach((e=>{"person"===e.kind&&e.id&&n.add(e.id)}))}}))}));const o=Array.from(n).filter((e=>!(Number(e)<0)));let r=[];if(o.length>0){const e={userIds:o},a=await this.mondayApi.request(RT,e);r=a.users?.filter((e=>null!==e))||[]}const s=new Map(r.map((e=>[e.id,e])));return{content:{board:{id:i.id,name:i.name,columns:i.columns,items:i.items_page.items.map((e=>({id:e.id,name:e.name,column_values:e.column_values,updates:e.updates?.map((e=>({id:e.id,creator_id:e.creator_id||"",creator:e.creator_id&&s.get(e.creator_id)||null,text_body:e.text_body,created_at:e.created_at,replies:e.replies?.map((e=>({id:e.id,creator_id:e.creator_id||"",creator:e.creator_id&&s.get(e.creator_id)||null,text_body:e.text_body,created_at:e.created_at})))||[]})))||[]})))},users:r,stats:{total_items:i.items_page.items.length,total_updates:i.items_page.items.reduce(((e,a)=>e+(a.updates?.length||0)),0),total_unique_creators:r.length}}}}catch(e){uT(e,"get full board data")}}},class extends bu{constructor(){super(...arguments),this.name="list_users_and_teams",this.type=y.READ,this.annotations=gu({title:"List Users and Teams",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Tool to fetch users and/or teams data. \n\n MANDATORY BEST PRACTICES:\n 1. ALWAYS use specific IDs or names when available\n 2. If no ids available, use name search if possible (USERS ONLY)\n 3. Use 'getMe: true' to get current user information\n 4. AVOID broad queries (no parameters) - use only as last resort\n\n REQUIRED PARAMETER PRIORITY (use in this order):\n 1. getMe - STANDALONE\n 2. userIds\n 3. name - STANDALONE (USERS ONLY, NOT for teams)\n 4. teamIds + teamsOnly\n 5. No parameters - LAST RESORT\n\n CRITICAL USAGE RULES:\n • userIds + teamIds requires explicit includeTeams: true flag\n • includeTeams: true fetches both users and teams, do not use this to fetch a specific user's teams rather fetch that user by id and you will get their team memberships.\n • name parameter is for USER search ONLY - it cannot be used to search for teams. Use teamIds to fetch specific teams."}getInputSchema(){return AE}async executeInternal(e){const a=e.userIds&&e.userIds.length>0,t=e.teamIds&&e.teamIds.length>0,i=e.includeTeams||!1,n=e.teamsOnly||!1,o=e.includeTeamMembers||!1,r=!!e.name;if(e.getMe||!1){if(a||t||i||n||o||r)return{content:"PARAMETER_CONFLICT: getMe is STANDALONE only. Remove all other parameters when using getMe: true for current user lookup."};const e=await this.mondayApi.request(bE);if(!e.me)return{content:"AUTHENTICATION_ERROR: Current user fetch failed. Verify API token and user permissions."};const s={users:[e.me]},p=wE(s),d=await SE(this.mondayApi);return{content:{data:p,action_name:"Users and teams",url:d?`https://${d}.monday.com/teams/all`:void 0}}}if(r){if(a||t||i||n||o)return{content:"PARAMETER_CONFLICT: name is STANDALONE only. Remove userIds, teamIds, includeTeams, teamsOnly, and includeTeamMembers when using name search."};const r={name:e.name},s=await this.mondayApi.request(gE,r);if(!s.users||0===s.users.length)return{content:`NAME_SEARCH_EMPTY: No users found matching "${e.name}". Try broader search terms or verify user exists in account.`};const p=s.users.filter((e=>null!==e)).map((e=>`• **${e.name}** (ID: ${e.id})${e.title?` - ${e.title}`:""}`)).join("\n"),d=`Found ${s.users.length} user(s) matching "${e.name}":\n\n${p}`,c=await SE(this.mondayApi);return{content:{data:d,action_name:"Users and teams",url:c?`https://${c}.monday.com/teams/all`:void 0}}}if(n&&i)return{content:"PARAMETER_CONFLICT: Cannot use teamsOnly: true with includeTeams: true. Use teamsOnly for teams-only queries or includeTeams for combined data."};if(a&&e.userIds&&e.userIds.length>xE)return{content:`LIMIT_EXCEEDED: userIds array too large (${e.userIds.length}/500). Split into batches of max 500 IDs and make multiple calls.`};if(t&&e.teamIds&&e.teamIds.length>TE)return{content:`LIMIT_EXCEEDED: teamIds array too large (${e.teamIds.length}/500). Split into batches of max 500 IDs and make multiple calls.`};let s;if(n||!a&&t&&!i)if(o){const a={teamIds:e.teamIds};s=await this.mondayApi.request(vE,a)}else{const a={teamIds:e.teamIds};s=await this.mondayApi.request(hE,a)}else if(i){const a={userIds:e.userIds,teamIds:e.teamIds,limit:EE};s=await this.mondayApi.request(fE,a)}else if(a){const a={userIds:e.userIds,limit:EE};s=await this.mondayApi.request(mE,a)}else{const e={userIds:void 0,limit:EE};s=await this.mondayApi.request(uE,e)}const p=wE(s),d=await SE(this.mondayApi);return{content:{data:p,action_name:"Users and teams",url:d?`https://${d}.monday.com/teams/all`:void 0}}}},Sw,class extends bu{constructor(){super(...arguments),this.name="move_item_to_group",this.type=y.WRITE,this.annotations=gu({title:"Move Item to Group",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Move an item to a group in a monday.com board"}getInputSchema(){return DE}async executeInternal(e){const a={itemId:e.itemId.toString(),groupId:e.groupId},t=await this.mondayApi.request(cw,a);return{content:`Item ${t.move_item_to_group?.id} successfully moved to group ${e.groupId}`}}},class extends bu{constructor(){super(...arguments),this.name="create_board",this.type=y.WRITE,this.annotations=gu({title:"Create Board",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com board"}getInputSchema(){return Nw}async executeInternal(e){const a={boardName:e.boardName,boardKind:e.boardKind,boardDescription:e.boardDescription,workspaceId:e.workspaceId},t=await this.mondayApi.request(lw,a);return{content:{message:`Board ${t.create_board?.id} successfully created`,board_id:t.create_board?.id,board_name:t.create_board?.name,board_url:t.create_board?.url}}}},class extends bu{constructor(){super(...arguments),this.name="create_form",this.type=y.WRITE,this.annotations=gu({title:"Create Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com form. This will create a new form as well as a new board for which the form’s responses will be stored. The returned board_id is the ID of the board that was created while the returned formToken can be used for all future queries and mutations to continue editing the form."}getInputSchema(){return rx}async executeInternal(e){const a={destination_workspace_id:e.destination_workspace_id,destination_folder_id:e.destination_folder_id,destination_folder_name:e.destination_folder_name,board_kind:e.board_kind,destination_name:e.destination_name,board_owner_ids:e.board_owner_ids,board_owner_team_ids:e.board_owner_team_ids,board_subscriber_ids:e.board_subscriber_ids,board_subscriber_teams_ids:e.board_subscriber_teams_ids},t=await this.mondayApi.request(jw,a);return{content:{message:"Form created successfully",board_id:t.create_form?.boardId,form_token:t.create_form?.token}}}},class extends bu{constructor(){super(...arguments),this.name="update_form",this.type=y.WRITE,this.annotations=gu({title:"Update Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0}),this.helpers=new Kx(this.mondayApi),this.actionHandlers=new Map([[Sx.setFormPassword,this.helpers.setFormPassword.bind(this.helpers)],[Sx.shortenFormUrl,this.helpers.shortenFormUrl.bind(this.helpers)],[Sx.deactivate,this.helpers.deactivateForm.bind(this.helpers)],[Sx.activate,this.helpers.activateForm.bind(this.helpers)],[Sx.createTag,this.helpers.createTag.bind(this.helpers)],[Sx.deleteTag,this.helpers.deleteTag.bind(this.helpers)],[Sx.updateTag,this.helpers.updateTag.bind(this.helpers)],[Sx.updateAppearance,this.helpers.updateAppearance.bind(this.helpers)],[Sx.updateAccessibility,this.helpers.updateAccessibility.bind(this.helpers)],[Sx.updateFeatures,this.helpers.updateFeatures.bind(this.helpers)],[Sx.updateQuestionOrder,this.helpers.updateQuestionOrder.bind(this.helpers)],[Sx.updateFormHeader,this.helpers.updateFormHeader.bind(this.helpers)]])}getDescription(){return'Update a monday.com form. Handles the following form update actions that can only be done one at a time using the correct "action" input: \n - update form\'s feature settings with the action "updateFeatures",\n - update form\'s appearance settings with the action "updateAppearance",\n - update form\'s accessibility settings with the action "updateAccessibility",\n - update form\'s title with the action "updateFormHeader",\n - update form\'s description with the action "updateFormHeader",\n - update form\'s question order with the action "updateQuestionOrder",\n - create a new form tag with the action "createTag",\n - delete a form tag with the action "deleteTag",\n - update a form tag with the action "updateTag",\n - set or update the form\'s password with the action "setFormPassword"\n - shorten form\'s url with the action "shortenFormUrl"\n - deactivate form with the action "deactivateForm"\n - reactivate form with the action "activateForm"'}getInputSchema(){return Yx}async executeInternal(e){const a=this.actionHandlers.get(e.action);return a?await a(e):{content:"Received an invalid action for the update form tool."}}},class extends bu{constructor(){super(...arguments),this.name="get_form",this.type=y.READ,this.annotations=gu({title:"Get Form",readOnlyHint:!0,destructiveHint:!1})}getDescription(){return"Get a monday.com form by its form token. Form tokens can be extracted from the form’s url. Given a form url, such as https://forms.monday.com/forms/abc123def456ghi789?r=use1, the token is the alphanumeric string that appears right after /forms/ and before the ?. In the example, the token is abc123def456ghi789."}getInputSchema(){return Qx}async executeInternal(e){const a={formToken:e.formToken},t=await this.mondayApi.request(Vw,a);return t.form?{content:{message:"Form retrieved",form_token:e.formToken,data:t.form}}:{content:`Form with token ${e.formToken} not found or you don't have access to it.`}}},class extends bu{constructor(){super(...arguments),this.name="form_questions_editor",this.type=y.WRITE,this.annotations=gu({title:"Form Questions Editor",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1}),this.helpers=new Ix(this.mondayApi),this.actionHandlers=new Map([[xx.Delete,this.helpers.deleteQuestion.bind(this.helpers)],[xx.Update,this.helpers.updateQuestion.bind(this.helpers)],[xx.Create,this.helpers.createQuestion.bind(this.helpers)]])}getDescription(){return"Create, update, or delete a question in a monday.com form"}getInputSchema(){return Ex}async executeInternal(e){const a=this.actionHandlers.get(e.action);return a?await a(e):{content:`Unknown action: ${e.action}`}}},class extends bu{constructor(){super(...arguments),this.name="create_column",this.type=y.WRITE,this.annotations=gu({title:"Create Column",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new column in a monday.com board"}getInputSchema(){return this.context?.boardId?Xx:Zx}async executeInternal(e){const a=this.context?.boardId??e.boardId,t={boardId:a?.toString()??"",columnType:e.columnType,columnTitle:e.columnTitle,columnDescription:e.columnDescription,columnSettings:"string"==typeof e.columnSettings?JSON.parse(e.columnSettings):e.columnSettings},i=await this.mondayApi.request(mw,t);return{content:{message:"Column successfully created",column_id:i.create_column?.id,column_title:i.create_column?.title}}}},class extends bu{constructor(){super(...arguments),this.name="create_group",this.type=y.WRITE,this.annotations=gu({title:"Create Group",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new group in a monday.com board. Groups are sections that organize related items. Use when users want to add structure, categorize items, or create workflow phases. Groups can be positioned relative to existing groups and assigned predefined colors. Items will always be created in the top group and so the top group should be the most relevant one for new item creation"}getInputSchema(){return oT}async executeInternal(e){const a={boardId:e.boardId,groupName:e.groupName,groupColor:e.groupColor,relativeTo:e.relativeTo,positionRelativeMethod:e.positionRelativeMethod},t=await this.mondayApi.request(iT,a);return{content:{message:"Group created successfully",group_id:t.create_group?.id,group_title:t.create_group?.title,board_id:e.boardId,group_name:e.groupName}}}},class extends bu{constructor(){super(...arguments),this.name="delete_column",this.type=y.WRITE,this.annotations=gu({title:"Delete Column",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete a column from a monday.com board"}getInputSchema(){return this.context?.boardId?NT:AT}async executeInternal(e){const a={boardId:(this.context?.boardId??e.boardId).toString(),columnId:e.columnId},t=await this.mondayApi.request(uw,a);return{content:`Column ${t.delete_column?.id} successfully deleted`}}},Tw,class extends bu{constructor(){super(...arguments),this.name="get_graphql_schema",this.type=y.ALL_API,this.annotations=gu({title:"Get GraphQL Schema",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Fetch the monday.com GraphQL schema structure including query and mutation definitions. This tool returns available query fields, mutation fields, and a list of GraphQL types in the schema. You can filter results by operation type (read/write) to focus on either queries or mutations."}getInputSchema(){return aE}async executeInternal(e){try{const a=await this.mondayApi.request(fw),t=e?.operationType,i=a.queryType?.fields?.map((e=>`- ${e.name}${e.description?`: ${e.description}`:""}`)).join("\n")||"No query fields found",n=a.mutationType?.fields?.map((e=>`- ${e.name}${e.description?`: ${e.description}`:""}`)).join("\n")||"No mutation fields found",o=a.__schema,r=o?.types?.filter((e=>e.name&&!e.name.startsWith("__"))).map((e=>`- ${e.name} (${e.kind||"unknown"})`)).join("\n")||"No types found";let s="## GraphQL Schema\n";return t&&"read"!==t||(s+=`- Query Type: ${a.__schema?.queryType?.name}\n\n`,s+=`## Query Fields\n${i}\n\n`),t&&"write"!==t||(s+=`- Mutation Type: ${a.__schema?.mutationType?.name}\n\n`,s+=`## Mutation Fields\n${n}\n\n`),s+=`## Available Types\n${r}\n\n`,s+='To get detailed information about a specific type, use the get_type_details tool with the type name.\nFor example: get_type_details(typeName: "Board") to see Board type details.',{content:s}}catch(e){return{content:`Error fetching GraphQL schema: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends bu{constructor(){super(...arguments),this.name="get_column_type_info",this.type=y.READ,this.annotations=gu({title:"Get Column Type Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Retrieves comprehensive information about a specific column type, including JSON schema definition and other metadata. Use this before creating columns with the create_column tool to understand the structure, validation rules, and available properties for column settings."}getInputSchema(){return eE}async executeInternal(e){const a={type:e.columnType},t=await this.mondayApi.request(XT,a);if(!t?.get_column_type_schema)return{content:`Information for column type "${e.columnType}" not found or not available.`};const i={schema:t.get_column_type_schema};return{content:{message:`Column type info for ${e.columnType}`,data:i,url:ZT}}}},class extends bu{constructor(){super(...arguments),this.name="get_type_details",this.type=y.ALL_API,this.annotations=gu({title:"Get Type Details",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get detailed information about a specific GraphQL type from the monday.com API schema"}getInputSchema(){return tE}async executeInternal(e){try{if(!e.typeName)return{content:"Error: typeName is required. Please provide a valid GraphQL type name."};const t=(a=e.typeName,ow`
1767
1794
  query getTypeDetails {
1768
1795
  __type(name: "${a}") {
1769
1796
  name
@@ -1851,5 +1878,5 @@ import e from"util";import a,{Readable as t}from"stream";import i from"path";imp
1851
1878
  }
1852
1879
  }
1853
1880
  }
1854
- `),i=await this.mondayApi.request(t);if(!i.__type)return{content:`Type '${e.typeName}' not found in the GraphQL schema. Please check the type name and try again.`};let n=`## Type: ${i.__type.name||"Unnamed"} ${e.typeName===i.__type.name?"":`(queried: ${e.typeName})`}\nKind: ${i.__type.kind}\n${i.__type.description?`Description: ${i.__type.description}`:""}\n\n`;return i.__type.fields&&i.__type.fields.length>0&&(n+="## Fields\n",i.__type.fields.forEach((e=>{const a=iE(e.type);n+=`- ${e.name}: ${a}${e.description?` - ${e.description}`:""}\n`,e.args&&e.args.length>0&&(n+=" Arguments:\n",e.args.forEach((e=>{const a=iE(e.type);n+=` - ${e.name}: ${a}${e.description?` - ${e.description}`:""}${e.defaultValue?` (default: ${e.defaultValue})`:""}\n`})))})),n+="\n"),i.__type.inputFields&&i.__type.inputFields.length>0&&(n+="## Input Fields\n",i.__type.inputFields.forEach((e=>{const a=iE(e.type);n+=`- ${e.name}: ${a}${e.description?` - ${e.description}`:""}${e.defaultValue?` (default: ${e.defaultValue})`:""}\n`})),n+="\n"),i.__type.interfaces&&i.__type.interfaces.length>0&&(n+="## Implements\n",i.__type.interfaces.forEach((e=>{n+=`- ${e.name}\n`})),n+="\n"),i.__type.enumValues&&i.__type.enumValues.length>0&&(n+="## Enum Values\n",i.__type.enumValues.forEach((e=>{n+=`- ${e.name}${e.description?` - ${e.description}`:""}\n`})),n+="\n"),i.__type.possibleTypes&&i.__type.possibleTypes.length>0&&(n+="## Possible Types\n",i.__type.possibleTypes.forEach((e=>{n+=`- ${e.name}\n`}))),n+=`\n## Usage Examples\nIf this is a Query or Mutation field, you can use it in the all_monday_api tool.\n\nExample for query:\nall_monday_api(operation: "query", name: "getTypeData", variables: "{\\"typeName\\": \\"${i.__type.name}\\"}")\n\nExample for object field access:\nWhen querying objects that have this type, include these fields in your query.\n`,{content:n}}catch(e){const a=e instanceof Error?e.message:"Unknown error",t=a.includes("JSON");return{content:`Error fetching type details: ${a}${t?"\n\nThis could be because the type name is incorrect or the GraphQL query format is invalid. Please check the type name and try again.":""}`}}var a}},class extends bu{constructor(){super(...arguments),this.name="create_custom_activity",this.type=y.WRITE,this.annotations=gu({title:"Create Custom Activity",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new custom activity in the E&A app"}getInputSchema(){return eT}async executeInternal(e){const a={color:e.color,icon_id:e.icon_id,name:e.name};return await this.mondayApi.request(vw,a),{content:`Custom activity '${e.name}' with color ${e.color} and icon ${e.icon_id} successfully created`}}},class extends bu{constructor(){super(...arguments),this.name="create_notification",this.type=y.WRITE,this.annotations=gu({title:"Create Notification",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Send a notification to a user via the bell icon and optionally by email. Use target_type "Post" for updates/replies or "Project" for items/boards.'}getInputSchema(){return tT}async executeInternal(e){const a={user_id:e.user_id,target_id:e.target_id,text:e.text,target_type:e.target_type};try{await this.mondayApi.request(aT,a);return{content:{message:"Notification sent",user_id:e.user_id,text:e.text}}}catch(a){return{content:`Failed to send notification to user ${e.user_id}`}}}},class extends bu{constructor(){super(...arguments),this.name="create_timeline_item",this.type=y.WRITE,this.annotations=gu({title:"Create Timeline Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new timeline item in the E&A app"}getInputSchema(){return gT}async executeInternal(e){const a={item_id:e.item_id.toString(),custom_activity_id:e.custom_activity_id,title:e.title,timestamp:e.timestamp,summary:e.summary,content:e.content,location:e.location,phone:e.phone,url:e.url};e.start_timestamp&&e.end_timestamp&&(a.time_range={start_timestamp:e.start_timestamp,end_timestamp:e.end_timestamp});const t=await this.mondayApi.request(gw,a);return{content:`Timeline item '${e.title}' with ID ${t.create_timeline_item?.id} successfully created on item ${e.item_id}`}}},class extends bu{constructor(){super(...arguments),this.name="fetch_custom_activity",this.type=y.READ,this.annotations=gu({title:"Fetch Custom Activities",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get custom activities from the E&A app"}getInputSchema(){return OT}async executeInternal(e){const a=await this.mondayApi.request(bw);if(!a.custom_activity||0===a.custom_activity.length)return{content:"No custom activities found"};const t=a.custom_activity.map((e=>({id:e.id,name:e.name,color:e.color,icon_id:e.icon_id,type:e.type})));return{content:`Found ${t.length} custom activities: ${JSON.stringify(t,null,2)}`}}},class extends bu{constructor(){super(...arguments),this.name="read_docs",this.type=y.READ,this.annotations=gu({title:"Read Documents",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get a collection of monday.com documents with their content as markdown. \n\nPAGINATION: \n- Default limit is 25 documents per page\n- Use 'page' parameter to get additional pages (starts at 1)\n- Check response for 'has_more_pages' to know if you should continue paginating\n- If user asks for \"all documents\" and you get exactly 25 results, continue with page 2, 3, etc.\n\nFILTERING: Provide a type value and array of ids:\n- type: 'ids' for specific document IDs\n- type: 'object_ids' for specific document object IDs \n- type: 'workspace_ids' for all docs in specific workspaces\n- ids: array of ID strings (at least 1 required)\n\nExamples:\n- { type: 'ids', ids: ['123', '456'] }\n- { type: 'object_ids', ids: ['123'] }\n- { type: 'workspace_ids', ids: ['ws_101'] }\n\nUSAGE PATTERNS:\n- For specific documents: use type 'ids' or 'object_ids' (A monday doc has two unique identifiers)\n- For workspace exploration: use type 'workspace_ids' with pagination\n- For large searches: start with page 1, then paginate if has_more_pages=true"}getInputSchema(){return OE}async executeInternal(e){try{let a,t,i;switch(e.type){case"ids":a=e.ids;break;case"object_ids":t=e.ids;break;case"workspace_ids":i=e.ids}const n={ids:a,object_ids:t,limit:e.limit||25,order_by:e.order_by,page:e.page,workspace_ids:i};let o=await this.mondayApi.request(yw,n);if((!o.docs||0===o.docs.length)&&a){const t={ids:void 0,object_ids:a,limit:e.limit||25,order_by:e.order_by,page:e.page,workspace_ids:i};o=await this.mondayApi.request(yw,t)}if(!o.docs||0===o.docs.length){return{content:`No documents found matching the specified criteria${e.page?` (page ${e.page})`:""}.`}}return await this.enrichDocsWithMarkdown(o.docs,n)}catch(e){return{content:`Error reading documents: ${e instanceof Error?e.message:"Unknown error occurred"}`}}}async enrichDocsWithMarkdown(e,a){const t=await Promise.all(e.filter((e=>null!==e)).map((async e=>{let a="";try{const t={docId:e.id},i=await this.mondayApi.request(_w,t);a=i.export_markdown_from_doc.success&&i.export_markdown_from_doc.markdown?i.export_markdown_from_doc.markdown:`Error getting markdown: ${i.export_markdown_from_doc.error||"Unknown error"}`}catch(e){a=`Error getting markdown: ${e instanceof Error?e.message:"Unknown error"}`}return{id:e.id,object_id:e.object_id,name:e.name,doc_kind:e.doc_kind,created_at:e.created_at,created_by:e.created_by?.name||"Unknown",url:e.url,relative_url:e.relative_url,workspace:e.workspace?.name||"Unknown",workspace_id:e.workspace_id,doc_folder_id:e.doc_folder_id,settings:e.settings,blocks_as_markdown:a}}))),i=a.page||1,n=a.limit||25,o=t.length,r=o===n;return{content:{message:`Documents retrieved (${t.length})`,pagination:{current_page:i,limit:n,count:o,has_more_pages:r},data:t}}}},class extends bu{constructor(){super(...arguments),this.name="workspace_info",this.type=y.READ,this.annotations=gu({title:"Get Workspace Information",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"This tool returns the boards, docs and folders in a workspace and which folder they are in. It returns up to 100 of each object type, if you receive 100 assume there are additional objects of that type in the workspace."}getInputSchema(){return kE}async executeInternal(e){const a={workspace_id:e.workspace_id},t=await this.mondayApi.request(ww,a);if(!t.workspaces||0===t.workspaces.length)return{content:`No workspace found with ID ${e.workspace_id}`};const i=function(e,a){const{workspaces:t,boards:i,docs:n,folders:o}=e,r=t?.[0];if(!r)throw new Error("No workspace found");const s=new Map((o||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name)).map((e=>[e.id,{id:e.id,name:e.name,boards:[],docs:[]}]))),p=[];(i||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name)).forEach((e=>{const a={id:e.id,name:e.name};e.board_folder_id&&s.has(e.board_folder_id)?s.get(e.board_folder_id).boards.push(a):p.push(a)}));const d=[];return(n||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name)).forEach((e=>{const a={id:e.id,name:e.name};e.doc_folder_id&&s.has(e.doc_folder_id)?s.get(e.doc_folder_id).docs.push(a):d.push(a)})),{workspace:{id:r.id,name:r.name,url:a?NE(a,r.id):void 0,description:r.description||"",kind:r.kind||"",created_at:r.created_at||"",state:r.state||"",is_default_workspace:r.is_default_workspace||!1,owners_subscribers:(r.owners_subscribers||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name&&null!=e.email)).map((e=>({id:e.id,name:e.name,email:e.email})))},folders:Array.from(s.values()),root_items:{boards:p,docs:d}}}(t,await SE(this.mondayApi));return{content:{message:"Workspace info retrieved",data:i}}}},class extends bu{constructor(){super(...arguments),this.name="list_workspaces",this.type=y.READ,this.annotations=gu({title:"List Workspaces",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"List all workspaces available to the user. Returns up to 500 workspaces with their ID, name, and description."}getInputSchema(){return PE}async executeInternal(e){const a=e.searchTerm?1e4:e.limit,t=e.searchTerm?1:e.page;let i=null;if(e.searchTerm&&(i=$E(e.searchTerm),0===i.length))throw new Error("Search term did not include any alphanumeric characters. Please provide a valid search term.");const n=e=>({limit:a,page:t,membershipKind:e}),o=LE(await this.mondayApi.request(RE,n(Py.Member))),r=!FE(o)||i&&!function(e,a){return a.some((a=>$E(a.name).includes(e)))}(i,o);let s=o;if(r){s=LE(await this.mondayApi.request(RE,n(Py.All)))}if(!FE(s))return{content:"No workspaces found."};const p=i&&s?.length<=CE,d=function(e,a,t,i){if(!e||a.length<=CE)return a;const n=(t-1)*i,o=n+i;return a.filter((a=>$E(a.name).includes(e))).slice(n,o)}(i,s,e.page,e.limit);if(!FE(d))return{content:"No workspaces found matching the search term. Try using the tool without a search term"};const c=d.length===e.limit,l=await SE(this.mondayApi),m=d.map((e=>({id:e.id,name:e.name,description:e.description||void 0,url:l&&e.id?NE(l,e.id):void 0})));return{content:{message:"Workspaces retrieved",...p?{disclaimer:"Search term not applied - returning all workspaces. Perform the filtering manually."}:{},...c?{next_page:e.page+1}:{},data:m}}}},class extends bu{constructor(){super(...arguments),this.name="create_doc",this.type=y.WRITE,this.annotations=gu({title:"Create Document",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Create a new monday.com doc either inside a workspace or attached to an item (via a doc column). After creation, the provided markdown will be appended to the document.\n\nLOCATION TYPES:\n- workspace: Creates a document in a workspace (requires workspace_id, optional doc_kind, optional folder_id)\n- item: Creates a document attached to an item (requires item_id, optional column_id)\n\nUSAGE EXAMPLES:\n- Workspace doc: { location: "workspace", workspace_id: 123, doc_kind: "private" , markdown: "..." }\n- Workspace doc in folder: { location: "workspace", workspace_id: 123, folder_id: 17264196 , markdown: "..." }\n- Item doc: { location: "item", item_id: 456, column_id: "doc_col_1" , markdown: "..." }'}getInputSchema(){return GE}async executeInternal(e){const a=qE.safeParse({...e,type:e.location});if(!a.success)return{content:`Required parameters were not provided for location parameter of ${e.location}`};const t=a.data;try{let a,i,n;if(t.type===ME.enum.workspace){const o={location:{workspace:{workspace_id:t.workspace_id.toString(),name:e.doc_name,kind:t.doc_kind||Mg.Public,folder_id:t.folder_id?.toString()}}},r=await this.mondayApi.request(VE,o);a=r?.create_doc?.id??void 0,i=r?.create_doc?.object_id??void 0,n=r?.create_doc?.url??void 0}else if(t.type===ME.enum.item){const o={itemId:t.item_id.toString()},r=await this.mondayApi.request(jE,o),s=r.items?.[0];if(!s)return{content:`Error: Item with id ${t.item_id} not found.`};const p=s.board?.id,d=s.board?.columns?.find((e=>e&&e.type===Jx.Doc));let c=t.column_id;if(!c)if(d)c=d.id;else{const e={boardId:p.toString(),columnType:Jx.Doc,columnTitle:"Doc"},a=await this.mondayApi.request(mw,e);if(c=a?.create_column?.id,!c)return{content:"Error: Failed to create doc column."}}const l={location:{board:{item_id:t.item_id.toString(),column_id:c}}},m=await this.mondayApi.request(VE,l);if(a=m.create_doc?.id??void 0,i=m.create_doc?.object_id??void 0,n=m.create_doc?.url??void 0,e.doc_name&&a)try{const t={docId:a,name:e.doc_name};await this.mondayApi.request(BE,t)}catch(e){console.warn("Failed to update doc name:",e)}}if(!a)return{content:"Error: Failed to create document."};const o={docId:a,markdown:e.markdown},r=await this.mondayApi.request(UE,o),s=r?.add_content_to_doc_from_markdown?.success,p=r?.add_content_to_doc_from_markdown?.error;return s?{content:{message:"Document successfully created",doc_id:a,object_id:i,doc_url:n,doc_name:e.doc_name}}:{content:`Document ${a} created, but failed to add markdown content: ${p||"Unknown error"}`}}catch(e){return{content:`Error creating document: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends bu{constructor(){super(...arguments),this.name="add_content_to_doc",this.type=y.WRITE,this.annotations=gu({title:"Add Content to Document",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Add markdown content to an existing monday.com document.\n\nIDENTIFICATION: Provide either doc_id or object_id to identify the document:\n- doc_id: The document ID (the id field returned by read_docs). Takes priority if both provided.\n- object_id: The document object ID (the object_id field from read_docs, also visible in the document URL). Will be resolved to a doc_id.\n\nUSAGE EXAMPLES:\n- By doc_id: { doc_id: "123", markdown: "# New Section\\nContent here" }\n- By object_id: { object_id: "456", markdown: "# New Section\\nContent here" }\n- Insert after block: { doc_id: "123", markdown: "Inserted content", after_block_id: "block_789" }'}getInputSchema(){return YE}async executeInternal(e){if(!e.doc_id&&!e.object_id)return{content:"Error: Either doc_id or object_id must be provided."};try{let a=null;if(e.doc_id){const t=await this.mondayApi.request(WE,{docId:[e.doc_id]});a=t.docs?.[0]??null}else{const t=await this.mondayApi.request(zE,{objectId:[e.object_id]});a=t.docs?.[0]??null}if(!a){return{content:`Error: No document found for ${e.doc_id?`doc_id ${e.doc_id}`:`object_id ${e.object_id}`}.`}}const t={docId:a.id,markdown:e.markdown,afterBlockId:e.after_block_id},i=await this.mondayApi.request(HE,t);if(!i?.add_content_to_doc_from_markdown)return{content:"Error: Failed to add content to document — no response from API."};const{success:n,block_ids:o,error:r}=i.add_content_to_doc_from_markdown;if(!n)return{content:`Error adding content to document: ${r||"Unknown error"}`};const s=o?.length??0;return{content:{message:`Successfully added content to document ${a.id}. ${s} block${1===s?"":"s"} created.`,doc_id:a.id,block_ids:o,doc_name:a.name,doc_url:a.url}}}catch(e){return{content:`Error adding content to document: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends bu{constructor(){super(...arguments),this.name="update_workspace",this.type=y.WRITE,this.annotations=gu({title:"Update Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing workspace in monday.com"}getInputSchema(){return aI}async executeInternal(e){const a={id:e.id,attributes:{account_product_id:e.attributeAccountProductId,description:e.attributeDescription,kind:e.attributeKind,name:e.attributeName}},t=await this.mondayApi.request(eI,a),i=await SE(this.mondayApi),n=i?NE(i,t.update_workspace?.id):void 0;return{content:{message:`Workspace ${t.update_workspace?.id} updated`,workspace_id:t.update_workspace?.id,workspace_name:t.update_workspace?.name,workspace_url:n}}}},class extends bu{constructor(){super(...arguments),this.name="update_folder",this.type=y.WRITE,this.annotations=gu({title:"Update Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing folder in monday.com"}getInputSchema(){return iI}async executeInternal(e){const{position_object_id:a,position_object_type:t,position_is_after:i}=e;if(!!a!=!!t)throw new Error("position_object_id and position_object_type must be provided together");const n={folderId:e.folderId,name:e.name,color:e.color,fontWeight:e.fontWeight,customIcon:e.customIcon,parentFolderId:e.parentFolderId,workspaceId:e.workspaceId,accountProductId:e.accountProductId,position:a?{position_is_after:i,position_object_id:a,position_object_type:t}:void 0},o=await this.mondayApi.request(tI,n);return{content:{message:`Folder ${o.update_folder?.id} updated`,folder_id:o.update_folder?.id,folder_name:o.update_folder?.name}}}},class extends bu{constructor(){super(...arguments),this.name="create_workspace",this.type=y.WRITE,this.annotations=gu({title:"Create Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new workspace in monday.com"}getInputSchema(){return oI}async executeInternal(e){const a={name:e.name,workspaceKind:e.workspaceKind,description:e.description,accountProductId:e.accountProductId},t=await this.mondayApi.request(nI,a),i=await SE(this.mondayApi),n=i&&t.create_workspace?.id?NE(i,t.create_workspace.id):void 0;return{content:{message:`Workspace ${t.create_workspace?.id} successfully created`,workspace_id:t.create_workspace?.id,workspace_name:t.create_workspace?.name,workspace_url:n}}}},class extends bu{constructor(){super(...arguments),this.name="create_folder",this.type=y.WRITE,this.annotations=gu({title:"Create Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new folder in a monday.com workspace"}getInputSchema(){return sI}async executeInternal(e){const a={workspaceId:e.workspaceId,name:e.name,color:e.color,fontWeight:e.fontWeight,customIcon:e.customIcon,parentFolderId:e.parentFolderId},t=await this.mondayApi.request(rI,a);return{content:{message:`Folder ${t.create_folder?.id} successfully created`,folder_id:t.create_folder?.id,folder_name:t.create_folder?.name}}}},class extends bu{constructor(){super(...arguments),this.name="move_object",this.type=y.WRITE,this.annotations=gu({title:"Move Object",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Move a folder, board, or overview in monday.com. Use `position` for relative placement based on another object, `parentFolderId` for folder changes, `workspaceId` for workspace moves, and `accountProductId` for account product changes."}getInputSchema(){return cI}async executeUpdateFolder(e){const{id:a,position_object_id:t,position_object_type:i,position_is_after:n,parentFolderId:o,workspaceId:r,accountProductId:s}=e;if(!!t!=!!i)throw new Error("position_object_id and position_object_type must be provided together");const p={folderId:a,position:t?{position_is_after:n,position_object_id:t,position_object_type:i}:void 0,parentFolderId:o,workspaceId:r,accountProductId:s},d=await this.mondayApi.request(tI,p);return{content:{message:"Object moved",object_id:d.update_folder?.id}}}async executeUpdateBoardHierarchy(e){const{id:a,position_object_id:t,position_object_type:i,position_is_after:n,parentFolderId:o,workspaceId:r,accountProductId:s}=e;if(!!t!=!!i)throw new Error("position_object_id and position_object_type must be provided together");const p={boardId:a,attributes:{position:t?{position_is_after:n,position_object_id:t,position_object_type:i}:void 0,folder_id:o,workspace_id:r,account_product_id:s}},d=await this.mondayApi.request(pI,p);return d.update_board_hierarchy?.success?{content:{message:"Board position updated",object_id:d.update_board_hierarchy?.board?.id,action_name:"move_board"}}:{content:`Board position update failed: ${d.update_board_hierarchy?.message}`}}async executeUpdateOverviewHierarchy(e){const{id:a,position_object_id:t,position_object_type:i,position_is_after:n,parentFolderId:o,workspaceId:r,accountProductId:s}=e;if(!!t!=!!i)throw new Error("position_object_id and position_object_type must be provided together");const p={overviewId:a,attributes:{position:t?{position_is_after:n,position_object_id:t,position_object_type:i}:void 0,folder_id:o,workspace_id:r,account_product_id:s}},d=await this.mondayApi.request(dI,p);return d.update_overview_hierarchy?.success?{content:{message:"Overview position updated",object_id:d.update_overview_hierarchy?.overview?.id}}:{content:`Overview position update failed: ${d.update_overview_hierarchy?.message}`}}async executeInternal(e){const{objectType:a}=e;switch(a){case Xb.Folder:return this.executeUpdateFolder(e);case Xb.Board:return this.executeUpdateBoardHierarchy(e);case Xb.Overview:return this.executeUpdateOverviewHierarchy(e);default:throw new Error(`Unsupported object type: ${a}`)}}},class extends bu{constructor(){super(...arguments),this.name="create_dashboard",this.type=y.WRITE,this.annotations=gu({title:"Create Dashboard",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Use this tool to create a new monday.com dashboard that aggregates data from one or more boards. \n Dashboards provide visual representations of board data through widgets and charts.\n \n Use this tool when users want to:\n - Create a dashboard to visualize board data\n - Aggregate information from multiple boards\n - Set up a data visualization container for widgets"}getInputSchema(){return XE}async executeInternal(e){try{const a={name:e.name,workspace_id:e.workspace_id.toString(),board_ids:e.board_ids,kind:e.kind,board_folder_id:e.board_folder_id?.toString()},t=await this.mondayApi.request(KE,a);if(!t.create_dashboard)throw new Error("Failed to create dashboard");const i=t.create_dashboard;return{content:{message:`Dashboard ${i.id} successfully created`,dashboard_id:i.id,dashboard_name:i.name}}}catch(e){const a=e instanceof Error?e.message:String(e);throw new Error(`Failed to create dashboard: ${a}`)}}},class extends bu{constructor(){super(...arguments),this.name="all_widgets_schema",this.type=y.READ,this.annotations=gu({title:"Get All Widget Schemas",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Fetch complete JSON Schema 7 definitions for all available widget types in monday.com.\n \n This tool is essential before creating widgets as it provides:\n - Complete schema definitions for all supported widgets\n - Required and optional fields for each widget type\n - Data type specifications and validation rules\n - Detailed descriptions of widget capabilities\n \n Use this tool when you need to:\n - Understand widget configuration requirements before creating widgets\n - Validate widget settings against official schemas\n - Plan widget implementations with proper data structures\n \n The response includes JSON Schema 7 definitions that describe exactly what settings each widget type accepts."}getInputSchema(){return{}}async executeInternal(){try{const e={},a=await this.mondayApi.request(QE,e);if(!a.all_widgets_schema||0===a.all_widgets_schema.length)throw new Error("No widget schemas found - API returned empty response");const t={};let i=0;for(const e of a.all_widgets_schema)if(e?.widget_type&&e?.schema){const a="string"==typeof e.schema?JSON.parse(e.schema):e.schema,n=a?.description||a?.title||`${e.widget_type} widget for data visualization`;t[e.widget_type]={type:e.widget_type,description:n,schema:e.schema},i++}if(0===i)throw new Error("No valid widget schemas found in API response");Object.keys(t).map((e=>`• **${e}**: ${t[e].description}`)).join("\n");return{content:{message:"Widgets schema",data:t,url:ZT}}}catch(e){const a=e instanceof Error?e.message:String(e);throw new Error(`Failed to fetch widget schemas: ${a}`)}}},class extends bu{constructor(){super(...arguments),this.name="create_widget",this.type=y.WRITE,this.annotations=gu({title:"Create Widget",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new widget in a dashboard or board view with specific configuration settings.\n \n This tool creates data visualization widgets that display information from monday.com boards:\n **Parent Containers:**\n - **DASHBOARD**: Place widget in a dashboard (most common use case)\n - **BOARD_VIEW**: Place widget in a specific board view\n \n **Critical Requirements:**\n 1. **Schema Compliance**: Widget settings MUST conform to the JSON schema for the specific widget type\n 2. **Use all_widgets_schema first**: Always fetch widget schemas before creating widgets\n 3. **Validate settings**: Ensure all required fields are provided and data types match\n \n **Workflow:**\n 1. Use 'all_widgets_schema' to get schema definitions\n 2. Prepare widget settings according to the schema\n 3. Use this tool to create the widget"}getInputSchema(){return ZE}async executeInternal(e){if(!e.settings)throw new Error("You must pass the settings parameter");try{const a={parent:{kind:e.parent_container_type,id:e.parent_container_id.toString()},kind:e.widget_kind,name:e.widget_name,settings:e.settings},t=await this.mondayApi.request(JE,a);if(!t.create_widget)throw new Error("Failed to create widget");const i=t.create_widget;i.parent?.kind===Ly.Dashboard?i.parent.id:i.parent;return{content:{message:`Widget ${i.id} created`,widget_id:i.id,widget_name:i.name,dashboard_id:i.parent?.id}}}catch(a){const t=a instanceof Error?a.message:String(a);throw new Error(`Failed to create ${e.widget_kind} widget: ${t}`)}}},class extends bu{constructor(){super(...arguments),this.name="board_insights",this.type=y.READ,this.annotations=gu({title:"Get Board Insights",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"This tool allows you to calculate insights about board's data by filtering, grouping and aggregating columns. For example, you can get the total number of items in a board, the number of items in each status, the number of items in each column, etc. Use this tool when you need to get a summary of the board's data, for example, you want to know the total number of items in a board, the number of items in each status, the number of items in each column, etc.[REQUIRED PRECONDITION]: Before using this tool, if new columns were added to the board or if you are not familiar with the board's structure (column IDs, column types, status labels, etc.), first use get_board_info to understand the board metadata. This is essential for constructing proper filters and knowing which columns are available.[IMPORTANT]: For some columns, human-friendly label is returned inside 'LABEL_<column_id' field. E.g. for column with id 'status_123' the label is returned inside 'LABEL_status_123' field."}getInputSchema(){return vI}async executeInternal(e){if(!e.aggregations)return{content:'Input must contain the "aggregations" field.'};const{selectElements:a,groupByElements:t}=function(e){const a={},t=e.groupBy?.map((e=>({column_id:e})))||[],i=new Set(e.aggregations.filter((e=>e.function===Sg.Label)).map((e=>e.columnId))),n=e.groupBy?.filter((e=>!i.has(e))).map((e=>({function:Sg.Label,columnId:e})))??[],o=e.aggregations.concat(n).map((e=>{if(e.function){const o=`${e.function}_${e.columnId}`,r=a[o]||0;a[o]=r+1;const s=`${o}_${r}`;return fI.has(e.function)&&(t.some((e=>e.column_id===s))||t.push({column_id:s})),{type:Ig.Function,function:(i=e.function,n=e.columnId,{function:i,params:i===Sg.CountItems?[]:[{type:Ig.Column,column:hI(n),as:n}]}),as:s}}var i,n;const o={type:Ig.Column,column:hI(e.columnId),as:e.columnId};return t.some((a=>a.column_id===e.columnId))||t.push({column_id:e.columnId}),o}));return t.forEach((e=>{o.some((a=>a.as===e.column_id))||o.push({type:Ig.Column,column:hI(e.column_id),as:e.column_id})})),{selectElements:o,groupByElements:t}}(e),i=function(e){if(!e.filters&&!e.orderBy)return;const a={};return e.filters&&(a.rules=e.filters.map((e=>({column_id:e.columnId,compare_value:e.compareValue,operator:e.operator,compare_attribute:e.compareAttribute}))),a.operator=e.filtersOperator),e.orderBy&&(a.order_by=function(e){return e.orderBy?.map((e=>({column_id:e.columnId,direction:e.direction})))}(e)),a}(e),n=function(e){return{id:e.boardId.toString(),type:Eg.Table}}(e),o={query:{from:n,query:i,select:a,group_by:t,limit:e.limit},boardId:String(e.boardId)},r=await this.mondayApi.request(lI,o),s=(r.aggregate?.results??[]).map((e=>{const a={};return(e.entries??[]).forEach((e=>{const t=e.alias??"";if(!t)return;const i=e.value;if(!i)return void(a[t]=null);const n=i.result??i.value??null;a[t]=n})),a}));return s.length?{content:{message:"Board insights retrieved",board_name:r.boards?.[0]?.name,board_url:r.boards?.[0]?.url,data:s}}:{content:"No board insights found for the given query."}}},class extends bu{constructor(){super(...arguments),this.name="search",this.type=y.READ,this.annotations=gu({title:"Search",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Search within monday.com platform. Can search for boards, documents, forms, folders.\nFor users and teams, use list_users_and_teams tool.\nFor workspaces, use list_workspaces tool.\nFor items and groups, use get_board_items_page tool.\nFor groups, use get_board_info tool.\nIMPORTANT: ids returned by this tool are prefixed with the type of the object (e.g doc-123, board-456, folder-789). When passing the ids to other tools, you need to remove the prefix and just pass the number.\n "}getInputSchema(){return xI}async executeInternal(e){if(e.searchType!==KT.FOLDERS&&e.searchTerm)try{return{content:{message:"Search results",data:(await this.searchWithDevEndpointAsync(e)).items}}}catch(e){fT(e)}const a={[KT.BOARD]:this.searchBoardsAsync.bind(this),[KT.DOCUMENTS]:this.searchDocsAsync.bind(this),[KT.FOLDERS]:this.searchFoldersAsync.bind(this)}[e.searchType];if(!a)throw new Error(`Unsupported search type: ${e.searchType}`);const t=await a(e);return{content:{message:"Search results",disclaimer:t.wasFiltered||!e.searchTerm?void 0:"[IMPORTANT]Items were not filtered. Please perform the filtering.",data:t.items}}}async searchWithDevEndpointAsync(e){const a={[KT.BOARD]:{entities:[{boards:{workspace_ids:e.workspaceIds?.map((e=>e.toString()))}}]},[KT.DOCUMENTS]:{entities:[{docs:{workspace_ids:e.workspaceIds?.map((e=>e.toString()))}}]},[KT.FOLDERS]:void 0}[e.searchType];if(!a)throw new Error(`Unsupported search type for dev endpoint: ${e.searchType}`);if(e.page>1)throw new Error("Pagination is not supported for search, increase the limit parameter instead");const t={query:e.searchTerm,limit:e.limit,filters:a},i=(await this.mondayApi.request(_I,t,{versionOverride:"dev",timeout:mT})).search||[],n=[];for(const e of i)"BoardSearchResult"===e.__typename?n.push({id:YT.BOARD+e.data.id,title:e.data.name,url:e.data.url}):"DocSearchResult"===e.__typename&&n.push({id:YT.DOCUMENT+e.data.id,title:e.data.name});return{items:n,wasFiltered:!0}}async searchFoldersAsync(e){const a={...this.getPagingParamsForSearch(e,100),workspace_ids:e.workspaceIds?.map((e=>e.toString()))};a.workspace_ids??=[],0===a.workspace_ids.length&&uT(new Error("Searching for folders require specifying workspace ids"),"search folders");const t=await this.mondayApi.request(yI,a),i=this.searchAndVirtuallyPaginate(e,t.folders||[],(e=>e.name));return{items:i.items.map((e=>({id:YT.FOLDER+e.id,title:e.name}))),wasFiltered:i.wasFiltered}}async searchDocsAsync(e){const a={...this.getPagingParamsForSearch(e),workspace_ids:e.workspaceIds?.map((e=>e.toString()))},t=await this.mondayApi.request(bI,a),i=this.searchAndVirtuallyPaginate(e,t.docs||[],(e=>e.name));return{items:i.items.map((e=>({id:YT.DOCUMENT+e.id,title:e.name,url:e.url||void 0}))),wasFiltered:i.wasFiltered}}async searchBoardsAsync(e){const a={...this.getPagingParamsForSearch(e),workspace_ids:e.workspaceIds?.map((e=>e.toString()))},t=await this.mondayApi.request(gI,a),i=this.searchAndVirtuallyPaginate(e,t.boards||[],(e=>e.name));return{items:i.items.map((e=>({id:YT.BOARD+e.id,title:e.name,url:e.url}))),wasFiltered:i.wasFiltered}}getPagingParamsForSearch(e,a=1e3){return{page:e.searchTerm?1:e.page,limit:e.searchTerm?Math.min(1e3,a):e.limit}}searchAndVirtuallyPaginate(e,a,t){if(a.length<=wI)return{items:a,wasFiltered:!1};const i=$E(e.searchTerm??""),n=(e.page-1)*e.limit,o=n+e.limit;return{items:a.filter((e=>$E(t(e)).includes(i))).slice(n,o),wasFiltered:!0}}},class extends bu{constructor(){super(...arguments),this.name="get_user_context",this.type=y.READ,this.annotations=gu({title:"Get User Context",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Fetch current user information and their relevant items (boards, folders, workspaces, dashboards).\n \n Use this tool at the beginning of conversations to:\n - Get context about who the current user is (id, name, title)\n - Discover user's favorite boards, folders, workspaces, and dashboards\n - Get user's most relevant boards based on visit frequency and recency\n - Get user's most relevant people based on interaction frequency and recency\n - Reduce the need for search requests by knowing user's commonly accessed items\n "}getInputSchema(){}async executeInternal(){const{me:e,favorites:a,intelligence:t}=await this.mondayApi.request(DI,{},{versionOverride:"dev"});if(!e)return{content:"AUTHENTICATION_ERROR: Unable to fetch current user. Verify API token and user permissions."};return{content:{message:"User context",...{user:e,favorites:await this.fetchFavorites(a||[]),relevantBoards:this.extractRelevantBoards(t),relevantPeople:this.extractRelevantPeople(t)}}}}async fetchFavorites(e){const a=this.groupByType(e),t=Object.keys(a);if(0===t.length)return[];const i={};for(const e of t)i[kI[e]]=a[e];const n=await this.mondayApi.request(OI,i),o=[];for(const e of t){const a=RI[e];for(const t of n[a]??[])t?.id&&o.push({id:t.id,name:t.name,type:e})}return o}extractRelevantBoards(e){if(!e?.relevant_boards)return[];const a=[];for(const t of e.relevant_boards)t?.id&&t?.board?.name&&a.push({id:t.id,name:t.board.name});return a}extractRelevantPeople(e){if(!e?.relevant_people)return[];const a=[];for(const t of e.relevant_people)t?.id&&t?.user?.name&&a.push({id:t.id,name:t.user.name});return a}groupByType(e){const a={};for(const t of e){const e=t?.object;e?.id&&e?.type&&(a[e.type]??=[]).push(e.id)}return a}},class extends bu{constructor(){super(...arguments),this.name="update_assets_on_item",this.type=y.WRITE,this.annotations=gu({title:"Update Assets On Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update a file or doc column value on an item using existing assets, docs, or links. Sets the column to the provided list of files, adding new ones and removing any not in the list."}getInputSchema(){return AI}async executeInternal(e){const a={boardId:e.boardId,itemId:e.itemId,columnId:e.columnId,files:e.files},t=await this.mondayApi.request(SI,a);return{content:`Item ${t.update_assets_on_item?.id} (${t.update_assets_on_item?.name}) assets successfully updated`}}},class extends bu{constructor(){super(...arguments),this.name="get_notetaker_meetings",this.type=y.READ,this.annotations=gu({title:"Get Notetaker Meetings",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Retrieve notetaker meetings with optional detailed fields. Use include_summary, include_topics, include_action_items, and include_transcript flags to control which details are returned. Use access to filter by meeting access level (OWN, SHARED_WITH_ME, SHARED_WITH_ACCOUNT, ALL). Defaults to OWN. Supports filtering by ids, search term, and cursor-based pagination."}getInputSchema(){return $I}async executeInternal(e){const a={access:e.access};e.ids&&e.ids.length>0&&(a.ids=e.ids),e.search&&(a.search=e.search);const t={limit:e.limit,cursor:e.cursor||void 0,filters:a,includeSummary:e.include_summary,includeTopics:e.include_topics,includeActionItems:e.include_action_items,includeTranscript:e.include_transcript},i=await this.mondayApi.request(CI,t,{versionOverride:"2026-04"}),n=i.notetaker?.meetings;if(!n?.meetings||0===n.meetings.length)return{content:"No notetaker meetings found matching the specified criteria."};return{content:{message:"Meetings retrieved",data:{meetings:n.meetings,pagination:{has_next_page:n.page_info?.has_next_page??!1,cursor:n.page_info?.cursor??null,count:n.meetings.length}}}}}},class extends bu{constructor(){super(...arguments),this.name="create_view",this.type=y.WRITE,this.annotations=gu({title:"Create View",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Create a new board view (tab) with optional filters and sorting. This creates a saved view on a monday.com board that users can switch to.\n\nFilter operators: any_of, not_any_of, is_empty, is_not_empty, greater_than, lower_than, between, contains_text, not_contains_text\n\nExample filter for people column: { "rules": [{ "column_id": "people", "compare_value": ["person-12345"], "operator": "any_of" }] }\nExample filter for status column: { "rules": [{ "column_id": "status", "compare_value": [1], "operator": "any_of" }] }'}getInputSchema(){return Dw}async executeInternal(e){const a={boardId:e.boardId,type:e.type,name:e.name,filter:e.filter,sort:e.sort},t=await this.mondayApi.request(Aw,a);return t.create_view?{content:`View "${t.create_view.name}" (ID: ${t.create_view.id}, type: ${t.create_view.type}) successfully created`}:{content:"Failed to create view - no response from API"}}}],uS=[...mS,...lS,...vu];export{pT as ToolMode,y as ToolType,mS as allGraphqlApiTools,vu as allMondayAppsTools,lS as allMondayDevTools,uS as allTools};
1881
+ `),i=await this.mondayApi.request(t);if(!i.__type)return{content:`Type '${e.typeName}' not found in the GraphQL schema. Please check the type name and try again.`};let n=`## Type: ${i.__type.name||"Unnamed"} ${e.typeName===i.__type.name?"":`(queried: ${e.typeName})`}\nKind: ${i.__type.kind}\n${i.__type.description?`Description: ${i.__type.description}`:""}\n\n`;return i.__type.fields&&i.__type.fields.length>0&&(n+="## Fields\n",i.__type.fields.forEach((e=>{const a=iE(e.type);n+=`- ${e.name}: ${a}${e.description?` - ${e.description}`:""}\n`,e.args&&e.args.length>0&&(n+=" Arguments:\n",e.args.forEach((e=>{const a=iE(e.type);n+=` - ${e.name}: ${a}${e.description?` - ${e.description}`:""}${e.defaultValue?` (default: ${e.defaultValue})`:""}\n`})))})),n+="\n"),i.__type.inputFields&&i.__type.inputFields.length>0&&(n+="## Input Fields\n",i.__type.inputFields.forEach((e=>{const a=iE(e.type);n+=`- ${e.name}: ${a}${e.description?` - ${e.description}`:""}${e.defaultValue?` (default: ${e.defaultValue})`:""}\n`})),n+="\n"),i.__type.interfaces&&i.__type.interfaces.length>0&&(n+="## Implements\n",i.__type.interfaces.forEach((e=>{n+=`- ${e.name}\n`})),n+="\n"),i.__type.enumValues&&i.__type.enumValues.length>0&&(n+="## Enum Values\n",i.__type.enumValues.forEach((e=>{n+=`- ${e.name}${e.description?` - ${e.description}`:""}\n`})),n+="\n"),i.__type.possibleTypes&&i.__type.possibleTypes.length>0&&(n+="## Possible Types\n",i.__type.possibleTypes.forEach((e=>{n+=`- ${e.name}\n`}))),n+=`\n## Usage Examples\nIf this is a Query or Mutation field, you can use it in the all_monday_api tool.\n\nExample for query:\nall_monday_api(operation: "query", name: "getTypeData", variables: "{\\"typeName\\": \\"${i.__type.name}\\"}")\n\nExample for object field access:\nWhen querying objects that have this type, include these fields in your query.\n`,{content:n}}catch(e){const a=e instanceof Error?e.message:"Unknown error",t=a.includes("JSON");return{content:`Error fetching type details: ${a}${t?"\n\nThis could be because the type name is incorrect or the GraphQL query format is invalid. Please check the type name and try again.":""}`}}var a}},class extends bu{constructor(){super(...arguments),this.name="create_custom_activity",this.type=y.WRITE,this.annotations=gu({title:"Create Custom Activity",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new custom activity in the E&A app"}getInputSchema(){return eT}async executeInternal(e){const a={color:e.color,icon_id:e.icon_id,name:e.name};return await this.mondayApi.request(vw,a),{content:`Custom activity '${e.name}' with color ${e.color} and icon ${e.icon_id} successfully created`}}},class extends bu{constructor(){super(...arguments),this.name="create_notification",this.type=y.WRITE,this.annotations=gu({title:"Create Notification",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Send a notification to a user via the bell icon and optionally by email. Use target_type "Post" for updates/replies or "Project" for items/boards.'}getInputSchema(){return tT}async executeInternal(e){const a={user_id:e.user_id,target_id:e.target_id,text:e.text,target_type:e.target_type};try{await this.mondayApi.request(aT,a);return{content:{message:"Notification sent",user_id:e.user_id,text:e.text}}}catch(a){return{content:`Failed to send notification to user ${e.user_id}`}}}},class extends bu{constructor(){super(...arguments),this.name="create_timeline_item",this.type=y.WRITE,this.annotations=gu({title:"Create Timeline Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new timeline item in the E&A app"}getInputSchema(){return gT}async executeInternal(e){const a={item_id:e.item_id.toString(),custom_activity_id:e.custom_activity_id,title:e.title,timestamp:e.timestamp,summary:e.summary,content:e.content,location:e.location,phone:e.phone,url:e.url};e.start_timestamp&&e.end_timestamp&&(a.time_range={start_timestamp:e.start_timestamp,end_timestamp:e.end_timestamp});const t=await this.mondayApi.request(gw,a);return{content:`Timeline item '${e.title}' with ID ${t.create_timeline_item?.id} successfully created on item ${e.item_id}`}}},class extends bu{constructor(){super(...arguments),this.name="fetch_custom_activity",this.type=y.READ,this.annotations=gu({title:"Fetch Custom Activities",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get custom activities from the E&A app"}getInputSchema(){return OT}async executeInternal(e){const a=await this.mondayApi.request(bw);if(!a.custom_activity||0===a.custom_activity.length)return{content:"No custom activities found"};const t=a.custom_activity.map((e=>({id:e.id,name:e.name,color:e.color,icon_id:e.icon_id,type:e.type})));return{content:`Found ${t.length} custom activities: ${JSON.stringify(t,null,2)}`}}},class extends bu{constructor(){super(...arguments),this.name="read_docs",this.type=y.READ,this.annotations=gu({title:"Read Documents",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Get information about monday.com documents. Supports two modes:\n\nMODE: "content" (default) — Fetch documents with their full markdown content.\n- Requires: type ("ids" | "object_ids" | "workspace_ids") and ids array\n- Examples:\n - { type: "ids", ids: ["123"] }\n - { type: "workspace_ids", ids: ["ws_101"], page: 2 }\n- Supports pagination via page/limit. Check has_more_pages in response.\n- If type "ids" returns no results, automatically retries with object_ids.\n\nMODE: "version_history" — Fetch the edit history of a single document.\n- Requires: doc_id (the id field from content mode, not object_id)\n- Examples:\n - { mode: "version_history", doc_id: "123" }\n - { mode: "version_history", doc_id: "123", since: "2026-03-11T00:00:00Z", include_diff: true }\n- Defaults to the last 24 hours. Use since/until to widen the range.\n- Set include_diff: true to see what content changed between versions (fetches up to 10 diffs, may be slower).'}getInputSchema(){return CE}async executeInternal(e){return"version_history"===e.mode?this.executeVersionHistory(e):this.executeContent(e)}async executeContent(e){try{if(!e.type||!e.ids||0===e.ids.length)return{content:'Error: type and ids are required when mode is "content".'};let a,t,i;switch(e.type){case"ids":a=e.ids;break;case"object_ids":t=e.ids;break;case"workspace_ids":i=e.ids}const n={ids:a,object_ids:t,limit:e.limit||25,order_by:e.order_by,page:e.page,workspace_ids:i};let o=await this.mondayApi.request(yw,n);if((!o.docs||0===o.docs.length)&&a){const t={ids:void 0,object_ids:a,limit:e.limit||25,order_by:e.order_by,page:e.page,workspace_ids:i};o=await this.mondayApi.request(yw,t)}if(!o.docs||0===o.docs.length){return{content:`No documents found matching the specified criteria${e.page?` (page ${e.page})`:""}.`}}return this.enrichDocsWithMarkdown(o.docs,n)}catch(e){return{content:`Error reading documents: ${e instanceof Error?e.message:"Unknown error occurred"}`}}}async executeVersionHistory(e){const{doc_id:a,include_diff:t}=e;if(!a)return{content:'Error: doc_id is required when mode is "version_history".'};const i=e.since??new Date(Date.now()-864e5).toISOString(),n=e.until??(new Date).toISOString();try{const e={docId:a,since:i,until:n},o=await this.mondayApi.request(OE,e),r=o?.doc_version_history?.restoring_points;if(!r||0===r.length)return{content:`No version history found for document ${a} in the specified time range (${i} to ${n}).`};if(!t)return{content:JSON.stringify({doc_id:a,since:i,until:n,restoring_points:r},null,2)};const s=r.slice(0,10),p=r.length>10,d=await Promise.allSettled(s.map((async(e,t)=>{if(t===s.length-1||!e.date)return e;const i=s[t+1];if(!i?.date)return e;const n={docId:a,date:e.date,prevDate:i.date},o=await this.mondayApi.request(kE,n);return{...e,diff:o?.doc_version_diff?.blocks??[]}}))).then((e=>e.map(((e,a)=>"fulfilled"===e.status?e.value:s[a]))));return{content:JSON.stringify({doc_id:a,since:i,until:n,restoring_points:d,...p&&{truncated:!0,total_count:r.length}},null,2)}}catch(e){return{content:`Error fetching version history for document ${a}: ${e instanceof Error?e.message:"Unknown error"}`}}}async enrichDocsWithMarkdown(e,a){const t=await Promise.all(e.filter((e=>null!==e)).map((async e=>{let a="";try{const t={docId:e.id},i=await this.mondayApi.request(_w,t);a=i.export_markdown_from_doc.success&&i.export_markdown_from_doc.markdown?i.export_markdown_from_doc.markdown:`Error getting markdown: ${i.export_markdown_from_doc.error||"Unknown error"}`}catch(e){a=`Error getting markdown: ${e instanceof Error?e.message:"Unknown error"}`}return{id:e.id,object_id:e.object_id,name:e.name,doc_kind:e.doc_kind,created_at:e.created_at,created_by:e.created_by?.name||"Unknown",url:e.url,relative_url:e.relative_url,workspace:e.workspace?.name||"Unknown",workspace_id:e.workspace_id,doc_folder_id:e.doc_folder_id,settings:e.settings,blocks_as_markdown:a}}))),i=a.page||1,n=a.limit||25,o=t.length,r=o===n;return{content:{message:`Documents retrieved (${t.length})`,pagination:{current_page:i,limit:n,count:o,has_more_pages:r},data:t}}}},class extends bu{constructor(){super(...arguments),this.name="workspace_info",this.type=y.READ,this.annotations=gu({title:"Get Workspace Information",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"This tool returns the boards, docs and folders in a workspace and which folder they are in. It returns up to 100 of each object type, if you receive 100 assume there are additional objects of that type in the workspace."}getInputSchema(){return $E}async executeInternal(e){const a={workspace_id:e.workspace_id},t=await this.mondayApi.request(ww,a);if(!t.workspaces||0===t.workspaces.length)return{content:`No workspace found with ID ${e.workspace_id}`};const i=function(e,a){const{workspaces:t,boards:i,docs:n,folders:o}=e,r=t?.[0];if(!r)throw new Error("No workspace found");const s=new Map((o||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name)).map((e=>[e.id,{id:e.id,name:e.name,boards:[],docs:[]}]))),p=[];(i||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name)).forEach((e=>{const a={id:e.id,name:e.name};e.board_folder_id&&s.has(e.board_folder_id)?s.get(e.board_folder_id).boards.push(a):p.push(a)}));const d=[];return(n||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name)).forEach((e=>{const a={id:e.id,name:e.name};e.doc_folder_id&&s.has(e.doc_folder_id)?s.get(e.doc_folder_id).docs.push(a):d.push(a)})),{workspace:{id:r.id,name:r.name,url:a?NE(a,r.id):void 0,description:r.description||"",kind:r.kind||"",created_at:r.created_at||"",state:r.state||"",is_default_workspace:r.is_default_workspace||!1,owners_subscribers:(r.owners_subscribers||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name&&null!=e.email)).map((e=>({id:e.id,name:e.name,email:e.email})))},folders:Array.from(s.values()),root_items:{boards:p,docs:d}}}(t,await SE(this.mondayApi));return{content:{message:"Workspace info retrieved",data:i}}}},class extends bu{constructor(){super(...arguments),this.name="list_workspaces",this.type=y.READ,this.annotations=gu({title:"List Workspaces",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"List all workspaces available to the user. Returns up to 500 workspaces with their ID, name, and description."}getInputSchema(){return UE}async executeInternal(e){const a=e.searchTerm?1e4:e.limit,t=e.searchTerm?1:e.page;let i=null;if(e.searchTerm&&(i=PE(e.searchTerm),0===i.length))throw new Error("Search term did not include any alphanumeric characters. Please provide a valid search term.");const n=e=>({limit:a,page:t,membershipKind:e}),o=jE(await this.mondayApi.request(LE,n(Py.Member))),r=!VE(o)||i&&!function(e,a){return a.some((a=>PE(a.name).includes(e)))}(i,o);let s=o;if(r){s=jE(await this.mondayApi.request(LE,n(Py.All)))}if(!VE(s))return{content:"No workspaces found."};const p=i&&s?.length<=FE,d=function(e,a,t,i){if(!e||a.length<=FE)return a;const n=(t-1)*i,o=n+i;return a.filter((a=>PE(a.name).includes(e))).slice(n,o)}(i,s,e.page,e.limit);if(!VE(d))return{content:"No workspaces found matching the search term. Try using the tool without a search term"};const c=d.length===e.limit,l=await SE(this.mondayApi),m=d.map((e=>({id:e.id,name:e.name,description:e.description||void 0,url:l&&e.id?NE(l,e.id):void 0})));return{content:{message:"Workspaces retrieved",...p?{disclaimer:"Search term not applied - returning all workspaces. Perform the filtering manually."}:{},...c?{next_page:e.page+1}:{},data:m}}}},class extends bu{constructor(){super(...arguments),this.name="create_doc",this.type=y.WRITE,this.annotations=gu({title:"Create Document",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Create a new monday.com doc either inside a workspace or attached to an item (via a doc column). After creation, the provided markdown will be appended to the document.\n\nLOCATION TYPES:\n- workspace: Creates a document in a workspace (requires workspace_id, optional doc_kind, optional folder_id)\n- item: Creates a document attached to an item (requires item_id, optional column_id)\n\nUSAGE EXAMPLES:\n- Workspace doc: { location: "workspace", workspace_id: 123, doc_kind: "private" , markdown: "..." }\n- Workspace doc in folder: { location: "workspace", workspace_id: 123, folder_id: 17264196 , markdown: "..." }\n- Item doc: { location: "item", item_id: 456, column_id: "doc_col_1" , markdown: "..." }'}getInputSchema(){return WE}async executeInternal(e){const a=zE.safeParse({...e,type:e.location});if(!a.success)return{content:`Required parameters were not provided for location parameter of ${e.location}`};const t=a.data;try{let a,i,n;if(t.type===HE.enum.workspace){const o={location:{workspace:{workspace_id:t.workspace_id.toString(),name:e.doc_name,kind:t.doc_kind||Mg.Public,folder_id:t.folder_id?.toString()}}},r=await this.mondayApi.request(ME,o);a=r?.create_doc?.id??void 0,i=r?.create_doc?.object_id??void 0,n=r?.create_doc?.url??void 0}else if(t.type===HE.enum.item){const o={itemId:t.item_id.toString()},r=await this.mondayApi.request(BE,o),s=r.items?.[0];if(!s)return{content:`Error: Item with id ${t.item_id} not found.`};const p=s.board?.id,d=s.board?.columns?.find((e=>e&&e.type===Jx.Doc));let c=t.column_id;if(!c)if(d)c=d.id;else{const e={boardId:p.toString(),columnType:Jx.Doc,columnTitle:"Doc"},a=await this.mondayApi.request(mw,e);if(c=a?.create_column?.id,!c)return{content:"Error: Failed to create doc column."}}const l={location:{board:{item_id:t.item_id.toString(),column_id:c}}},m=await this.mondayApi.request(ME,l);if(a=m.create_doc?.id??void 0,i=m.create_doc?.object_id??void 0,n=m.create_doc?.url??void 0,e.doc_name&&a)try{const t={docId:a,name:e.doc_name};await this.mondayApi.request(GE,t)}catch(e){console.warn("Failed to update doc name:",e)}}if(!a)return{content:"Error: Failed to create document."};const o={docId:a,markdown:e.markdown},r=await this.mondayApi.request(qE,o),s=r?.add_content_to_doc_from_markdown?.success,p=r?.add_content_to_doc_from_markdown?.error;return s?{content:{message:"Document successfully created",doc_id:a,object_id:i,doc_url:n,doc_name:e.doc_name}}:{content:`Document ${a} created, but failed to add markdown content: ${p||"Unknown error"}`}}catch(e){return{content:`Error creating document: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends bu{constructor(){super(...arguments),this.name="add_content_to_doc",this.type=y.WRITE,this.annotations=gu({title:"Add Content to Document",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Add markdown content to an existing monday.com document.\n\nIDENTIFICATION: Provide either doc_id or object_id to identify the document:\n- doc_id: The document ID (the id field returned by read_docs). Takes priority if both provided.\n- object_id: The document object ID (the object_id field from read_docs, also visible in the document URL). Will be resolved to a doc_id.\n\nUSAGE EXAMPLES:\n- By doc_id: { doc_id: "123", markdown: "# New Section\\nContent here" }\n- By object_id: { object_id: "456", markdown: "# New Section\\nContent here" }\n- Insert after block: { doc_id: "123", markdown: "Inserted content", after_block_id: "block_789" }'}getInputSchema(){return JE}async executeInternal(e){if(!e.doc_id&&!e.object_id)return{content:"Error: Either doc_id or object_id must be provided."};try{let a=null;if(e.doc_id){const t=await this.mondayApi.request(QE,{docId:[e.doc_id]});a=t.docs?.[0]??null}else{const t=await this.mondayApi.request(KE,{objectId:[e.object_id]});a=t.docs?.[0]??null}if(!a){return{content:`Error: No document found for ${e.doc_id?`doc_id ${e.doc_id}`:`object_id ${e.object_id}`}.`}}const t={docId:a.id,markdown:e.markdown,afterBlockId:e.after_block_id},i=await this.mondayApi.request(YE,t);if(!i?.add_content_to_doc_from_markdown)return{content:"Error: Failed to add content to document — no response from API."};const{success:n,block_ids:o,error:r}=i.add_content_to_doc_from_markdown;if(!n)return{content:`Error adding content to document: ${r||"Unknown error"}`};const s=o?.length??0;return{content:{message:`Successfully added content to document ${a.id}. ${s} block${1===s?"":"s"} created.`,doc_id:a.id,block_ids:o,doc_name:a.name,doc_url:a.url}}}catch(e){return{content:`Error adding content to document: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends bu{constructor(){super(...arguments),this.name="update_workspace",this.type=y.WRITE,this.annotations=gu({title:"Update Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing workspace in monday.com"}getInputSchema(){return nI}async executeInternal(e){const a={id:e.id,attributes:{account_product_id:e.attributeAccountProductId,description:e.attributeDescription,kind:e.attributeKind,name:e.attributeName}},t=await this.mondayApi.request(iI,a),i=await SE(this.mondayApi),n=i?NE(i,t.update_workspace?.id):void 0;return{content:{message:`Workspace ${t.update_workspace?.id} updated`,workspace_id:t.update_workspace?.id,workspace_name:t.update_workspace?.name,workspace_url:n}}}},class extends bu{constructor(){super(...arguments),this.name="update_folder",this.type=y.WRITE,this.annotations=gu({title:"Update Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing folder in monday.com"}getInputSchema(){return rI}async executeInternal(e){const{position_object_id:a,position_object_type:t,position_is_after:i}=e;if(!!a!=!!t)throw new Error("position_object_id and position_object_type must be provided together");const n={folderId:e.folderId,name:e.name,color:e.color,fontWeight:e.fontWeight,customIcon:e.customIcon,parentFolderId:e.parentFolderId,workspaceId:e.workspaceId,accountProductId:e.accountProductId,position:a?{position_is_after:i,position_object_id:a,position_object_type:t}:void 0},o=await this.mondayApi.request(oI,n);return{content:{message:`Folder ${o.update_folder?.id} updated`,folder_id:o.update_folder?.id,folder_name:o.update_folder?.name}}}},class extends bu{constructor(){super(...arguments),this.name="create_workspace",this.type=y.WRITE,this.annotations=gu({title:"Create Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new workspace in monday.com"}getInputSchema(){return pI}async executeInternal(e){const a={name:e.name,workspaceKind:e.workspaceKind,description:e.description,accountProductId:e.accountProductId},t=await this.mondayApi.request(sI,a),i=await SE(this.mondayApi),n=i&&t.create_workspace?.id?NE(i,t.create_workspace.id):void 0;return{content:{message:`Workspace ${t.create_workspace?.id} successfully created`,workspace_id:t.create_workspace?.id,workspace_name:t.create_workspace?.name,workspace_url:n}}}},class extends bu{constructor(){super(...arguments),this.name="create_folder",this.type=y.WRITE,this.annotations=gu({title:"Create Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new folder in a monday.com workspace"}getInputSchema(){return cI}async executeInternal(e){const a={workspaceId:e.workspaceId,name:e.name,color:e.color,fontWeight:e.fontWeight,customIcon:e.customIcon,parentFolderId:e.parentFolderId},t=await this.mondayApi.request(dI,a);return{content:{message:`Folder ${t.create_folder?.id} successfully created`,folder_id:t.create_folder?.id,folder_name:t.create_folder?.name}}}},class extends bu{constructor(){super(...arguments),this.name="move_object",this.type=y.WRITE,this.annotations=gu({title:"Move Object",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Move a folder, board, or overview in monday.com. Use `position` for relative placement based on another object, `parentFolderId` for folder changes, `workspaceId` for workspace moves, and `accountProductId` for account product changes."}getInputSchema(){return uI}async executeUpdateFolder(e){const{id:a,position_object_id:t,position_object_type:i,position_is_after:n,parentFolderId:o,workspaceId:r,accountProductId:s}=e;if(!!t!=!!i)throw new Error("position_object_id and position_object_type must be provided together");const p={folderId:a,position:t?{position_is_after:n,position_object_id:t,position_object_type:i}:void 0,parentFolderId:o,workspaceId:r,accountProductId:s},d=await this.mondayApi.request(oI,p);return{content:{message:"Object moved",object_id:d.update_folder?.id}}}async executeUpdateBoardHierarchy(e){const{id:a,position_object_id:t,position_object_type:i,position_is_after:n,parentFolderId:o,workspaceId:r,accountProductId:s}=e;if(!!t!=!!i)throw new Error("position_object_id and position_object_type must be provided together");const p={boardId:a,attributes:{position:t?{position_is_after:n,position_object_id:t,position_object_type:i}:void 0,folder_id:o,workspace_id:r,account_product_id:s}},d=await this.mondayApi.request(lI,p);return d.update_board_hierarchy?.success?{content:{message:"Board position updated",object_id:d.update_board_hierarchy?.board?.id,action_name:"move_board"}}:{content:`Board position update failed: ${d.update_board_hierarchy?.message}`}}async executeUpdateOverviewHierarchy(e){const{id:a,position_object_id:t,position_object_type:i,position_is_after:n,parentFolderId:o,workspaceId:r,accountProductId:s}=e;if(!!t!=!!i)throw new Error("position_object_id and position_object_type must be provided together");const p={overviewId:a,attributes:{position:t?{position_is_after:n,position_object_id:t,position_object_type:i}:void 0,folder_id:o,workspace_id:r,account_product_id:s}},d=await this.mondayApi.request(mI,p);return d.update_overview_hierarchy?.success?{content:{message:"Overview position updated",object_id:d.update_overview_hierarchy?.overview?.id}}:{content:`Overview position update failed: ${d.update_overview_hierarchy?.message}`}}async executeInternal(e){const{objectType:a}=e;switch(a){case Xb.Folder:return this.executeUpdateFolder(e);case Xb.Board:return this.executeUpdateBoardHierarchy(e);case Xb.Overview:return this.executeUpdateOverviewHierarchy(e);default:throw new Error(`Unsupported object type: ${a}`)}}},class extends bu{constructor(){super(...arguments),this.name="create_dashboard",this.type=y.WRITE,this.annotations=gu({title:"Create Dashboard",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Use this tool to create a new monday.com dashboard that aggregates data from one or more boards. \n Dashboards provide visual representations of board data through widgets and charts.\n \n Use this tool when users want to:\n - Create a dashboard to visualize board data\n - Aggregate information from multiple boards\n - Set up a data visualization container for widgets"}getInputSchema(){return aI}async executeInternal(e){try{const a={name:e.name,workspace_id:e.workspace_id.toString(),board_ids:e.board_ids,kind:e.kind,board_folder_id:e.board_folder_id?.toString()},t=await this.mondayApi.request(XE,a);if(!t.create_dashboard)throw new Error("Failed to create dashboard");const i=t.create_dashboard;return{content:{message:`Dashboard ${i.id} successfully created`,dashboard_id:i.id,dashboard_name:i.name}}}catch(e){const a=e instanceof Error?e.message:String(e);throw new Error(`Failed to create dashboard: ${a}`)}}},class extends bu{constructor(){super(...arguments),this.name="all_widgets_schema",this.type=y.READ,this.annotations=gu({title:"Get All Widget Schemas",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Fetch complete JSON Schema 7 definitions for all available widget types in monday.com.\n \n This tool is essential before creating widgets as it provides:\n - Complete schema definitions for all supported widgets\n - Required and optional fields for each widget type\n - Data type specifications and validation rules\n - Detailed descriptions of widget capabilities\n \n Use this tool when you need to:\n - Understand widget configuration requirements before creating widgets\n - Validate widget settings against official schemas\n - Plan widget implementations with proper data structures\n \n The response includes JSON Schema 7 definitions that describe exactly what settings each widget type accepts."}getInputSchema(){return{}}async executeInternal(){try{const e={},a=await this.mondayApi.request(ZE,e);if(!a.all_widgets_schema||0===a.all_widgets_schema.length)throw new Error("No widget schemas found - API returned empty response");const t={};let i=0;for(const e of a.all_widgets_schema)if(e?.widget_type&&e?.schema){const a="string"==typeof e.schema?JSON.parse(e.schema):e.schema,n=a?.description||a?.title||`${e.widget_type} widget for data visualization`;t[e.widget_type]={type:e.widget_type,description:n,schema:e.schema},i++}if(0===i)throw new Error("No valid widget schemas found in API response");Object.keys(t).map((e=>`• **${e}**: ${t[e].description}`)).join("\n");return{content:{message:"Widgets schema",data:t,url:ZT}}}catch(e){const a=e instanceof Error?e.message:String(e);throw new Error(`Failed to fetch widget schemas: ${a}`)}}},class extends bu{constructor(){super(...arguments),this.name="create_widget",this.type=y.WRITE,this.annotations=gu({title:"Create Widget",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new widget in a dashboard or board view with specific configuration settings.\n \n This tool creates data visualization widgets that display information from monday.com boards:\n **Parent Containers:**\n - **DASHBOARD**: Place widget in a dashboard (most common use case)\n - **BOARD_VIEW**: Place widget in a specific board view\n \n **Critical Requirements:**\n 1. **Schema Compliance**: Widget settings MUST conform to the JSON schema for the specific widget type\n 2. **Use all_widgets_schema first**: Always fetch widget schemas before creating widgets\n 3. **Validate settings**: Ensure all required fields are provided and data types match\n \n **Workflow:**\n 1. Use 'all_widgets_schema' to get schema definitions\n 2. Prepare widget settings according to the schema\n 3. Use this tool to create the widget"}getInputSchema(){return tI}async executeInternal(e){if(!e.settings)throw new Error("You must pass the settings parameter");try{const a={parent:{kind:e.parent_container_type,id:e.parent_container_id.toString()},kind:e.widget_kind,name:e.widget_name,settings:e.settings},t=await this.mondayApi.request(eI,a);if(!t.create_widget)throw new Error("Failed to create widget");const i=t.create_widget;i.parent?.kind===Ly.Dashboard?i.parent.id:i.parent;return{content:{message:`Widget ${i.id} created`,widget_id:i.id,widget_name:i.name,dashboard_id:i.parent?.id}}}catch(a){const t=a instanceof Error?a.message:String(a);throw new Error(`Failed to create ${e.widget_kind} widget: ${t}`)}}},class extends bu{constructor(){super(...arguments),this.name="board_insights",this.type=y.READ,this.annotations=gu({title:"Get Board Insights",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"This tool allows you to calculate insights about board's data by filtering, grouping and aggregating columns. For example, you can get the total number of items in a board, the number of items in each status, the number of items in each column, etc. Use this tool when you need to get a summary of the board's data, for example, you want to know the total number of items in a board, the number of items in each status, the number of items in each column, etc.[REQUIRED PRECONDITION]: Before using this tool, if new columns were added to the board or if you are not familiar with the board's structure (column IDs, column types, status labels, etc.), first use get_board_info to understand the board metadata. This is essential for constructing proper filters and knowing which columns are available.[IMPORTANT]: For some columns, human-friendly label is returned inside 'LABEL_<column_id' field. E.g. for column with id 'status_123' the label is returned inside 'LABEL_status_123' field."}getInputSchema(){return yI}async executeInternal(e){if(!e.aggregations)return{content:'Input must contain the "aggregations" field.'};const{selectElements:a,groupByElements:t}=function(e){const a={},t=e.groupBy?.map((e=>({column_id:e})))||[],i=new Set(e.aggregations.filter((e=>e.function===Sg.Label)).map((e=>e.columnId))),n=e.groupBy?.filter((e=>!i.has(e))).map((e=>({function:Sg.Label,columnId:e})))??[],o=e.aggregations.concat(n).map((e=>{if(e.function){const o=`${e.function}_${e.columnId}`,r=a[o]||0;a[o]=r+1;const s=`${o}_${r}`;return gI.has(e.function)&&(t.some((e=>e.column_id===s))||t.push({column_id:s})),{type:Ig.Function,function:(i=e.function,n=e.columnId,{function:i,params:i===Sg.CountItems?[]:[{type:Ig.Column,column:bI(n),as:n}]}),as:s}}var i,n;const o={type:Ig.Column,column:bI(e.columnId),as:e.columnId};return t.some((a=>a.column_id===e.columnId))||t.push({column_id:e.columnId}),o}));return t.forEach((e=>{o.some((a=>a.as===e.column_id))||o.push({type:Ig.Column,column:bI(e.column_id),as:e.column_id})})),{selectElements:o,groupByElements:t}}(e),i=function(e){if(!e.filters&&!e.orderBy)return;const a={};return e.filters&&(a.rules=e.filters.map((e=>({column_id:e.columnId,compare_value:e.compareValue,operator:e.operator,compare_attribute:e.compareAttribute}))),a.operator=e.filtersOperator),e.orderBy&&(a.order_by=function(e){return e.orderBy?.map((e=>({column_id:e.columnId,direction:e.direction})))}(e)),a}(e),n=function(e){return{id:e.boardId.toString(),type:Eg.Table}}(e),o={query:{from:n,query:i,select:a,group_by:t,limit:e.limit},boardId:String(e.boardId)},r=await this.mondayApi.request(fI,o),s=(r.aggregate?.results??[]).map((e=>{const a={};return(e.entries??[]).forEach((e=>{const t=e.alias??"";if(!t)return;const i=e.value;if(!i)return void(a[t]=null);const n=i.result??i.value??null;a[t]=n})),a}));return s.length?{content:{message:"Board insights retrieved",board_name:r.boards?.[0]?.name,board_url:r.boards?.[0]?.url,data:s}}:{content:"No board insights found for the given query."}}},class extends bu{constructor(){super(...arguments),this.name="search",this.type=y.READ,this.annotations=gu({title:"Search",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Search within monday.com platform. Can search for boards, documents, forms, folders.\nFor users and teams, use list_users_and_teams tool.\nFor workspaces, use list_workspaces tool.\nFor items and groups, use get_board_items_page tool.\nFor groups, use get_board_info tool.\nIMPORTANT: ids returned by this tool are prefixed with the type of the object (e.g doc-123, board-456, folder-789). When passing the ids to other tools, you need to remove the prefix and just pass the number.\n "}getInputSchema(){return II}async executeInternal(e){if(e.searchType!==KT.FOLDERS&&e.searchTerm)try{return{content:{message:"Search results",data:(await this.searchWithDevEndpointAsync(e)).items}}}catch(e){fT(e)}const a={[KT.BOARD]:this.searchBoardsAsync.bind(this),[KT.DOCUMENTS]:this.searchDocsAsync.bind(this),[KT.FOLDERS]:this.searchFoldersAsync.bind(this)}[e.searchType];if(!a)throw new Error(`Unsupported search type: ${e.searchType}`);const t=await a(e);return{content:{message:"Search results",disclaimer:t.wasFiltered||!e.searchTerm?void 0:"[IMPORTANT]Items were not filtered. Please perform the filtering.",data:t.items}}}async searchWithDevEndpointAsync(e){const a={[KT.BOARD]:{entities:[{boards:{workspace_ids:e.workspaceIds?.map((e=>e.toString()))}}]},[KT.DOCUMENTS]:{entities:[{docs:{workspace_ids:e.workspaceIds?.map((e=>e.toString()))}}]},[KT.FOLDERS]:void 0}[e.searchType];if(!a)throw new Error(`Unsupported search type for dev endpoint: ${e.searchType}`);if(e.page>1)throw new Error("Pagination is not supported for search, increase the limit parameter instead");const t={query:e.searchTerm,limit:e.limit,filters:a},i=(await this.mondayApi.request(TI,t,{versionOverride:"dev",timeout:mT})).search||[],n=[];for(const e of i)"BoardSearchResult"===e.__typename?n.push({id:YT.BOARD+e.data.id,title:e.data.name,url:e.data.url}):"DocSearchResult"===e.__typename&&n.push({id:YT.DOCUMENT+e.data.id,title:e.data.name});return{items:n,wasFiltered:!0}}async searchFoldersAsync(e){const a={...this.getPagingParamsForSearch(e,100),workspace_ids:e.workspaceIds?.map((e=>e.toString()))};a.workspace_ids??=[],0===a.workspace_ids.length&&uT(new Error("Searching for folders require specifying workspace ids"),"search folders");const t=await this.mondayApi.request(xI,a),i=this.searchAndVirtuallyPaginate(e,t.folders||[],(e=>e.name));return{items:i.items.map((e=>({id:YT.FOLDER+e.id,title:e.name}))),wasFiltered:i.wasFiltered}}async searchDocsAsync(e){const a={...this.getPagingParamsForSearch(e),workspace_ids:e.workspaceIds?.map((e=>e.toString()))},t=await this.mondayApi.request(wI,a),i=this.searchAndVirtuallyPaginate(e,t.docs||[],(e=>e.name));return{items:i.items.map((e=>({id:YT.DOCUMENT+e.id,title:e.name,url:e.url||void 0}))),wasFiltered:i.wasFiltered}}async searchBoardsAsync(e){const a={...this.getPagingParamsForSearch(e),workspace_ids:e.workspaceIds?.map((e=>e.toString()))},t=await this.mondayApi.request(_I,a),i=this.searchAndVirtuallyPaginate(e,t.boards||[],(e=>e.name));return{items:i.items.map((e=>({id:YT.BOARD+e.id,title:e.name,url:e.url}))),wasFiltered:i.wasFiltered}}getPagingParamsForSearch(e,a=1e3){return{page:e.searchTerm?1:e.page,limit:e.searchTerm?Math.min(1e3,a):e.limit}}searchAndVirtuallyPaginate(e,a,t){if(a.length<=EI)return{items:a,wasFiltered:!1};const i=PE(e.searchTerm??""),n=(e.page-1)*e.limit,o=n+e.limit;return{items:a.filter((e=>PE(t(e)).includes(i))).slice(n,o),wasFiltered:!0}}},class extends bu{constructor(){super(...arguments),this.name="get_user_context",this.type=y.READ,this.annotations=gu({title:"Get User Context",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Fetch current user information and their relevant items (boards, folders, workspaces, dashboards).\n \n Use this tool at the beginning of conversations to:\n - Get context about who the current user is (id, name, title)\n - Discover user's favorite boards, folders, workspaces, and dashboards\n - Get user's most relevant boards based on visit frequency and recency\n - Get user's most relevant people based on interaction frequency and recency\n - Reduce the need for search requests by knowing user's commonly accessed items\n "}getInputSchema(){}async executeInternal(){const{me:e,favorites:a,intelligence:t}=await this.mondayApi.request(RI,{},{versionOverride:"dev"});if(!e)return{content:"AUTHENTICATION_ERROR: Unable to fetch current user. Verify API token and user permissions."};return{content:{message:"User context",...{user:e,favorites:await this.fetchFavorites(a||[]),relevantBoards:this.extractRelevantBoards(t),relevantPeople:this.extractRelevantPeople(t)}}}}async fetchFavorites(e){const a=this.groupByType(e),t=Object.keys(a);if(0===t.length)return[];const i={};for(const e of t)i[$I[e]]=a[e];const n=await this.mondayApi.request(CI,i),o=[];for(const e of t){const a=LI[e];for(const t of n[a]??[])t?.id&&o.push({id:t.id,name:t.name,type:e})}return o}extractRelevantBoards(e){if(!e?.relevant_boards)return[];const a=[];for(const t of e.relevant_boards)t?.id&&t?.board?.name&&a.push({id:t.id,name:t.board.name});return a}extractRelevantPeople(e){if(!e?.relevant_people)return[];const a=[];for(const t of e.relevant_people)t?.id&&t?.user?.name&&a.push({id:t.id,name:t.user.name});return a}groupByType(e){const a={};for(const t of e){const e=t?.object;e?.id&&e?.type&&(a[e.type]??=[]).push(e.id)}return a}},class extends bu{constructor(){super(...arguments),this.name="update_assets_on_item",this.type=y.WRITE,this.annotations=gu({title:"Update Assets On Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update a file or doc column value on an item using existing assets, docs, or links. Sets the column to the provided list of files, adding new ones and removing any not in the list."}getInputSchema(){return kI}async executeInternal(e){const a={boardId:e.boardId,itemId:e.itemId,columnId:e.columnId,files:e.files},t=await this.mondayApi.request(DI,a);return{content:`Item ${t.update_assets_on_item?.id} (${t.update_assets_on_item?.name}) assets successfully updated`}}},class extends bu{constructor(){super(...arguments),this.name="get_notetaker_meetings",this.type=y.READ,this.annotations=gu({title:"Get Notetaker Meetings",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Retrieve notetaker meetings with optional detailed fields. Use include_summary, include_topics, include_action_items, and include_transcript flags to control which details are returned. Use access to filter by meeting access level (OWN, SHARED_WITH_ME, SHARED_WITH_ACCOUNT, ALL). Defaults to OWN. Supports filtering by ids, search term, and cursor-based pagination."}getInputSchema(){return PI}async executeInternal(e){const a={access:e.access};e.ids&&e.ids.length>0&&(a.ids=e.ids),e.search&&(a.search=e.search);const t={limit:e.limit,cursor:e.cursor||void 0,filters:a,includeSummary:e.include_summary,includeTopics:e.include_topics,includeActionItems:e.include_action_items,includeTranscript:e.include_transcript},i=await this.mondayApi.request(FI,t,{versionOverride:"2026-04"}),n=i.notetaker?.meetings;if(!n?.meetings||0===n.meetings.length)return{content:"No notetaker meetings found matching the specified criteria."};return{content:{message:"Meetings retrieved",data:{meetings:n.meetings,pagination:{has_next_page:n.page_info?.has_next_page??!1,cursor:n.page_info?.cursor??null,count:n.meetings.length}}}}}},class extends bu{constructor(){super(...arguments),this.name="create_view",this.type=y.WRITE,this.annotations=gu({title:"Create View",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Create a new board view (tab) with optional filters and sorting. This creates a saved view on a monday.com board that users can switch to.\n\nFilter operators: any_of, not_any_of, is_empty, is_not_empty, greater_than, lower_than, between, contains_text, not_contains_text\n\nExample filter for people column: { "rules": [{ "column_id": "people", "compare_value": ["person-12345"], "operator": "any_of" }] }\nExample filter for status column: { "rules": [{ "column_id": "status", "compare_value": [1], "operator": "any_of" }] }'}getInputSchema(){return Dw}async executeInternal(e){const a={boardId:e.boardId,type:e.type,name:e.name,filter:e.filter,sort:e.sort},t=await this.mondayApi.request(Aw,a);return t.create_view?{content:`View "${t.create_view.name}" (ID: ${t.create_view.id}, type: ${t.create_view.type}) successfully created`}:{content:"Failed to create view - no response from API"}}}],vS=[...hS,...fS,...vu];export{pT as ToolMode,y as ToolType,hS as allGraphqlApiTools,vu as allMondayAppsTools,fS as allMondayDevTools,vS as allTools};
1855
1882
  //# sourceMappingURL=index.js.map