@mondaydotcomorg/agent-toolkit 5.70.1 → 5.70.3
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.
- package/dist/cjs/core/index.js +51 -51
- package/dist/cjs/core/index.js.map +1 -1
- package/dist/cjs/mcp/index.js +67 -67
- package/dist/cjs/mcp/index.js.map +1 -1
- package/dist/cjs/openai/index.js +31 -31
- package/dist/cjs/openai/index.js.map +1 -1
- package/dist/esm/core/index.js +64 -64
- package/dist/esm/core/index.js.map +1 -1
- package/dist/esm/mcp/index.js +77 -77
- package/dist/esm/mcp/index.js.map +1 -1
- package/dist/esm/openai/index.js +31 -31
- package/dist/esm/openai/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cjs/openai/index.js
CHANGED
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
}
|
|
64
64
|
`,pc=rc`
|
|
65
65
|
query GetDocComments($boardId: ID!, $itemsLimit: Int, $updatesLimit: Int) {
|
|
66
|
-
boards(ids: [$boardId]) {
|
|
66
|
+
boards(ids: [$boardId], limit: 1) {
|
|
67
67
|
items_page(limit: $itemsLimit) {
|
|
68
68
|
items {
|
|
69
69
|
id
|
|
@@ -136,7 +136,7 @@
|
|
|
136
136
|
}
|
|
137
137
|
`,uc=rc`
|
|
138
138
|
query getBoardSchema($boardId: ID!) {
|
|
139
|
-
boards(ids: [$boardId]) {
|
|
139
|
+
boards(ids: [$boardId], limit: 1) {
|
|
140
140
|
groups {
|
|
141
141
|
id
|
|
142
142
|
title
|
|
@@ -468,7 +468,7 @@
|
|
|
468
468
|
}
|
|
469
469
|
`,Sc=rc`
|
|
470
470
|
query getWorkspaceInfo($workspace_id: ID!) {
|
|
471
|
-
workspaces(ids: [$workspace_id]) {
|
|
471
|
+
workspaces(ids: [$workspace_id], limit: 1) {
|
|
472
472
|
id
|
|
473
473
|
name
|
|
474
474
|
description
|
|
@@ -1142,7 +1142,7 @@
|
|
|
1142
1142
|
}
|
|
1143
1143
|
`,$h={id:n.z.number().describe("The unique identifier of the update to delete")};const xh=rc`
|
|
1144
1144
|
query GetItemUpdates($itemId: ID!, $limit: Int, $page: Int, $includeReplies: Boolean!, $includeAssets: Boolean!) {
|
|
1145
|
-
items(ids: [$itemId]) {
|
|
1145
|
+
items(ids: [$itemId], limit: 1) {
|
|
1146
1146
|
id
|
|
1147
1147
|
url
|
|
1148
1148
|
updates(limit: $limit, page: $page) {
|
|
@@ -1178,7 +1178,7 @@
|
|
|
1178
1178
|
}
|
|
1179
1179
|
`,Mh=rc`
|
|
1180
1180
|
query GetBoardUpdates($boardId: ID!, $limit: Int, $page: Int, $includeReplies: Boolean!, $includeAssets: Boolean!, $fromDate: ISO8601DateTime, $toDate: ISO8601DateTime, $boardUpdatesOnly: Boolean) {
|
|
1181
|
-
boards(ids: [$boardId]) {
|
|
1181
|
+
boards(ids: [$boardId], limit: 1) {
|
|
1182
1182
|
id
|
|
1183
1183
|
url
|
|
1184
1184
|
updates(limit: $limit, page: $page, board_updates_only: $boardUpdatesOnly, from_date: $fromDate, to_date: $toDate) {
|
|
@@ -1214,7 +1214,7 @@
|
|
|
1214
1214
|
}
|
|
1215
1215
|
`;var Vh;!function(e){e.Item="Item",e.Board="Board"}(Vh||(Vh={}));const Fh={objectId:n.z.string().describe("The ID of the item or board to get updates from"),objectType:n.z.enum([Vh.Item,Vh.Board]).describe("Type of object for which objectId was provided"),limit:n.z.number().min(1).max(100).optional().default(25).describe("Number of updates per page (default: 25, max: 100)"),page:n.z.number().min(1).optional().default(1).describe("Page number for pagination (default: 1)"),includeReplies:n.z.boolean().optional().default(!1).describe("Include update replies in the response"),includeAssets:n.z.boolean().optional().default(!1).describe("Include file attachments in the response"),fromDate:n.z.string().optional().describe('Start of date range filter (e.g. "2025-01-01" or "2025-01-01T00:00:00Z"). Must be used together with toDate. Only supported for Board objectType.'),toDate:n.z.string().optional().describe('End of date range filter (e.g. "2025-06-01" or "2025-06-01T23:59:59Z"). Must be used together with fromDate. Only supported for Board objectType.'),includeItemUpdates:n.z.boolean().optional().default(!1).describe("When objectType is Board, also include updates on individual items. Defaults to false, returning only board discussion. Set to true to retrieve all updates on a board, including updates on individual items.")};function Bh(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?`${e}T00:00:00Z`:e}const zh={columnId:n.z.string().describe("The id of the column to be deleted")},qh={boardId:n.z.number().describe("The id of the board to which the new column will be added"),...zh};const jh={itemId:n.z.number()};const Gh={};const Hh=rc`
|
|
1216
1216
|
query getBoardData($boardId: ID!, $itemsLimit: Int!, $queryParams: ItemsQuery) {
|
|
1217
|
-
boards(ids: [$boardId]) {
|
|
1217
|
+
boards(ids: [$boardId], limit: 1) {
|
|
1218
1218
|
id
|
|
1219
1219
|
name
|
|
1220
1220
|
items_page(limit: $itemsLimit, query_params: $queryParams) {
|
|
@@ -1265,7 +1265,7 @@
|
|
|
1265
1265
|
}
|
|
1266
1266
|
}
|
|
1267
1267
|
}
|
|
1268
|
-
`,Yh=n.z.array(n.z.object({columnId:n.z.string().describe('
|
|
1268
|
+
`,Yh=n.z.array(n.z.object({columnId:n.z.string().describe('Ordinary column ids are board-specific. Use get_board_info with filters.columns.only to get them for the current board. Also accepts four virtual columns that get_board_info does not return: "group" (the group id goes in compareValue, e.g. "group_mm6wsvcc" - the columnId itself is always the literal "group"), "__creation_log__", "__last_updated__" and "__item_id__".'),compareAttribute:n.z.string().optional().describe("The attribute to compare the value to. This is OPTIONAL property."),compareValue:n.z.union([n.z.string(),n.z.number(),n.z.boolean(),n.z.array(n.z.union([n.z.string(),n.z.number()]))]).describe('The value to compare the attribute to. This can be a string or index value depending on the column type. The operators within_the_last and within_the_next are the exception: they take a two item array of [UNIT, AMOUNT] such as ["DAYS", 7].'),operator:n.z.nativeEnum(_s).optional().default(_s.AnyOf).describe("The operator to use for the filter")})).optional().describe(`The configuration of filters to apply on the items. Use get_board_info with filters.columns.only for column ids and types on the board. Before sending the filters, use get_column_type_info with fetchMode "${cm.Guidelines}" and use data.guidelines.filter (null if that type has no documented rules).`),Kh=n.z.nativeEnum(hs).optional().default(hs.And).describe("The operator to use for the filters"),Qh={boardId:n.z.string().describe("The ID of the board to fetch complete data for"),filters:Yh,filtersOperator:Kh};const Jh=rc`
|
|
1269
1269
|
query GetBoardActivity(
|
|
1270
1270
|
$boardId: ID!
|
|
1271
1271
|
$itemIds: [ID!]
|
|
@@ -1276,7 +1276,7 @@
|
|
|
1276
1276
|
$page: Int = 1
|
|
1277
1277
|
$includeData: Boolean!
|
|
1278
1278
|
) {
|
|
1279
|
-
boards(ids: [$boardId]) {
|
|
1279
|
+
boards(ids: [$boardId], limit: 1) {
|
|
1280
1280
|
name
|
|
1281
1281
|
url
|
|
1282
1282
|
activity_logs(item_ids: $itemIds, user_ids: $userIds, from: $fromDate, to: $toDate, limit: $limit, page: $page) {
|
|
@@ -1296,7 +1296,7 @@
|
|
|
1296
1296
|
$includeColumns: Boolean!
|
|
1297
1297
|
$includeViews: Boolean!
|
|
1298
1298
|
) {
|
|
1299
|
-
boards(ids: [$boardId]) {
|
|
1299
|
+
boards(ids: [$boardId], limit: 1) {
|
|
1300
1300
|
# Basic Board Metadata
|
|
1301
1301
|
id
|
|
1302
1302
|
name
|
|
@@ -1385,7 +1385,7 @@
|
|
|
1385
1385
|
}
|
|
1386
1386
|
`,e_=rc`
|
|
1387
1387
|
query GetBoardInfoViewIndex($boardId: ID!) {
|
|
1388
|
-
boards(ids: [$boardId]) {
|
|
1388
|
+
boards(ids: [$boardId], limit: 1) {
|
|
1389
1389
|
id
|
|
1390
1390
|
views {
|
|
1391
1391
|
id
|
|
@@ -1395,7 +1395,7 @@
|
|
|
1395
1395
|
}
|
|
1396
1396
|
`,t_=rc`
|
|
1397
1397
|
query GetBoardInfoJustColumns($boardId: ID!) {
|
|
1398
|
-
boards(ids: [$boardId]) {
|
|
1398
|
+
boards(ids: [$boardId], limit: 1) {
|
|
1399
1399
|
columns {
|
|
1400
1400
|
id
|
|
1401
1401
|
title
|
|
@@ -1470,7 +1470,7 @@
|
|
|
1470
1470
|
$includeDescription: Boolean!
|
|
1471
1471
|
$includeGroup: Boolean!
|
|
1472
1472
|
) {
|
|
1473
|
-
boards(ids: [$boardId]) {
|
|
1473
|
+
boards(ids: [$boardId], limit: 1) {
|
|
1474
1474
|
id
|
|
1475
1475
|
name
|
|
1476
1476
|
hierarchy_type
|
|
@@ -1496,11 +1496,11 @@
|
|
|
1496
1496
|
}
|
|
1497
1497
|
}
|
|
1498
1498
|
}
|
|
1499
|
-
`;var s_;!function(e){e.BOARD="BOARD",e.DOCUMENTS="DOCUMENTS",e.FOLDERS="FOLDERS",e.WORKSPACES="WORKSPACES",e.UPDATES="UPDATES",e.ITEMS="ITEMS",e.TIMELINE_ITEMS="TIMELINE_ITEMS",e.DASHBOARDS="DASHBOARDS"}(s_||(s_={}));const d_=Object.values(s_).join(", ");function p_(e){return e.trim().toUpperCase().replace(/[\s\-/]+/g,"_").replace(/^_+|_+$/g,"")}const l_={BOARDS:s_.BOARD,DOCS:s_.DOCUMENTS,DOC:s_.DOCUMENTS,DOCUMENT:s_.DOCUMENTS,FOLDER:s_.FOLDERS,WORKSPACE:s_.WORKSPACES,UPDATE:s_.UPDATES,ITEM:s_.ITEMS,PULSE:s_.ITEMS,PULSES:s_.ITEMS,TIMELINE_ITEM:s_.TIMELINE_ITEMS,TIMELINE:s_.TIMELINE_ITEMS,DASHBOARD:s_.DASHBOARDS,OVERVIEW:s_.DASHBOARDS,OVERVIEWS:s_.DASHBOARDS},c_={USER:"To search for users or teams, use the list_users_and_teams tool.",USERS:"To search for users or teams, use the list_users_and_teams tool.",PERSON:"To search for users or teams, use the list_users_and_teams tool.",PEOPLE:"To search for users or teams, use the list_users_and_teams tool.",TEAM:"To search for users or teams, use the list_users_and_teams tool.",TEAMS:"To search for users or teams, use the list_users_and_teams tool.",USER_OR_TEAM:"To search for users or teams, use the list_users_and_teams tool.",USER_TEAM:"To search for users or teams, use the list_users_and_teams tool.",USERS_AND_TEAMS:"To search for users or teams, use the list_users_and_teams tool.",BOARD_ITEM:'To list items within a specific board, use the get_board_items_page tool. To search items across the account, use searchType "ITEMS".',BOARD_ITEMS:'To list items within a specific board, use the get_board_items_page tool. To search items across the account, use searchType "ITEMS".',BOARD_ITEMS_PAGE:'To list items within a specific board, use the get_board_items_page tool. To search items across the account, use searchType "ITEMS".',GET_BOARD_ITEMS_PAGE:'To list items within a specific board, use the get_board_items_page tool. To search items across the account, use searchType "ITEMS".',BOARD_ITEMS_OR_GROUPS:'To list items within a specific board, use the get_board_items_page tool. To search items across the account, use searchType "ITEMS".',BOARD_ITEMS_AND_GROUPS:'To list items within a specific board, use the get_board_items_page tool. To search items across the account, use searchType "ITEMS".',GROUP:"To list groups within a board, use the get_board_info tool.",GROUPS:"To list groups within a board, use the get_board_info tool.",FORM:"Forms are not searchable.",FORMS:"Forms are not searchable."},m_={boardId:n.z.number().describe("The id of the board to get items from"),itemIds:n.z.array(n.z.number()).optional().describe("The ids of the items to get. The count of items should be less than 100."),searchTerm:n.z.string().optional().describe('\n The search term to use for the search.\n - Use this when: the user provides a vague, incomplete, or approximate search term (e.g., “marketing campaign”, “John’s task”, “budget-related”), and there isn’t a clear exact compare value for a specific field.\n - Do not use this when: the user specifies an exact value that maps directly to a column comparison (e.g., name contains "marketing campaign", status = "Done", priority = "High", owner = "Daniel"). In these cases, prefer structured compare filters.\n '),limit:n.z.number().min(1).max(500).optional().default(25).describe("The number of items to get"),cursor:n.z.string().optional().describe("The cursor to get the next page of items, use the nextCursor from the previous response. If the nextCursor was null, it means there are no more items to get"),includeColumns:n.z.boolean().optional().default(!1).describe("Whether to include column values in the response.\nPERFORMANCE OPTIMIZATION: Only set this to true when you actually need the column data. Excluding columns significantly reduces token usage and improves response latency. If you only need to count items, get item IDs/names, or check if items exist, keep this false."),includeGroup:n.z.boolean().optional().default(!0).describe("Whether to include each item's board group (id and title) in the response. Set to false to reduce token usage when group membership is not needed."),includeItemDescription:n.z.boolean().optional().default(!1).describe("Whether to include the item's description in the response. The item description is the rich-text body content that appears inside a monday.com item (similar to a task description or issue body). Set this to true when the user asks about an item's description, details, body, or notes. PERFORMANCE OPTIMIZATION: Only set this to true when you actually need the item description content."),includeSubItems:n.z.boolean().optional().default(!1).describe("Whether to include sub items in the response. PERFORMANCE OPTIMIZATION: Only set this to true when you actually need the sub items data."),subItemLimit:n.z.number().min(1).max(100).optional().default(25).describe("The number of sub items to get per item. This is only used when includeSubItems is true."),filters:Yh,filtersOperator:Kh,columnIds:n.z.array(n.z.string()).optional().describe("The ids of the item columns and subitem columns to get, can be used to reduce the response size when user asks for specific columns. Works only when includeColumns is true. If not provided, all columns will be returned"),orderBy:n.z.array(n.z.object({columnId:n.z.string().describe('
|
|
1499
|
+
`;var s_;!function(e){e.BOARD="BOARD",e.DOCUMENTS="DOCUMENTS",e.FOLDERS="FOLDERS",e.WORKSPACES="WORKSPACES",e.UPDATES="UPDATES",e.ITEMS="ITEMS",e.TIMELINE_ITEMS="TIMELINE_ITEMS",e.DASHBOARDS="DASHBOARDS"}(s_||(s_={}));const d_=Object.values(s_).join(", ");function p_(e){return e.trim().toUpperCase().replace(/[\s\-/]+/g,"_").replace(/^_+|_+$/g,"")}const l_={BOARDS:s_.BOARD,DOCS:s_.DOCUMENTS,DOC:s_.DOCUMENTS,DOCUMENT:s_.DOCUMENTS,FOLDER:s_.FOLDERS,WORKSPACE:s_.WORKSPACES,UPDATE:s_.UPDATES,ITEM:s_.ITEMS,PULSE:s_.ITEMS,PULSES:s_.ITEMS,TIMELINE_ITEM:s_.TIMELINE_ITEMS,TIMELINE:s_.TIMELINE_ITEMS,DASHBOARD:s_.DASHBOARDS,OVERVIEW:s_.DASHBOARDS,OVERVIEWS:s_.DASHBOARDS},c_={USER:"To search for users or teams, use the list_users_and_teams tool.",USERS:"To search for users or teams, use the list_users_and_teams tool.",PERSON:"To search for users or teams, use the list_users_and_teams tool.",PEOPLE:"To search for users or teams, use the list_users_and_teams tool.",TEAM:"To search for users or teams, use the list_users_and_teams tool.",TEAMS:"To search for users or teams, use the list_users_and_teams tool.",USER_OR_TEAM:"To search for users or teams, use the list_users_and_teams tool.",USER_TEAM:"To search for users or teams, use the list_users_and_teams tool.",USERS_AND_TEAMS:"To search for users or teams, use the list_users_and_teams tool.",BOARD_ITEM:'To list items within a specific board, use the get_board_items_page tool. To search items across the account, use searchType "ITEMS".',BOARD_ITEMS:'To list items within a specific board, use the get_board_items_page tool. To search items across the account, use searchType "ITEMS".',BOARD_ITEMS_PAGE:'To list items within a specific board, use the get_board_items_page tool. To search items across the account, use searchType "ITEMS".',GET_BOARD_ITEMS_PAGE:'To list items within a specific board, use the get_board_items_page tool. To search items across the account, use searchType "ITEMS".',BOARD_ITEMS_OR_GROUPS:'To list items within a specific board, use the get_board_items_page tool. To search items across the account, use searchType "ITEMS".',BOARD_ITEMS_AND_GROUPS:'To list items within a specific board, use the get_board_items_page tool. To search items across the account, use searchType "ITEMS".',GROUP:"To list groups within a board, use the get_board_info tool.",GROUPS:"To list groups within a board, use the get_board_info tool.",FORM:"Forms are not searchable.",FORMS:"Forms are not searchable."},m_={boardId:n.z.number().describe("The id of the board to get items from"),itemIds:n.z.array(n.z.number()).optional().describe("The ids of the items to get. The count of items should be less than 100."),searchTerm:n.z.string().optional().describe('\n The search term to use for the search.\n - Use this when: the user provides a vague, incomplete, or approximate search term (e.g., “marketing campaign”, “John’s task”, “budget-related”), and there isn’t a clear exact compare value for a specific field.\n - Do not use this when: the user specifies an exact value that maps directly to a column comparison (e.g., name contains "marketing campaign", status = "Done", priority = "High", owner = "Daniel"). In these cases, prefer structured compare filters.\n '),limit:n.z.number().min(1).max(500).optional().default(25).describe("The number of items to get"),cursor:n.z.string().optional().describe("The cursor to get the next page of items, use the nextCursor from the previous response. If the nextCursor was null, it means there are no more items to get"),includeColumns:n.z.boolean().optional().default(!1).describe("Whether to include column values in the response.\nPERFORMANCE OPTIMIZATION: Only set this to true when you actually need the column data. Excluding columns significantly reduces token usage and improves response latency. If you only need to count items, get item IDs/names, or check if items exist, keep this false."),includeGroup:n.z.boolean().optional().default(!0).describe("Whether to include each item's board group (id and title) in the response. Set to false to reduce token usage when group membership is not needed."),includeItemDescription:n.z.boolean().optional().default(!1).describe("Whether to include the item's description in the response. The item description is the rich-text body content that appears inside a monday.com item (similar to a task description or issue body). Set this to true when the user asks about an item's description, details, body, or notes. PERFORMANCE OPTIMIZATION: Only set this to true when you actually need the item description content."),includeSubItems:n.z.boolean().optional().default(!1).describe("Whether to include sub items in the response. PERFORMANCE OPTIMIZATION: Only set this to true when you actually need the sub items data."),subItemLimit:n.z.number().min(1).max(100).optional().default(25).describe("The number of sub items to get per item. This is only used when includeSubItems is true."),filters:Yh,filtersOperator:Kh,columnIds:n.z.array(n.z.string()).optional().describe("The ids of the item columns and subitem columns to get, can be used to reduce the response size when user asks for specific columns. Works only when includeColumns is true. If not provided, all columns will be returned"),orderBy:n.z.array(n.z.object({columnId:n.z.string().describe('Ordinary column ids are board-specific. Use get_board_info with filters.columns.only to get them for the current board. Also accepts four virtual columns that get_board_info does not return: "group", "__creation_log__", "__last_updated__" and "__item_id__".'),direction:n.z.nativeEnum(us).optional().default(us.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 u_={boardId:n.z.number().describe("The id of the board to get the schema of")};const h_=rc`
|
|
1500
1500
|
query GetColumnTypeSchema($type: ColumnType!) {
|
|
1501
1501
|
get_column_type_schema(type: $type)
|
|
1502
1502
|
}
|
|
1503
|
-
`,__="https://developer.monday.com/api-reference",f_={group:'Filters items by the board group they belong to. The columnId is the literal string "group" - a group id such as "group_mm6wsvcc" is NEVER a valid columnId. For filtering by group id, use any_of or not_any_of. Use an array of group ids, as returned in an item\'s group.id or by get_board_info.\nEXAMPLES:\n ✅ Correct: {"columnId": "group", "compareValue": ["group_mm6wsvcc"], "operator": "any_of"} // group id goes in compareValue\n ✅ Correct: {"columnId": "group", "compareValue": ["group_mm6wsvcc", "group_mm4w1e0n"], "operator": "any_of"} // several groups\n ❌ Wrong: {"columnId": "group_mm6wsvcc", "compareValue": "group_mm6wsvcc"} // group id used as the columnId\n ❌ Wrong: {"columnId": "__group__", "compareValue": ["group_mm6wsvcc"], "operator": "any_of"} // the columnId is exactly "group", with no surrounding underscores\n ❌ Wrong: {"columnId": "group", "compareValue": "Backlog", "operator": "any_of"} // group title instead of group id',last_updated:'The columnId is the literal string "__last_updated__", with two underscores before and after. Supported operators: any_of, not_any_of, within_the_last. With any_of and not_any_of, compareValue is an array holding one of "TODAY", "YESTERDAY", "THIS_WEEK", "THIS_MONTH". Optionally pair it with compareAttribute: "UPDATED_AT" to compare the update date rather than the person who updated. For any other range, including the previous week or month, use within_the_last with a [UNIT, AMOUNT] window.\nThis id is also the correct one to use in orderBy to sort items by when they were last updated.\nEXAMPLES:\n ✅ Correct: {"columnId": "__last_updated__", "compareValue": ["TODAY"], "operator": "any_of", "compareAttribute": "UPDATED_AT"} // updated today\n ✅ Correct: {"columnId": "__last_updated__", "compareValue": ["THIS_WEEK"], "operator": "not_any_of", "compareAttribute": "UPDATED_AT"} // using THIS_WEEK with not_any_of\n ✅ Correct: {"columnId": "__last_updated__", "compareValue": ["DAYS", 7], "operator": "within_the_last", "compareAttribute": "UPDATED_AT"} // updated in the last 7 days\n ✅ Correct: {"columnId": "__last_updated__", "compareValue": ["WEEKS", 1], "operator": "within_the_last", "compareAttribute": "UPDATED_AT"} // updated in the previous week\n ❌ Wrong: {"columnId": "last_updated", "compareValue": ["TODAY"], "operator": "any_of", "compareAttribute": "UPDATED_AT"} // missing the underscores around last_updated\n ❌ Wrong: {"columnId": "__last_updated__", "compareValue": ["LAST_MONTH"], "operator": "any_of", "compareAttribute": "UPDATED_AT"} // LAST_MONTH and LAST_WEEK match no items, use within_the_last with ["MONTHS", 1] or ["WEEKS", 1]\n ❌ Wrong: {"columnId": "__last_updated__", "compareValue": "TODAY", "operator": "any_of", "compareAttribute": "UPDATED_AT"} // not using array for any_of operator',creation_log:'The columnId is the literal string "__creation_log__", with two underscores before and after. Supported operators: any_of, not_any_of, within_the_last. With any_of and not_any_of, compareValue is an array holding one of "TODAY", "YESTERDAY", "THIS_WEEK", "THIS_MONTH". Optionally pair it with compareAttribute: "CREATED_AT" to compare the creation date rather than the person who created the item. For any other range, including the previous week or month, use within_the_last with a [UNIT, AMOUNT] window.\nThis id is also the correct one to use in orderBy to sort items by creation time.\nEXAMPLES:\n ✅ Correct: {"columnId": "__creation_log__", "compareValue": ["TODAY"], "operator": "any_of", "compareAttribute": "CREATED_AT"} // items created today\n ✅ Correct: {"columnId": "__creation_log__", "compareValue": ["THIS_WEEK"], "operator": "not_any_of", "compareAttribute": "CREATED_AT"} // items not created this week\n ✅ Correct: {"columnId": "__creation_log__", "compareValue": ["DAYS", 30], "operator": "within_the_last", "compareAttribute": "CREATED_AT"} // created in the last 30 days\n ❌ Wrong: {"columnId": "creation_log", "compareValue": ["TODAY"], "operator": "any_of", "compareAttribute": "CREATED_AT"} // missing the underscores around creation_log\n ❌ Wrong: {"columnId": "__creation_log__", "compareValue": ["LAST_MONTH"], "operator": "any_of", "compareAttribute": "CREATED_AT"} // LAST_MONTH and LAST_WEEK match no items, use within_the_last with ["MONTHS", 1] or ["WEEKS", 1]\n ❌ Wrong: {"columnId": "__creation_log__", "compareValue": ["PAST_DATETIME", "14"], "operator": "within_the_last"} // PAST_DATETIME is not a unit, use ["DAYS", 14]',item_id:'The columnId is the literal string "__item_id__", with two underscores before and after. Prefer the tool\'s own itemIds argument when you simply want a known set of items - use this filter only when combining an item-id restriction with other filter rules. Supported operators: any_of, not_any_of. CompareValue is an array of item ids as strings.\nEXAMPLES:\n ✅ Correct: {"columnId": "__item_id__", "compareValue": ["3208003201"], "operator": "any_of"} // filtering by a single item id\n ✅ Correct: {"columnId": "__item_id__", "compareValue": ["3208003201", "3208003202"], "operator": "not_any_of"} // excluding several item ids\n ❌ Wrong: {"columnId": "item_id", "compareValue": ["3208003201"], "operator": "any_of"} // missing the underscores around item_id\n ❌ Wrong: {"columnId": "pulse_id", "compareValue": ["3208003201"], "operator": "any_of"} // pulse_id is an internal name, not a filterable id',date:'Supported operators: any_of, not_any_of, greater_than, lower_than, within_the_last, within_the_next. CompareValue should be either:\n - Date in "YYYY-MM-DD" format with "EXACT" e.g. compareValue:["EXACT", "2025-01-01"]\n - "TODAY" - Item with today\'s date\n - "TOMORROW" - Item with tomorrow\'s date\n - "THIS_WEEK" - Item with this week\'s date\n - "ONE_WEEK_AGO" - Item with one week ago\'s date\nEXAMPLES:\n ✅ Correct: {"columnId": "date", "compareValue": ["EXACT", "2025-01-01"], "operator": "any_of"} // using exact date format with EXACT\n ✅ Correct: {"columnId": "date", "compareValue": "TODAY", "operator": "greater_than"} // using TODAY with greater_than\n ✅ Correct: {"columnId": "date", "compareValue": ["DAYS", 7], "operator": "within_the_last"} // due in the last 7 days\n ✅ Correct: {"columnId": "date", "compareValue": ["WEEKS", 2], "operator": "within_the_next"} // due in the next 2 weeks\n ❌ Wrong: {"columnId": "date", "compareValue": "2025-01-01", "operator": "any_of"} // missing EXACT string for exact date\n ❌ Wrong: {"columnId": "date", "compareValue": ["TODAY"], "operator": "greater_than"} // using array with single value operator\n ❌ Wrong: {"columnId": "date", "compareValue": 7, "operator": "within_the_last"} // a bare number is not a valid window, use ["DAYS", 7]\n ❌ Wrong: {"columnId": "date", "compareValue": ["EXACT", "2025-01-01"], "operator": "within_the_next"} // within_the_next takes a [UNIT, AMOUNT] window, never an exact date\n ❌ Wrong: {"columnId": "date", "compareValue": "one_week", "compareAttribute": "WEEKS", "operator": "within_the_last"} // the unit belongs inside compareValue, never in compareAttribute',email:'Supported operators: any_of, not_any_of, is_empty, is_not_empty, contains_text, not_contains_text. CompareValue can be:\n - empty string "" when searching for blank values\n - whole email address when searching for specific email\n - partial email when using contains_text, not_contains_text operators\nEXAMPLES:\n ✅ Correct: {"columnId": "email", "compareValue": ["john@example.com"], "operator": "any_of"} // using array with any_of for specific email\n ✅ Correct: {"columnId": "email", "compareValue": "gmail", "operator": "contains_text"} // using partial email with contains_text\n ❌ Wrong: {"columnId": "email", "compareValue": "john@example.com", "operator": "any_of"} // not using array with any_of operator\n ❌ Wrong: {"columnId": "email", "compareValue": ["gmail"], "operator": "contains_text"} // using array with single value operator',long_text:'Supported operators: any_of, not_any_of, is_empty, is_not_empty, contains_text, not_contains_text. CompareValue can be either full text or partial text when using contains_text, not_contains_text operators\nEXAMPLES:\n ✅ Correct: {"columnId": "long_text", "compareValue": ["Complete project description"], "operator": "any_of"} // using array with any_of for full text\n ✅ Correct: {"columnId": "long_text", "compareValue": "urgent", "operator": "contains_text"} // using partial text with contains_text\n ❌ Wrong: {"columnId": "long_text", "compareValue": "Complete project description", "operator": "any_of"} // not using array with any_of operator\n ❌ Wrong: {"columnId": "long_text", "compareValue": [], "operator": "contains_text"} // using empty array with contains_text operator',text:'Supported operators: any_of, not_any_of, is_empty, is_not_empty, contains_text, not_contains_text. CompareValue can be either full text or partial text when using contains_text, not_contains_text operators\nEXAMPLES:\n ✅ Correct: {"columnId": "text", "compareValue": ["Task Name"], "operator": "any_of"} // using array with any_of for full text\n ✅ Correct: {"columnId": "text", "compareValue": "bug", "operator": "contains_text"} // using partial text with contains_text\n ❌ Wrong: {"columnId": "text", "compareValue": "Task Name", "operator": "any_of"} // not using array with any_of operator\n ❌ Wrong: {"columnId": "text", "compareValue": [], "operator": "contains_text"} // using empty array with contains_text operator',numbers:'Supported operators: any_of, not_any_of, greater_than, lower_than. CompareValue is a number or "$$$blank$$$" when searching for blank values\nEXAMPLES:\n ✅ Correct: {"columnId": "numbers", "compareValue": [100, 200], "operator": "any_of"} // using array with any_of for multiple numbers\n ✅ Correct: {"columnId": "numbers", "compareValue": 50, "operator": "greater_than"} // using single number with greater_than\n ❌ Wrong: {"columnId": "numbers", "compareValue": 100, "operator": "any_of"} // not using array with any_of operator\n ❌ Wrong: {"columnId": "numbers", "compareValue": ["50"], "operator": "greater_than"} // using array with single value operator',name:'Supported operators: "contains_text", "not_contains_text". CompareValue can be full or partial text\nEXAMPLES:\n ✅ Correct: {"columnId": "name", "compareValue": "marketing campaign", "operator": "contains_text"} // using string with contains_text\n ✅ Correct: {"columnId": "name", "compareValue": "marketing campaign", "operator": "not_contains_text"} // using string with not_contains_text',status:'Supported operators: any_of, not_any_of, contains_terms. CompareValue should be either:\n - id of label from column settings - when used with any_of, not_any_of operators\n - label\'s text - when use with contains_terms\nEXAMPLES:\n ✅ Correct: {"columnId": "status", "compareValue": [0, 1], "operator": "any_of"} // Using id values\n ✅ Correct: {"columnId": "status", "compareValue": "Done", "operator": "contains_terms"} // Using label text\n ❌ Wrong: {"columnId": "status", "compareValue": "Done", "operator": "any_of"} // Using label text with wrong operator\n ❌ Wrong: {"columnId": "status", "compareValue": [0, 1], "operator": "contains_terms"} // Using id with wrong operator',checkbox:'Supported operators: is_empty, is_not_empty. Compare value must be an empty array\nEXAMPLES:\n ✅ Correct: {"columnId": "column_id", "compareValue": [], "operator": "is_empty"} // using empty array with is_empty operator\n ❌ Wrong: {"columnId": "column_id", "compareValue": null, "operator": "is_empty"} // not using empty array with is_empty operator',people:'Supported operators: any_of, not_any_of, is_empty, is_not_empty. **CRITICAL**: CompareValue MUST be in one of following:\n - "assigned_to_me" - when searching for current user\n - "person-123" - when searching for specific person with id 123\n - "team-456" - when searching for specific team with id 456\n - empty array when using is_empty, is_not_empty operators\nEXAMPLES: \n ❌ Wrong: {"columnId": "column_id", "compareValue": ["person—123"], "operator": "any_of"} // Using long hyphen \'—\' instead of short hyphen \'-\'\n ✅ Correct: {"columnId": "column_id", "compareValue": [], "operator": "is_empty"} // using empty array with is_empty operator\n ✅ Correct: {"columnId": "column_id", "compareValue": ["person-80120403"], "operator": "any_of"} // using person prefix\n ✅ Correct: {"columnId": "column_id", "compareValue": ["team-9000"], "operator": "any_of"} // using team prefix\n ✅ Correct: {"columnId": "column_id", "compareValue": ["assigned_to_me"], "operator": "any_of"} // using assigned_to_me value\n ❌ Wrong: {"columnId": "column_id", "compareValue": ["80120403"], "operator": "is_empty"} // using id with is_empty operator\n ❌ Wrong: {"columnId": "column_id", "compareValue": ["80120403"], "operator": "any_of"} // not using person or team prefix'};function g_(e){const t=f_[e];return t?`# Filtering Guidelines\n\n## [IMPORTANT] Operator Guidelines\nSpecific operators expect specific compareValue types:\n- CompareValue MUST BE SENT AS AN ARRAY WHEN USED WITH any_of, not_any_of, between operators\n- CompareValue MUST BE SENT AS AN EMPTY ARRAY WHEN USED WITH is_empty, is_not_empty\n- CompareValue MUST BE SENT AS EITHER SINGLE STRING OR SINGLE NUMBER WHEN USED WITH greater_than, greater_than_or_equals, lower_than, lower_than_or_equal\n- CompareValue MUST BE SENT AS SINGLE STRING WHEN USED WITH contains_terms, not_contains_text, contains_text, starts_with, ends_with operators\n- CompareValue MUST BE SENT AS A TWO ITEM ARRAY OF [UNIT, AMOUNT] WHEN USED WITH within_the_last, within_the_next operators, where UNIT is one of "DAYS", "WORKDAYS", "WEEKS", "MONTHS" and AMOUNT is a number, e.g. ["DAYS", 7] for the last or next 7 days\n\n## [IMPORTANT] Column type: ${e}\n${t}\n\n## [IMPORTANT] Sub Items Columns MUST NOT BE USED FOR FILTERING.\n`:null}const b_={columnType:n.z.nativeEnum(ch).describe('The column type to retrieve information for (e.g., "text", "status", "date", "numbers")'),fetchMode:n.z.nativeEnum(cm).optional().default(cm.Schema).describe(`fetchMode "${cm.Schema}": JSON settings schema only (GraphQL). fetchMode "${cm.Guidelines}": guidelines.filter and guidelines.aggregation only — no GraphQL round-trip.`)};const y_={random_string:n.z.string().describe("Dummy parameter for no-parameter tools").optional(),operationType:n.z.enum(["read","write"]).describe('Type of operation: "read" for queries, "write" for mutations').optional()};const v_={typeName:n.z.string().describe("The name of the GraphQL type to get details for")};const I_=rc`
|
|
1503
|
+
`,__="https://developer.monday.com/api-reference",f_={group:'Filters items by the board group they belong to. The columnId is the literal string "group" - a group id such as "group_mm6wsvcc" is NEVER a valid columnId. For filtering by group id, use any_of or not_any_of. Use an array of group ids, as returned in an item\'s group.id or by get_board_info.\nEXAMPLES:\n ✅ Correct: {"columnId": "group", "compareValue": ["group_mm6wsvcc"], "operator": "any_of"} // group id goes in compareValue\n ✅ Correct: {"columnId": "group", "compareValue": ["group_mm6wsvcc", "group_mm4w1e0n"], "operator": "any_of"} // several groups\n ❌ Wrong: {"columnId": "group_mm6wsvcc", "compareValue": "group_mm6wsvcc"} // group id used as the columnId\n ❌ Wrong: {"columnId": "__group__", "compareValue": ["group_mm6wsvcc"], "operator": "any_of"} // the columnId is exactly "group", with no surrounding underscores\n ❌ Wrong: {"columnId": "group_id", "compareValue": ["group_mm6wsvcc"], "operator": "any_of"} // use the virtual column id "group" for board-group membership\n ❌ Wrong: {"columnId": "group", "compareValue": "Backlog", "operator": "any_of"} // group title instead of group id',last_updated:'The columnId is the literal string "__last_updated__", with two underscores before and after. Supported operators: any_of, not_any_of, within_the_last, between. With any_of and not_any_of, use compareAttribute "UPDATED_AT" and a compareValue array holding one of "TODAY", "YESTERDAY", "THIS_WEEK", "THIS_MONTH". With within_the_last, use compareAttribute "UPDATED_AT" and a [UNIT, AMOUNT] window. With between, use compareAttribute "UPDATED_AT" and a two item array of "YYYY-MM-DD" dates [FROM, TO].\nThis id is also the correct one to use in orderBy to sort items by when they were last updated.\nEXAMPLES:\n ✅ Correct: {"columnId": "__last_updated__", "compareValue": ["TODAY"], "operator": "any_of", "compareAttribute": "UPDATED_AT"} // updated today\n ✅ Correct: {"columnId": "__last_updated__", "compareValue": ["THIS_WEEK"], "operator": "not_any_of", "compareAttribute": "UPDATED_AT"} // using THIS_WEEK with not_any_of\n ✅ Correct: {"columnId": "__last_updated__", "compareValue": ["DAYS", 7], "operator": "within_the_last", "compareAttribute": "UPDATED_AT"} // updated in the last 7 days\n ✅ Correct: {"columnId": "__last_updated__", "compareValue": ["WEEKS", 1], "operator": "within_the_last", "compareAttribute": "UPDATED_AT"} // updated in the last week\n ✅ Correct: {"columnId": "__last_updated__", "compareValue": ["2025-01-01", "2025-03-31"], "operator": "between", "compareAttribute": "UPDATED_AT"} // updated in Q1\n ❌ Wrong: {"columnId": "last_updated", "compareValue": ["TODAY"], "operator": "any_of", "compareAttribute": "UPDATED_AT"} // missing the underscores around last_updated\n ❌ Wrong: {"columnId": "__last_updated", "compareValue": ["TODAY"], "operator": "any_of", "compareAttribute": "UPDATED_AT"} // missing one trailing underscore\n ❌ Wrong: {"columnId": "updated_at", "compareValue": ["TODAY"], "operator": "any_of", "compareAttribute": "UPDATED_AT"} // use __last_updated__ for the item\'s update time\n ❌ Wrong: {"columnId": "__last_updated__", "compareValue": ["LAST_MONTH"], "operator": "any_of", "compareAttribute": "UPDATED_AT"} // LAST_MONTH and LAST_WEEK match no items, use within_the_last with ["MONTHS", 1] or ["WEEKS", 1]\n ❌ Wrong: {"columnId": "__last_updated__", "compareValue": "TODAY", "operator": "any_of", "compareAttribute": "UPDATED_AT"} // not using array for any_of operator\n ❌ Wrong: {"columnId": "__last_updated__", "compareValue": ["2025-01-01", "2025-03-31"], "operator": "between"} // missing UPDATED_AT',creation_log:'The columnId is the literal string "__creation_log__", with two underscores before and after. Supported operators: any_of, not_any_of, within_the_last, between. With any_of and not_any_of, use compareAttribute "CREATED_AT" and a compareValue array holding one of "TODAY", "YESTERDAY", "THIS_WEEK", "THIS_MONTH". With within_the_last, use compareAttribute "CREATED_AT" and a [UNIT, AMOUNT] window. With between, use compareAttribute "CREATED_AT" and a two item array of "YYYY-MM-DD" dates [FROM, TO].\nThis id is also the correct one to use in orderBy to sort items by creation time.\nEXAMPLES:\n ✅ Correct: {"columnId": "__creation_log__", "compareValue": ["TODAY"], "operator": "any_of", "compareAttribute": "CREATED_AT"} // items created today\n ✅ Correct: {"columnId": "__creation_log__", "compareValue": ["THIS_WEEK"], "operator": "not_any_of", "compareAttribute": "CREATED_AT"} // items not created this week\n ✅ Correct: {"columnId": "__creation_log__", "compareValue": ["DAYS", 30], "operator": "within_the_last", "compareAttribute": "CREATED_AT"} // created in the last 30 days\n ✅ Correct: {"columnId": "__creation_log__", "compareValue": ["2025-01-01", "2025-03-31"], "operator": "between", "compareAttribute": "CREATED_AT"} // created in Q1\n ❌ Wrong: {"columnId": "creation_log", "compareValue": ["TODAY"], "operator": "any_of", "compareAttribute": "CREATED_AT"} // missing the underscores around creation_log\n ❌ Wrong: {"columnId": "created_at", "compareValue": ["TODAY"], "operator": "any_of", "compareAttribute": "CREATED_AT"} // use __creation_log__ for the item\'s creation time\n ❌ Wrong: {"columnId": "__creation_log__", "compareValue": ["LAST_MONTH"], "operator": "any_of", "compareAttribute": "CREATED_AT"} // LAST_MONTH and LAST_WEEK match no items, use within_the_last with ["MONTHS", 1] or ["WEEKS", 1]\n ❌ Wrong: {"columnId": "__creation_log__", "compareValue": ["PAST_DATETIME", "14"], "operator": "within_the_last"} // PAST_DATETIME is not a unit, use ["DAYS", 14]\n ❌ Wrong: {"columnId": "__creation_log__", "compareValue": ["2025-01-01", "2025-03-31"], "operator": "between"} // missing CREATED_AT',item_id:'The columnId is the literal string "__item_id__", with two underscores before and after. Prefer the tool\'s own itemIds argument when you simply want a known set of items - use this filter only when combining an item-id restriction with other filter rules. Supported operators: any_of, not_any_of. CompareValue is an array of item ids as strings.\nEXAMPLES:\n ✅ Correct: {"columnId": "__item_id__", "compareValue": ["3208003201"], "operator": "any_of"} // filtering by a single item id\n ✅ Correct: {"columnId": "__item_id__", "compareValue": ["3208003201", "3208003202"], "operator": "not_any_of"} // excluding several item ids\n ❌ Wrong: {"columnId": "item_id", "compareValue": ["3208003201"], "operator": "any_of"} // missing the underscores around item_id\n ❌ Wrong: {"columnId": "parent_item_id", "compareValue": ["3208003201"], "operator": "any_of"} // parent_item_id describes item hierarchy in the response\n ❌ Wrong: {"columnId": "pulse_id", "compareValue": ["3208003201"], "operator": "any_of"} // pulse_id is an internal name, not a filterable id',date:'Supported operators: any_of, not_any_of, between, greater_than, greater_than_or_equals, lower_than, lower_than_or_equal, within_the_last, within_the_next, is_empty, is_not_empty. CompareValue should be either:\n - Date in "YYYY-MM-DD" format with "EXACT" e.g. compareValue:["EXACT", "2025-01-01"]\n - "TODAY" - Item with today\'s date\n - "TOMORROW" - Item with tomorrow\'s date\n - "THIS_WEEK" - Item with this week\'s date\n - "ONE_WEEK_AGO" - Item with one week ago\'s date\n - A two item array of plain "YYYY-MM-DD" dates [FROM, TO] with the between operator, e.g. ["2025-01-01", "2025-03-31"]\nFor a date range, use a single between rule.\nEXAMPLES:\n ✅ Correct: {"columnId": "date", "compareValue": ["EXACT", "2025-01-01"], "operator": "any_of"} // using exact date format with EXACT\n ✅ Correct: {"columnId": "date", "compareValue": "TODAY", "operator": "greater_than"} // using TODAY with greater_than\n ✅ Correct: {"columnId": "date", "compareValue": ["2025-01-01", "2025-03-31"], "operator": "between"} // a date range, no compareAttribute\n ✅ Correct: {"columnId": "date", "compareValue": ["DAYS", 7], "operator": "within_the_last"} // due in the last 7 days\n ✅ Correct: {"columnId": "date", "compareValue": ["WEEKS", 2], "operator": "within_the_next"} // due in the next 2 weeks\n ❌ Wrong: {"columnId": "date", "compareValue": "2025-01-01", "operator": "any_of"} // missing EXACT string for exact date\n ❌ Wrong: {"columnId": "date", "compareValue": ["TODAY"], "operator": "greater_than"} // using array with single value operator\n ❌ Wrong: {"columnId": "date", "compareValue": 7, "operator": "within_the_last"} // a bare number is not a valid window, use ["DAYS", 7]\n ❌ Wrong: {"columnId": "date", "compareValue": ["EXACT", "2025-01-01"], "operator": "within_the_next"} // within_the_next takes a [UNIT, AMOUNT] window, never an exact date\n ❌ Wrong: {"columnId": "date", "compareValue": "one_week", "compareAttribute": "WEEKS", "operator": "within_the_last"} // the unit belongs inside compareValue, never in compareAttribute\n ❌ Wrong: {"columnId": "date", "compareValue": ["2025-01-01", "2025-03-31"], "compareAttribute": "EXACT", "operator": "between"} // a date column takes no compareAttribute, "EXACT" belongs inside compareValue\n ❌ Wrong: {"columnId": "date", "compareValue": ["2025-01-01", "2025-03-31"], "compareAttribute": "START_DATE", "operator": "between"} // START_DATE/END_DATE apply to timeline columns, never to date columns\n ❌ Wrong: {"columnId": "date", "compareValue": ["EXACT", "2025-01-01", "2025-03-31"], "operator": "between"} // between takes exactly two plain dates, with no EXACT prefix',timeline:'A timeline column holds a start and an end date. Supported operators without compareAttribute: any_of, not_any_of, is_empty, is_not_empty. Supported operators with compareAttribute "START_DATE" or "END_DATE": between, greater_than, greater_than_or_equals, lower_than, lower_than_or_equal. With between, compareValue is a two item array of plain "YYYY-MM-DD" dates [FROM, TO].\nEXAMPLES:\n ✅ Correct: {"columnId": "timeline", "compareValue": ["2025-01-01", "2025-03-31"], "operator": "between", "compareAttribute": "START_DATE"} // timelines starting in Q1\n ✅ Correct: {"columnId": "timeline", "compareValue": ["2025-01-01", "2025-03-31"], "operator": "between", "compareAttribute": "END_DATE"} // timelines ending in Q1\n ✅ Correct: {"columnId": "timeline", "compareValue": "2025-06-01", "operator": "greater_than", "compareAttribute": "START_DATE"} // starts after a date\n ✅ Correct: {"columnId": "timeline", "compareValue": [], "operator": "is_empty"} // no timeline set\n ❌ Wrong: {"columnId": "timeline", "compareValue": ["2025-01-01", "2025-03-31"], "operator": "between"} // between on a timeline requires compareAttribute START_DATE or END_DATE\n ❌ Wrong: {"columnId": "timeline", "compareValue": ["2025-01-01", "2025-03-31"], "operator": "between", "compareAttribute": "EXACT"} // EXACT is not a timeline compareAttribute, use START_DATE or END_DATE\n ❌ Wrong: {"columnId": "timeline", "compareValue": "2025-06-01", "operator": "contains_text"} // timeline columns hold dates, not text\n ❌ Wrong: {"columnId": "timeline", "compareValue": ["DAYS", 30], "operator": "within_the_next"} // within_the_next does not exist for timeline, use between with START_DATE\n ❌ Wrong: {"columnId": "timeline", "compareValue": "2025-06-01", "operator": "greater_than_or_equals"} // missing the required compareAttribute',location:'Supported operators: is_empty, is_not_empty. CompareValue is an empty array.\nEXAMPLES:\n ✅ Correct: {"columnId": "location", "compareValue": [], "operator": "is_not_empty"} // items that have a location\n ✅ Correct: {"columnId": "location", "compareValue": [], "operator": "is_empty"} // items missing a location\n ❌ Wrong: {"columnId": "location", "compareValue": "New York", "operator": "contains_text"} // location columns cannot be text filtered\n ❌ Wrong: {"columnId": "location", "compareValue": ["New York"], "operator": "any_of"} // any_of is not supported for location',board_relation:'A connect boards column. Supported operators: any_of, not_any_of, contains_text, not_contains_text, starts_with, is_empty, is_not_empty. With any_of and not_any_of, compareValue is an array of the linked item ids as numbers. With the text operators, compareValue is a single string matched against the linked items\' names.\nEXAMPLES:\n ✅ Correct: {"columnId": "board_relation", "compareValue": [3208003201], "operator": "any_of"} // linked to a specific item\n ✅ Correct: {"columnId": "board_relation", "compareValue": "Acme", "operator": "contains_text"} // linked item name contains text\n ✅ Correct: {"columnId": "board_relation", "compareValue": [], "operator": "is_empty"} // nothing linked\n ❌ Wrong: {"columnId": "board_relation", "compareValue": 3208003201, "operator": "any_of"} // not using array with any_of operator\n ❌ Wrong: {"columnId": "board_relation", "compareValue": "Acme", "operator": "ends_with"} // ends_with is not supported for this column',subtasks:'Supported operators: is_empty, is_not_empty. CompareValue is an empty array. To filter on subitem values, query the subitems board directly using its own boardId.\nEXAMPLES:\n ✅ Correct: {"columnId": "subitems", "compareValue": [], "operator": "is_not_empty"} // items that have subitems\n ✅ Correct: {"columnId": "subitems", "compareValue": [], "operator": "is_empty"} // items without subitems\n ❌ Wrong: {"columnId": "subitems", "compareValue": "Design", "operator": "contains_text"} // subitem content is not filterable from the parent board\n ❌ Wrong: {"columnId": "subitems", "compareValue": ["3208003201"], "operator": "any_of"} // any_of is not supported for subitems',email:'Supported operators: any_of, not_any_of, is_empty, is_not_empty, contains_text, not_contains_text. CompareValue can be:\n - empty string "" when searching for blank values\n - whole email address when searching for specific email\n - partial email when using contains_text, not_contains_text operators\nEXAMPLES:\n ✅ Correct: {"columnId": "email", "compareValue": ["john@example.com"], "operator": "any_of"} // using array with any_of for specific email\n ✅ Correct: {"columnId": "email", "compareValue": "gmail", "operator": "contains_text"} // using partial email with contains_text\n ❌ Wrong: {"columnId": "email", "compareValue": "john@example.com", "operator": "any_of"} // not using array with any_of operator\n ❌ Wrong: {"columnId": "email", "compareValue": ["gmail"], "operator": "contains_text"} // using array with single value operator',long_text:'Supported operators: any_of, not_any_of, is_empty, is_not_empty, contains_text, not_contains_text. CompareValue can be either full text or partial text when using contains_text, not_contains_text operators\nEXAMPLES:\n ✅ Correct: {"columnId": "long_text", "compareValue": ["Complete project description"], "operator": "any_of"} // using array with any_of for full text\n ✅ Correct: {"columnId": "long_text", "compareValue": "urgent", "operator": "contains_text"} // using partial text with contains_text\n ❌ Wrong: {"columnId": "long_text", "compareValue": "Complete project description", "operator": "any_of"} // not using array with any_of operator\n ❌ Wrong: {"columnId": "long_text", "compareValue": [], "operator": "contains_text"} // using empty array with contains_text operator',text:'Supported operators: any_of, not_any_of, is_empty, is_not_empty, contains_text, not_contains_text. CompareValue can be either full text or partial text when using contains_text, not_contains_text operators\nEXAMPLES:\n ✅ Correct: {"columnId": "text", "compareValue": ["Task Name"], "operator": "any_of"} // using array with any_of for full text\n ✅ Correct: {"columnId": "text", "compareValue": "bug", "operator": "contains_text"} // using partial text with contains_text\n ❌ Wrong: {"columnId": "text", "compareValue": "Task Name", "operator": "any_of"} // not using array with any_of operator\n ❌ Wrong: {"columnId": "text", "compareValue": [], "operator": "contains_text"} // using empty array with contains_text operator',numbers:'Supported operators: any_of, not_any_of, greater_than, lower_than. CompareValue is a number or "$$$blank$$$" when searching for blank values\nEXAMPLES:\n ✅ Correct: {"columnId": "numbers", "compareValue": [100, 200], "operator": "any_of"} // using array with any_of for multiple numbers\n ✅ Correct: {"columnId": "numbers", "compareValue": 50, "operator": "greater_than"} // using single number with greater_than\n ❌ Wrong: {"columnId": "numbers", "compareValue": 100, "operator": "any_of"} // not using array with any_of operator\n ❌ Wrong: {"columnId": "numbers", "compareValue": ["50"], "operator": "greater_than"} // using array with single value operator',name:'Supported operators: "contains_text", "not_contains_text". CompareValue can be full or partial text\nEXAMPLES:\n ✅ Correct: {"columnId": "name", "compareValue": "marketing campaign", "operator": "contains_text"} // using string with contains_text\n ✅ Correct: {"columnId": "name", "compareValue": "marketing campaign", "operator": "not_contains_text"} // using string with not_contains_text',status:'Supported operators: any_of, not_any_of, contains_terms. CompareValue should be either:\n - id of label from column settings - when used with any_of, not_any_of operators\n - label\'s text - when use with contains_terms\nEXAMPLES:\n ✅ Correct: {"columnId": "status", "compareValue": [0, 1], "operator": "any_of"} // Using id values\n ✅ Correct: {"columnId": "status", "compareValue": "Done", "operator": "contains_terms"} // Using label text\n ❌ Wrong: {"columnId": "status", "compareValue": "Done", "operator": "any_of"} // Using label text with wrong operator\n ❌ Wrong: {"columnId": "status", "compareValue": [0, 1], "operator": "contains_terms"} // Using id with wrong operator',checkbox:'Supported operators: is_empty, is_not_empty. Compare value must be an empty array\nEXAMPLES:\n ✅ Correct: {"columnId": "column_id", "compareValue": [], "operator": "is_empty"} // using empty array with is_empty operator\n ❌ Wrong: {"columnId": "column_id", "compareValue": null, "operator": "is_empty"} // not using empty array with is_empty operator',people:'Supported operators: any_of, not_any_of, is_empty, is_not_empty. **CRITICAL**: CompareValue MUST be in one of following:\n - "assigned_to_me" - when searching for current user\n - "person-123" - when searching for specific person with id 123\n - "team-456" - when searching for specific team with id 456\n - empty array when using is_empty, is_not_empty operators\nEXAMPLES: \n ❌ Wrong: {"columnId": "column_id", "compareValue": ["person—123"], "operator": "any_of"} // Using long hyphen \'—\' instead of short hyphen \'-\'\n ✅ Correct: {"columnId": "column_id", "compareValue": [], "operator": "is_empty"} // using empty array with is_empty operator\n ✅ Correct: {"columnId": "column_id", "compareValue": ["person-80120403"], "operator": "any_of"} // using person prefix\n ✅ Correct: {"columnId": "column_id", "compareValue": ["team-9000"], "operator": "any_of"} // using team prefix\n ✅ Correct: {"columnId": "column_id", "compareValue": ["assigned_to_me"], "operator": "any_of"} // using assigned_to_me value\n ❌ Wrong: {"columnId": "column_id", "compareValue": ["80120403"], "operator": "is_empty"} // using id with is_empty operator\n ❌ Wrong: {"columnId": "column_id", "compareValue": ["80120403"], "operator": "any_of"} // not using person or team prefix'};function g_(e){const t=f_[e];return t?`# Filtering Guidelines\n\n## [IMPORTANT] Operator Guidelines\nSpecific operators expect specific compareValue types:\n- CompareValue MUST BE SENT AS AN ARRAY WHEN USED WITH any_of, not_any_of, between operators\n- CompareValue MUST BE SENT AS AN EMPTY ARRAY WHEN USED WITH is_empty, is_not_empty\n- CompareValue MUST BE SENT AS EITHER SINGLE STRING OR SINGLE NUMBER WHEN USED WITH greater_than, greater_than_or_equals, lower_than, lower_than_or_equal\n- CompareValue MUST BE SENT AS SINGLE STRING WHEN USED WITH contains_terms, not_contains_text, contains_text, starts_with operators\n- CompareValue MUST BE SENT AS A TWO ITEM ARRAY OF [UNIT, AMOUNT] WHEN USED WITH within_the_last, within_the_next operators, where UNIT is one of "DAYS", "WORKDAYS", "WEEKS", "MONTHS" and AMOUNT is a number, e.g. ["DAYS", 7] for the last or next 7 days\n- CompareValue MUST BE SENT AS A TWO ITEM ARRAY OF plain "YYYY-MM-DD" dates [FROM, TO] WHEN USED WITH between\n\n## [IMPORTANT] Column type: ${e}\n${t}\n`:null}const b_={columnType:n.z.nativeEnum(ch).describe('The column type to retrieve information for (e.g., "text", "status", "date", "numbers")'),fetchMode:n.z.nativeEnum(cm).optional().default(cm.Schema).describe(`fetchMode "${cm.Schema}": JSON settings schema only (GraphQL). fetchMode "${cm.Guidelines}": guidelines.filter and guidelines.aggregation only — no GraphQL round-trip.`)};const y_={random_string:n.z.string().describe("Dummy parameter for no-parameter tools").optional(),operationType:n.z.enum(["read","write"]).describe('Type of operation: "read" for queries, "write" for mutations').optional()};const v_={typeName:n.z.string().describe("The name of the GraphQL type to get details for")};const I_=rc`
|
|
1504
1504
|
fragment UserDetails on User {
|
|
1505
1505
|
# Basic User Information
|
|
1506
1506
|
id
|
|
@@ -1720,8 +1720,8 @@
|
|
|
1720
1720
|
}
|
|
1721
1721
|
}
|
|
1722
1722
|
`,K_=rc`
|
|
1723
|
-
query getDocIdByObjectId($objectId:
|
|
1724
|
-
docs(object_ids: $objectId) {
|
|
1723
|
+
query getDocIdByObjectId($objectId: ID!) {
|
|
1724
|
+
docs(object_ids: [$objectId], limit: 1) {
|
|
1725
1725
|
id
|
|
1726
1726
|
}
|
|
1727
1727
|
}
|
|
@@ -1746,8 +1746,8 @@
|
|
|
1746
1746
|
}
|
|
1747
1747
|
}
|
|
1748
1748
|
`,Z_=rc`
|
|
1749
|
-
query getDocObjectIdByDocId($docId:
|
|
1750
|
-
docs(ids: $docId) {
|
|
1749
|
+
query getDocObjectIdByDocId($docId: ID!) {
|
|
1750
|
+
docs(ids: [$docId], limit: 1) {
|
|
1751
1751
|
id
|
|
1752
1752
|
object_id
|
|
1753
1753
|
}
|
|
@@ -1763,8 +1763,8 @@
|
|
|
1763
1763
|
}
|
|
1764
1764
|
}
|
|
1765
1765
|
`,tf=rc`
|
|
1766
|
-
query getDocBlockContent($docId:
|
|
1767
|
-
docs(ids: $docId) {
|
|
1766
|
+
query getDocBlockContent($docId: ID!) {
|
|
1767
|
+
docs(ids: [$docId], limit: 1) {
|
|
1768
1768
|
blocks {
|
|
1769
1769
|
id
|
|
1770
1770
|
type
|
|
@@ -1858,7 +1858,7 @@
|
|
|
1858
1858
|
}
|
|
1859
1859
|
`;function cf(e){const t=e.workspaces?.filter((e=>null!==e));return t||[]}function mf(e){return Array.isArray(e)&&e.length>0}const uf={limit:n.z.number().min(1).max(100).default(100).describe("Number of workspaces to return. Default is (100), lower for a smaller response size"),page:n.z.number().min(1).default(1).describe("Page number to return. Default is 1.")};const hf=rc`
|
|
1860
1860
|
query getItemBoard($itemId: ID!) {
|
|
1861
|
-
items(ids: [$itemId]) {
|
|
1861
|
+
items(ids: [$itemId], limit: 1) {
|
|
1862
1862
|
id
|
|
1863
1863
|
board {
|
|
1864
1864
|
id
|
|
@@ -1899,16 +1899,16 @@
|
|
|
1899
1899
|
}
|
|
1900
1900
|
}
|
|
1901
1901
|
`,Ef=rc`
|
|
1902
|
-
query getDocByObjectId($objectId:
|
|
1903
|
-
docs(object_ids: $objectId) {
|
|
1902
|
+
query getDocByObjectId($objectId: ID!) {
|
|
1903
|
+
docs(object_ids: [$objectId], limit: 1) {
|
|
1904
1904
|
id
|
|
1905
1905
|
name
|
|
1906
1906
|
url
|
|
1907
1907
|
}
|
|
1908
1908
|
}
|
|
1909
1909
|
`,Tf=rc`
|
|
1910
|
-
query getDocById($docId:
|
|
1911
|
-
docs(ids: $docId) {
|
|
1910
|
+
query getDocById($docId: ID!) {
|
|
1911
|
+
docs(ids: [$docId], limit: 1) {
|
|
1912
1912
|
id
|
|
1913
1913
|
name
|
|
1914
1914
|
url
|
|
@@ -2049,7 +2049,7 @@
|
|
|
2049
2049
|
}
|
|
2050
2050
|
`,Ig={objectType:n.z.nativeEnum(zs).describe("The type of object to move"),id:n.z.string().describe("The ID of the object to move"),position_object_id:n.z.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:n.z.nativeEnum(zs).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:n.z.boolean().optional().describe("Whether to position the object after the object"),parentFolderId:n.z.string().optional().describe("The ID of the new parent folder. Required if moving to a different folder."),workspaceId:n.z.string().optional().describe("The ID of the workspace containing the object. Required if moving to a different workspace."),accountProductId:n.z.string().optional().describe("The ID of the account product containing the object. Required if moving to a different account product.")};const Eg=rc`
|
|
2051
2051
|
query aggregateBoardInsights($query: AggregateQueryInput!, $boardId: ID!) {
|
|
2052
|
-
boards(ids: [$boardId]) {
|
|
2052
|
+
boards(ids: [$boardId], limit: 1) {
|
|
2053
2053
|
name
|
|
2054
2054
|
url
|
|
2055
2055
|
}
|
|
@@ -2366,9 +2366,9 @@
|
|
|
2366
2366
|
}
|
|
2367
2367
|
}
|
|
2368
2368
|
`,lb={uploadId:n.z.string().describe("The upload_id returned by get_asset_upload_url"),etag:n.z.string().describe("The ETag header value from the PUT response when uploading to the presigned URL"),boardId:n.z.string().describe("The board's unique identifier"),itemId:n.z.string().describe("The item's unique identifier"),columnId:n.z.string().describe("The file or doc column's unique identifier to attach the uploaded asset to")};const cb="\n**Board-relation linking — do in order**\n\n1. **Fetch (target board, one query)**\n- **has_more: true** (and under **~500** items / **~5** pages for this pass) → your **only** next action is\n **get_board_items_page** with **cursor=nextCursor**; same **boardId** and the same **searchTerm** / **filters**\n / **itemIds** — **do not** change **filters** on a cursor call. **No** user turn until **has_more** is false\n or you stop at the cap. The first page alone is never “the whole board” while **has_more** is still true.\n- **Shrink the query first** when you can: **columnIds**;\n **filters**; **searchTerm**; or **itemIds** (max **100** per call, split big lists). Search **timeout** or\n error → **narrower** **searchTerm** or smaller **limit** / columns, then continue with **nextCursor** as\n in the first bullet.\n\n2. **Match (after the fetch for that pass is done)**\n- Apply a **clear** rule to names/values you already loaded (e.g. same name as source, or value user gave).\n- One unambiguous match → link without asking. **No** vague “best” pick without a rule.\n\n3. **If the user must be involved (only after step 1 is done for that query)**\n- If step 1 is incomplete, **no** questions (see step 1’s first bullet).\n- **True tie** (2+ items match the rule equally) → show **only those tied rows** (or a tiny shortlist),\n not the full result set and never all ~500.\n- **No way to name a target yet** (not a tie) → ask **once** for a **name** or **search phrase** to use in\n **searchTerm** / **filters**, not a menu of the board.\n\n4. **Write** — On the owning board’s board-relation column using change_item_column_values\n".trim(),mb={};const ub=rc`
|
|
2369
|
-
query GetItemAssets($itemId:
|
|
2370
|
-
items(ids: $itemId) {
|
|
2371
|
-
assets(column_ids: $columnId) {
|
|
2369
|
+
query GetItemAssets($itemId: ID!, $columnId: String!) {
|
|
2370
|
+
items(ids: [$itemId], limit: 1) {
|
|
2371
|
+
assets(column_ids: [$columnId]) {
|
|
2372
2372
|
public_url
|
|
2373
2373
|
name
|
|
2374
2374
|
file_extension
|
|
@@ -2890,7 +2890,7 @@
|
|
|
2890
2890
|
}
|
|
2891
2891
|
`,MA={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"},VA={...MA,SPRINT_SUMMARY:"sprint_summary",SPRINT_CAPACITY:"sprint_capacity"},FA="BOARD_NOT_FOUND:",BA="SPRINT_NOT_FOUND:",zA="DOCUMENT_NOT_FOUND:",qA="DOCUMENT_INVALID:",jA="DOCUMENT_EMPTY:",GA="EXPORT_FAILED:",HA="INTERNAL_ERROR:",WA="VALIDATION_ERROR:",YA="task_sprint",KA={[VA.SPRINT_TASKS]:"Sprint Tasks",[VA.SPRINT_TIMELINE]:"Sprint Timeline",[VA.SPRINT_COMPLETION]:"Sprint Completion",[VA.SPRINT_START_DATE]:"Sprint Start Date",[VA.SPRINT_END_DATE]:"Sprint End Date",[VA.SPRINT_ACTIVATION]:"Sprint Activation",[VA.SPRINT_SUMMARY]:"Sprint Summary",[VA.SPRINT_CAPACITY]:"Sprint Capacity"},QA=wd,JA={TASK_SPRINT:"task_sprint",TASK_STATUS:"task_status"},XA=(e,t)=>e.column_values?.find((e=>e.id===t)),ZA=(e,t)=>{const a=XA(e,t);return"CheckboxValue"===a?.__typename?a.checked??!1:null},eS=(e,t)=>{const a=XA(e,t);return"DateValue"===a?.__typename?a.date??null:null},tS=(e,t)=>{const a=XA(e,t);return"DocValue"===a?.__typename&&a.file?.doc?.object_id?a.file.doc.object_id:null},aS=(e,t)=>{const a=t.filter((t=>!e.has(t)));return{isValid:0===a.length,missingColumns:a}},nS=(e,t)=>{if(!e.columns)return!1;const a=new Set(e.columns.filter((e=>null!==e)).map((e=>e.id)));return t.every((e=>a.has(e)))},iS=e=>nS(e,Object.values(MA)),oS=e=>nS(e,Object.values(JA)),rS=e=>{if(!e?.settings)return null;const t=e.settings;return t.boardIds&&Array.isArray(t.boardIds)&&t.boardIds[0]?.toString()||t.boardId?.toString()||null},sS=(e,t)=>e.columns&&e.columns.filter((e=>null!==e)).find((e=>e.id===t&&e.type===ch.BoardRelation))||null,dS={sprintId:n.z.number().describe('The ID of the sprint to get the summary for (e.g., "9123456789")')};const pS=rc`
|
|
2892
2892
|
query GetSprintsBoardItemsWithColumns($boardId: ID!, $limit: Int) {
|
|
2893
|
-
boards(ids: [$boardId]) {
|
|
2893
|
+
boards(ids: [$boardId], limit: 1) {
|
|
2894
2894
|
items_page(limit: $limit) {
|
|
2895
2895
|
items {
|
|
2896
2896
|
id
|
|
@@ -3028,5 +3028,5 @@
|
|
|
3028
3028
|
}
|
|
3029
3029
|
}
|
|
3030
3030
|
}
|
|
3031
|
-
`),n=await this.mondayApi.request(a);return n.__type?{content:{message:"Type details retrieved",data:{name:n.__type.name,kind:n.__type.kind,description:n.__type.description??null,fields:n.__type.fields??[],inputFields:n.__type.inputFields??[],interfaces:n.__type.interfaces??[],enumValues:n.__type.enumValues??[],possibleTypes:n.__type.possibleTypes??[]}}}:{content:`Type '${e.typeName}' not found in the GraphQL schema. Please check the type name and try again.`}}catch(e){const t=e instanceof Error?e.message:"Unknown error",a=t.includes("JSON");return{content:`Error fetching type details: ${t}${a?"\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 t}},class extends ce{constructor(){super(...arguments),this.name="create_custom_activity",this.type=f.WRITE,this.annotations=le({title:"Create Custom Activity",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new custom activity in the E&A app"}getInputSchema(){return fh}async executeInternal(e){const t={color:e.color,icon_id:e.icon_id,name:e.name};return await this.mondayApi.request(Ec,t),{content:{message:`Custom activity '${e.name}' with color ${e.color} and icon ${e.icon_id} successfully created`,name:e.name,color:e.color,icon_id:e.icon_id}}}},class extends ce{constructor(){super(...arguments),this.name="create_notification",this.type=f.WRITE,this.annotations=le({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 bh}async executeInternal(e){const t={user_id:e.user_id,target_id:e.target_id,text:e.text,target_type:e.target_type};try{const a=await this.mondayApi.request(gh,t);if(!a.create_notification?.id)throw new Lc(`No notification was created for user ${e.user_id} on ${e.target_type} target ${e.target_id}. Verify the user has access to the target and that target_id matches target_type ("Post" for an update/reply id, "Project" for an item/board id).`,Cc);return{content:{message:`Notification ${a.create_notification.id} sent to user ${e.user_id}`,notification_id:a.create_notification.id,user_id:e.user_id,target_id:e.target_id,target_type:e.target_type,text:a.create_notification.text??e.text}}}catch(t){Uc(t,`send notification to user ${e.user_id}`)}}},class extends ce{constructor(){super(...arguments),this.name="create_timeline_item",this.type=f.WRITE,this.annotations=le({title:"Create Timeline Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new timeline item in the E&A app"}getInputSchema(){return Rh}async executeInternal(e){const t={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&&(t.time_range={start_timestamp:e.start_timestamp,end_timestamp:e.end_timestamp});const a=await this.mondayApi.request(Tc,t);return{content:{message:`Timeline item '${e.title}' with ID ${a.create_timeline_item?.id} successfully created on item ${e.item_id}`,timeline_item_id:a.create_timeline_item?.id,item_id:e.item_id,title:e.title}}}},class extends ce{constructor(){super(...arguments),this.name="fetch_custom_activity",this.type=f.READ,this.annotations=le({title:"Fetch Custom Activities",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get custom activities from the E&A app"}getInputSchema(){return Gh}async executeInternal(e){const t=await this.mondayApi.request(wc);if(!t.custom_activity||0===t.custom_activity.length)return{content:{message:"No custom activities found",data:[]}};const a=t.custom_activity.map((e=>({id:e.id,name:e.name,color:e.color,icon_id:e.icon_id,type:e.type})));return{content:{message:`Found ${a.length} custom activities`,data:a}}}},class extends ce{constructor(){super(...arguments),this.name="read_docs",this.type=f.READ,this.annotations=le({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- Supports pagination via page/limit. Check has_more_pages in response.\n- If type "ids" returns no results, automatically retries with object_ids.\n- Set include_blocks: true to include block IDs, types, and positions in the response — required before calling update_doc.\n- Blocks default to 25 per page. Use blocks_limit and blocks_page to paginate through long documents.\n- Set include_comments: true to fetch all comments and replies on the document. Each comment is enriched with anchor info (block_id, selection_from, selection_length) indicating which block and text range it\'s attached to. Use comments_limit to control how many comments per item (default 50).\n\nMODE: "version_history" — Fetch the edit history of a single document.\n- Requires: ids with the document\'s object_id (use the object_id field from content mode results, NOT the id field).\n- The object_id is the numeric ID visible in the document URL.\n- Returns restoring points sorted newest-first. Use version_history_limit to cap results (e.g., "last 3 changes" → version_history_limit: 3).\n- Use since/until to filter by time range. If omitted, returns full history.\n- Set include_diff: true to see what content changed between versions (fetches up to 10 diffs, may be slower).\n- Examples:\n - { mode: "version_history", ids: ["5001466606"], version_history_limit: 3 }\n - { mode: "version_history", ids: ["5001466606"], since: "2026-03-11T00:00:00Z", include_diff: true }'}getInputSchema(){return df}async executeInternal(e){return e.mode===rf?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 t,a,n;switch(this.sessionContext.metadata={...this.sessionContext.metadata,mode:e.mode??of,include_comments:e.include_comments??!1,include_blocks:e.include_blocks??!1},e.type){case"ids":t=e.ids;break;case"object_ids":a=e.ids;break;case"workspace_ids":n=e.ids}const i=e.include_blocks??!1,o=i?{blocksLimit:e.blocks_limit,blocksPage:e.blocks_page}:{},r={ids:t,object_ids:a,limit:e.limit||25,order_by:e.order_by,page:e.page,workspace_ids:n,includeBlocks:i,...o};let s=await this.mondayApi.request(sc,r);if((!s.docs||0===s.docs.length)&&t){const a={ids:void 0,object_ids:t,limit:e.limit||25,order_by:e.order_by,page:e.page,workspace_ids:n,includeBlocks:i,...o};s=await this.mondayApi.request(sc,a)}if(!s.docs||0===s.docs.length){return{content:`No documents found matching the specified criteria${e.page?` (page ${e.page})`:""}.`}}const d=e.include_comments??!1,p=e.comments_limit??50;return this.sessionContext.metadata={...this.sessionContext.metadata,doc_ids:s.docs.flatMap((e=>e?[e.id]:[])),object_ids:s.docs.flatMap((e=>e?.object_id?[e.object_id]:[]))},this.enrichDocsWithMarkdown(s.docs,r,i,d,p,e.blocks_limit,e.blocks_page)}catch(e){return{content:`Error reading documents: ${e instanceof Error?e.message:"Unknown error occurred"}`}}}async executeVersionHistory(e){const{include_diff:t,since:a,until:n,version_history_limit:i}=e,o=e.ids?.[0];if(!o)return{content:'Error: ids is required when mode is "version_history". Provide the document object_id.'};this.sessionContext.metadata={...this.sessionContext.metadata,mode:rf,object_ids:[o]};try{const e={docId:o,since:a,until:n},r=await this.mondayApi.request(dc,e);let s=r?.doc_version_history?.restoring_points;if(!s||0===s.length)return{content:`No version history found for document ${o}${a?` from ${a}`:""}.`};if(!t)return i&&(s=s.slice(0,i)),{content:{doc_id:o,since:a,until:n,restoring_points:s}};const d=Math.min(i??10,10),p=s.slice(0,d+1),l=s.length>d,c=(await Promise.allSettled(p.map((async(e,t)=>{if(t===p.length-1||!e.date)return e;const a=p[t+1];if(!a?.date)return e;const n={docId:o,date:e.date,prevDate:a.date},i=await this.mondayApi.request(lc,n);return{...e,diff:i?.doc_version_diff?.blocks??[]}}))).then((e=>e.map(((e,t)=>"fulfilled"===e.status?e.value:p[t]))))).slice(0,d);return{content:{doc_id:o,since:a,until:n,restoring_points:c,...l&&{truncated:!0,total_count:s.length}}}}catch(e){return{content:`Error fetching version history for document ${o}: ${e instanceof Error?e.message:"Unknown error"}`}}}buildCommentAnchorMap(e){const t=new Map;for(const a of e){const e=a.content?.deltaFormat;if(!e||!Array.isArray(e))continue;let n=0;for(const i of e){const e=i.insert,o="string"==typeof e?e.length:1,r=i.attributes,s=r?.comments;if(s&&Array.isArray(s))for(const e of s){const i=String(e),r=t.get(i);if(r&&r.block_id===a.id){const e=Math.max(r.selection_from+r.selection_length,n+o);r.selection_length=e-r.selection_from}else r||t.set(i,{block_id:a.id,selection_from:n,selection_length:o})}n+=o}}return t}async fetchDocComments(e,t,a){try{const n={boardId:e,itemsLimit:100,updatesLimit:a},[i,o]=await Promise.all([this.mondayApi.request(pc,n),this.mondayApi.request(tf,{docId:[t]}).catch((()=>null))]),r=i.boards?.[0]?.items_page?.items;if(!r)return[];let s=new Map;if(o){const e=(o.docs?.[0]?.blocks??[]).filter((e=>null!=e)).map((e=>{let t;if("string"==typeof e.content)try{t=JSON.parse(e.content)}catch{t={}}else t=e.content??{};return{id:e.id??"",type:e.type??"",content:t}}));s=this.buildCommentAnchorMap(e)}const d=[];for(const e of r)if(e.updates&&0!==e.updates.length)for(const t of e.updates)d.push({id:t.id,text_body:t.text_body,body:t.body,created_at:t.created_at,creator:t.creator?{id:t.creator.id,name:t.creator.name}:null,item_id:e.id,item_name:e.name,anchor:s.get(t.id)??null,replies:(t.replies??[]).map((e=>({id:e.id,text_body:e.text_body,body:e.body,created_at:e.created_at,creator:e.creator?{id:e.creator.id,name:e.creator.name}:null})))});return d}catch(e){return`Error fetching comments: ${e instanceof Error?e.message:"Unknown error"}`}}async enrichDocsWithMarkdown(e,t,a,n=!1,i=50,o,r){const s=await Promise.all(e.filter((e=>null!==e)).map((async e=>{let t,s="";try{const t={docId:e.id},a=await this.mondayApi.request(Ac,t);s=a.export_markdown_from_doc.success&&a.export_markdown_from_doc.markdown?a.export_markdown_from_doc.markdown:`Error getting markdown: ${a.export_markdown_from_doc.error||"Unknown error"}`}catch(e){s=`Error getting markdown: ${e instanceof Error?e.message:"Unknown error"}`}return n&&e.object_id&&(t=await this.fetchDocComments(e.object_id,e.id,i)),{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,...a&&{blocks:(e.blocks??[]).filter((e=>null!=e)).map((e=>({id:e.id,type:e.type,parent_block_id:e.parent_block_id,position:e.position,content:e.content}))),...void 0!==o||void 0!==r?{blocks_pagination:{current_page:r??1,limit:o??25,count:(e.blocks??[]).filter((e=>null!=e)).length,has_more_pages:(e.blocks??[]).length===(o??25)}}:{}},blocks_as_markdown:s,...n&&{comments:t}}}))),d=t.page||1,p=t.limit||25,l=s.length,c=l===p;return{content:{message:`Documents retrieved (${s.length})`,pagination:{current_page:d,limit:p,count:l,has_more_pages:c},data:s}}}},class extends ce{constructor(){super(...arguments),this.name="workspace_info",this.type=f.READ,this.annotations=le({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 pf}async executeInternal(e){const t={workspace_id:e.workspace_id},a=await this.mondayApi.request(Sc,t);if(!a.workspaces||0===a.workspaces.length)return{content:`No workspace found with ID ${e.workspace_id}`};const n=function(e,t){const{workspaces:a,boards:n,docs:i,folders:o}=e,r=a?.[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:[]}]))),d=[];(n||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name)).forEach((e=>{const t={id:e.id,name:e.name};e.board_folder_id&&s.has(e.board_folder_id)?s.get(e.board_folder_id).boards.push(t):d.push(t)}));const p=[];return(i||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name)).forEach((e=>{const t={id:e.id,name:e.name};e.doc_folder_id&&s.has(e.doc_folder_id)?s.get(e.doc_folder_id).docs.push(t):p.push(t)})),{workspace:{id:r.id,name:r.name,url:t?j_(t,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:d,docs:p}}}(a,await q_(this.mondayApi));return{content:{message:"Workspace info retrieved",data:n}}}},class extends ce{constructor(){super(...arguments),this.name="list_workspaces",this.type=f.READ,this.annotations=le({title:"List Workspaces",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'List all workspaces available to the user, ordered by membership (user\'s workspaces first). Returns workspaces with their ID, name, and description.\n[IMPORTANT] To search for workspaces by name, use the "search" tool with searchType WORKSPACES instead — it provides faster and more accurate results.'}getInputSchema(){return uf}async executeInternal(e){const t=t=>({limit:e.limit,page:e.page,membershipKind:t}),a=cf(await this.mondayApi.request(lf,t(xp.Member)));let n=a;if(!mf(a)){n=cf(await this.mondayApi.request(lf,t(xp.All)))}if(!mf(n))return{content:{message:"No workspaces found.",data:[]}};const i=n.length===e.limit,o=await q_(this.mondayApi),r=n.map((e=>({id:e.id,name:e.name,description:e.description||void 0,url:o&&e.id?j_(o,e.id):void 0})));return{content:{message:"Workspaces retrieved",...i?{next_page:e.page+1}:{},data:r}}}},class extends ce{constructor(){super(...arguments),this.name="create_doc",this.type=f.WRITE,this.annotations=le({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, optional docOwnerIds)\n- item: Creates a document attached to an item (requires item_id, optional column_id, optional docOwnerIds)\n\nUSAGE EXAMPLES:\n- Workspace doc: { location: "workspace", workspace_id: 123, doc_name: "My Doc", doc_kind: "private" , markdown: "..." }\n- Workspace doc in folder: { location: "workspace", workspace_id: 123, doc_name: "My Doc", folder_id: 17264196 , markdown: "..." }\n- Item doc: { location: "item", item_id: 456, doc_name: "My Doc", column_id: "doc_col_1" , markdown: "..." }\n- Workspace doc with agent owner: { location: "workspace", workspace_id: 123, doc_name: "My Doc", markdown: "...", docOwnerIds: ["<agent_owner_user_id>"] }'}getInputSchema(){return vf}async executeInternal(e){const t=yf.safeParse({...e,type:e.location});if(!t.success)return{content:`Required parameters were not provided for location parameter of ${e.location}`};const a=t.data;try{let t,n,i;if(a.type===bf.enum.workspace){const o={location:{workspace:{workspace_id:a.workspace_id.toString(),name:e.doc_name,kind:a.doc_kind||mo.Public,folder_id:a.folder_id?.toString()}},...void 0!==e.docOwnerIds?{docOwnerIds:e.docOwnerIds}:{}},r=await this.mondayApi.request(_f,o);t=r?.create_doc?.id??void 0,n=r?.create_doc?.object_id??void 0,i=r?.create_doc?.url??void 0}else if(a.type===bf.enum.item){const o={itemId:a.item_id.toString()},r=await this.mondayApi.request(hf,o),s=r.items?.[0];if(!s)return{content:`Error: Item with id ${a.item_id} not found.`};const d=s.board?.id,p=s.board?.columns?.find((e=>e&&e.type===ch.Doc));let l=a.column_id;if(!l)if(p)l=p.id;else{const e={boardId:d.toString(),columnType:ch.Doc,columnTitle:"Doc"},t=await this.mondayApi.request(gc,e);if(l=t?.create_column?.id,!l)return{content:"Error: Failed to create doc column."}}const c={location:{board:{item_id:a.item_id.toString(),column_id:l}},...void 0!==e.docOwnerIds?{docOwnerIds:e.docOwnerIds}:{}},m=await this.mondayApi.request(_f,c);if(t=m.create_doc?.id??void 0,n=m.create_doc?.object_id??void 0,i=m.create_doc?.url??void 0,e.doc_name&&t)try{const a={docId:t,name:e.doc_name};await this.mondayApi.request(gf,a)}catch(e){console.warn("Failed to update doc name:",e)}}if(!t)return{content:"Error: Failed to create document."};const o={docId:t,markdown:e.markdown},r=await this.mondayApi.request(ff,o),s=r?.add_content_to_doc_from_markdown?.success,d=r?.add_content_to_doc_from_markdown?.error;return s?(this.sessionContext.metadata={...this.sessionContext.metadata,location:e.location,...t&&{doc_id:t},...n&&{object_id:n}},{content:{message:"Document successfully created",doc_id:t,object_id:n,doc_url:i,doc_name:e.doc_name}}):{content:`Document ${t} created, but failed to add markdown content: ${d||"Unknown error"}`}}catch(e){return{content:`Error creating document: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends ce{constructor(){super(...arguments),this.name="add_content_to_doc",this.type=f.WRITE,this.annotations=le({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 wf}async executeInternal(e){if(!e.doc_id&&!e.object_id)return{content:"Error: Either doc_id or object_id must be provided."};try{let t=null;if(e.doc_id){const a=await this.mondayApi.request(Tf,{docId:[e.doc_id]});t=a.docs?.[0]??null}else{const a=await this.mondayApi.request(Ef,{objectId:[e.object_id]});t=a.docs?.[0]??null}if(!t){return{content:`Error: No document found for ${e.doc_id?`doc_id ${e.doc_id}`:`object_id ${e.object_id}`}.`}}this.sessionContext.metadata={...this.sessionContext.metadata,doc_id:t.id,...e.object_id&&{object_id:e.object_id}};const a={docId:t.id,markdown:e.markdown,afterBlockId:e.after_block_id},n=await this.mondayApi.request(If,a);if(!n?.add_content_to_doc_from_markdown)return{content:"Error: Failed to add content to document — no response from API."};const{success:i,block_ids:o,error:r}=n.add_content_to_doc_from_markdown;if(!i)return{content:`Error adding content to document: ${r||"Unknown error"}`};const s=o?.length??0;return{content:{message:`Successfully added content to document ${t.id}. ${s} block${1===s?"":"s"} created.`,doc_id:t.id,block_ids:o,doc_name:t.name,doc_url:t.url}}}catch(e){return{content:`Error adding content to document: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends ce{constructor(){super(...arguments),this.name="update_doc",this.type=f.WRITE,this.annotations=le({title:"Update Document",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return'Update an existing monday.com document. Provide doc_id (preferred) or object_id, plus an ordered operations array (executed sequentially, stops on first failure).\n\nOPERATIONS:\n- set_name: Rename the document.\n- add_markdown_content: Append markdown as blocks (or insert after a block). Best for text, headings, lists, simple tables — no block IDs needed.\n- update_block: Update content of an existing text, code, or list_item block in-place.\n- create_block: Create a new block at a precise position. Use parent_block_id to nest inside notice_box, table cell, or layout cell.\n- delete_blocks: Permanently delete 1–100 blocks in one call. Provide all block IDs in the block_ids array. The ONLY option for BOARD, WIDGET, DOC embed, and GIPHY blocks.\n- replace_block: Delete a block and create a new one in its place (use when update_block is not supported).\n- add_comment: Create a new comment or reply on the document (doc-level, block-level, or text-selection).\n\nWHEN TO USE EACH OPERATION:\n- text / code / list_item → update_block. Use replace_block to change subtype (e.g. NORMAL_TEXT→LARGE_TITLE)\n- divider / table / image / video / notice_box / layout → replace_block (properties immutable after creation)\n- BOARD / WIDGET / DOC / GIPHY → delete_blocks only\n\nGETTING BLOCK IDs: Call read_docs with include_blocks: true — returns id, type, position, and content per block.\n\nBLOCK CONTENT (delta_format): Array of insert ops. Last op MUST be {insert: {text: "\\n"}}.\n- Plain: [{insert: {text: "Hello"}}, {insert: {text: "\\n"}}]\n- Bold: [{insert: {text: "Hi"}, attributes: {bold: true}}, {insert: {text: "\\n"}}]\n- Mention user/doc/board: [{insert: {text: "Hey "}}, {insert: {mention: {id: 12345, type: "USER"}}}, {insert: {text: "\\n"}}] — type is USER, DOC, or BOARD. id is numeric (user IDs from list_users_and_teams)\n- Inline column value: [{insert: {column_value: {item_id: 111, column_id: "status"}}}, {insert: {text: "\\n"}}]\n- Supported attributes: bold, italic, underline, strike, code, link, color, background (not applicable to mention/column_value ops)\n\nIMAGE WITH ASSET: For asset-based images, use create_block with block_type "image" and asset_id (instead of public_url). add_markdown_content does NOT support asset images — for mixed content, alternate add_markdown_content (text) and create_block (image) operations in sequence.\n\nBATCHING DELETES: delete_blocks accepts 1..100 IDs. Put ALL IDs in one operation\'s block_ids array. Never emit multiple delete_blocks operations in a row.\n\nCOMMENTS:\n- add_comment: Create a new comment or reply on the document. Three scopes:\n - Doc-level (no block_id): comment appears on the doc as a whole.\n - Block-level (block_id only): comment is anchored to a specific block. The block shows a comment indicator in the UI.\n - Text-selection (block_id + selection_from + selection_length): comment is anchored to a specific character range inside a text/code/list_item block. That text is highlighted with a comment marker.\n Block-level and text-selection comments only work on blocks with text content (text, code, list_item, title, quote). They do NOT work on: divider, page_break, table, layout, notice_box, image, video, or giphy blocks.\n Get block IDs from read_docs with include_blocks: true. Format body with HTML, not markdown. Use mentions_list for @mentions.'}getInputSchema(){return og}async executeInternal(e){if(!e.doc_id&&!e.object_id)return{content:"Error: Either doc_id or object_id must be provided."};this.sessionContext.metadata={...this.sessionContext.metadata,operation_types:e.operations?.map((e=>e.operation_type)),operation_count:e.operations?.length??0,...e.object_id&&{object_id:e.object_id}};try{let t=e.doc_id;if(!t){const a=await this.mondayApi.request(K_,{objectId:[e.object_id]}),n=a.docs?.[0];if(!n)return{content:`Error: No document found for object_id ${e.object_id}.`};t=n.id}const a=[];let n=null;for(let i=0;i<e.operations.length;i++){const o=e.operations[i];try{const n=await this.executeOperation(t,o,e.object_id);a.push(`- [OK] ${o.operation_type}${n?`: ${n}`:""}`)}catch(e){const t=e instanceof Error?e.message:"Unknown error";a.push(`- [FAILED] ${o.operation_type}: ${t}`),n=i;break}}const i=null!==n?n:e.operations.length,o=e.operations.length,r=`Completed ${i}/${o} operation${1===o?"":"s"} on doc ${t}.`;return this.sessionContext.metadata={...this.sessionContext.metadata,doc_id:t},{content:`${r}\n\nResults:\n${a.join("\n")}\n\nDoc ID: ${t}`}}catch(e){return{content:`Error: ${e instanceof Error?e.message:String(e)}`}}}async executeOperation(e,t,a){switch(t.operation_type){case"set_name":return this.executeSetName(e,t.name);case"add_markdown_content":return this.executeAddMarkdown(e,t.markdown,t.after_block_id);case"update_block":return this.executeUpdateBlock(t.block_id,t.content);case"create_block":return this.executeCreateBlock(e,t.block,t.after_block_id,t.parent_block_id);case"delete_blocks":return this.executeDeleteBlocks(t.block_ids);case"replace_block":return this.executeReplaceBlock(e,t.block_id,t.block,t.after_block_id,t.parent_block_id);case"add_comment":return this.executeAddComment(e,a,t.body,t.parent_update_id,t.mentions_list,t.block_id,t.selection_from,t.selection_length);default:{const e=t.operation_type;throw new Error(`Unsupported operation type: "${e}"`)}}}async executeSetName(e,t){const a={docId:e,name:t},n=await this.mondayApi.request(W_,a);if(!n?.update_doc_name)throw new Error(`No confirmation from update_doc_name — rename to "${t}" may not have applied`);return`Renamed to "${t}"`}async executeAddMarkdown(e,t,a){if(!t.trim())throw new Error("markdown must not be empty");const n={docId:e,markdown:t,afterBlockId:a},i=await this.mondayApi.request(Y_,n),o=i?.add_content_to_doc_from_markdown;if(!o?.success)throw new Error(o?.error||"Failed to add markdown content");const r=o.block_ids?.length??0;return`${r} block${1===r?"":"s"} added${o.block_ids?.length?`. Block IDs: ${o.block_ids.join(", ")}`:""}`}async executeUpdateBlock(e,t){const a=function(e){switch(e.block_content_type){case"text":return{deltaFormat:Of(e.delta_format),alignment:e.alignment,direction:e.direction};case"code":return{deltaFormat:Of(e.delta_format),language:e.language};case"list_item":return{deltaFormat:Of(e.delta_format),checked:e.checked,indentation:e.indentation};default:{const t=e.block_content_type;throw new Error(`Unsupported block_content_type: "${t}"`)}}}(t),n={blockId:e,content:JSON.stringify(a)},i=await this.mondayApi.request(Q_,n);if(!i?.update_doc_block)throw new Error("No response from update_doc_block");return`Block ${e} updated`}async executeCreateBlock(e,t,a,n){const i=function(e){switch(e.block_type){case"text":return{text_block:{delta_format:Df(e.delta_format),text_block_type:e.text_block_type?e.text_block_type:void 0,alignment:Af(e.alignment),direction:Sf(e.direction)}};case"list_item":return{list_block:{delta_format:Df(e.delta_format),list_block_type:e.list_block_type?e.list_block_type:void 0,indentation:e.indentation}};case"code":return{text_block:{delta_format:Df(e.delta_format),text_block_type:Vd.Code}};case"divider":return{divider_block:{}};case"page_break":return{page_break_block:{}};case"image":if(null==e.asset_id&&!e.public_url)throw new Error("image block requires either asset_id or public_url");return{image_block:null!=e.asset_id?{asset_id:String(e.asset_id),width:e.width}:{public_url:e.public_url,width:e.width}};case"video":return{video_block:{raw_url:e.raw_url,width:e.width}};case"notice_box":return{notice_box_block:{theme:e.theme}};case"table":return{table_block:{row_count:e.row_count,column_count:e.column_count,width:e.width,column_style:e.column_style?.map((e=>({width:e.width})))}};case"layout":return{layout_block:{column_count:e.column_count,column_style:e.column_style?.map((e=>({width:e.width})))}};default:{const t=e.block_type;throw new Error(`Unsupported block_type: "${t}"`)}}}(t);if(n){const e=Object.keys(i);if(1!==e.length)throw new Error(`Cannot inject parent_block_id: expected exactly 1 key in block input, got: ${e.join(", ")}`);const t=e[0],a=i[t];if(!a||"object"!=typeof a)throw new Error(`Cannot inject parent_block_id into block type "${t}" — block value is not an object`);a.parent_block_id=n}const o={docId:e,afterBlockId:a,blocksInput:[i]},r=await this.mondayApi.request(nf,o),s=r?.create_doc_blocks;if(!s||0===s.length)throw new Error("No blocks returned from create_doc_blocks");return`Block created (ID: ${s.map((e=>e.id)).join(", ")})`}async executeDeleteBlock(e){const t={blockId:e},a=await this.mondayApi.request(J_,t);if(!a?.delete_doc_block)throw new Error("No response from delete_doc_block");return`Block ${e} deleted`}async executeDeleteBlocks(e){if(0===e.length)throw new Error("block_ids must not be empty");const t={blockIds:e},a=await this.mondayApi.request(X_,t);if(!a?.delete_doc_blocks||0===a.delete_doc_blocks.length)throw new Error("No response from delete_doc_blocks");const n=a.delete_doc_blocks.map((e=>e.id)).join(", ");return`${a.delete_doc_blocks.length} block(s) deleted (IDs: ${n})`}async resolveObjectId(e,t){if(t)return t;const a=await this.mondayApi.request(Z_,{docId:[e]}),n=a.docs?.[0];if(!n?.object_id)throw new Error(`Could not resolve object_id for doc ${e}`);return n.object_id}async resolveDocItemId(e){const t=await this.mondayApi.request(ef,{boardId:e}),a=t.boards?.[0]?.items_page?.items?.[0]?.id;if(!a)throw new Error(`No item found on the document backing board (object_id: ${e})`);return a}async fetchAllBlockContent(e){const t=await this.mondayApi.request(tf,{docId:[e]});return(t.docs?.[0]?.blocks??[]).filter((e=>null!=e)).map((t=>{let a;if("string"==typeof t.content)try{a=JSON.parse(t.content)}catch{throw new Error(`Failed to parse content of block ${t.id} in doc ${e} as JSON`)}else a=t.content??{};return{id:t.id??"",type:t.type??"",content:a}}))}async executeAddComment(e,t,a,n,i,o,r,s){if((null!=r||null!=s)&&!o)throw new Error("selection_from and selection_length require block_id");if(null!=r!=(null!=s))throw new Error("selection_from and selection_length must both be provided together");const d=o?Array.isArray(o)?o:[o]:[];if((null!=r||null!=s)&&d.length>1)throw new Error("selection_from and selection_length are only supported with a single block_id");const p=await this.resolveObjectId(e,t),l=await this.resolveDocItemId(p);let c;if(i){const e=JSON.parse(i),t=Lh.safeParse(e);if(!t.success)throw new Error(`Invalid mentions_list format: ${t.error.message}`);c=t.data}const m={itemId:l,body:a,parentId:n?.toString(),mentionsList:c},u=await this.mondayApi.request(af,m);if(!u.create_update?.id)throw new Error("Failed to create comment: no update returned");const h=u.create_update.id,_=Number(h),f=n?`Reply to update ${n}`:"Comment";if(d.length>0){if(Number.isNaN(_))throw new Error(`${f} created (update ID: ${h}) but block annotation aborted: comment ID is not numeric and cannot be used as a delta reference`);const t=await this.fetchAllBlockContent(e);for(const a of d){const n=t.find((e=>e.id===a));if(!n)throw new Error(`${f} created (update ID: ${h}) but block annotation failed: block ${a} not found in doc ${e}`);const i=n.content.deltaFormat;if(!i)throw new Error(`${f} created (update ID: ${h}) but block annotation failed: block ${a} has no deltaFormat — only text, code, and list_item blocks are supported`);let o=0;for(const e of i)o+="string"==typeof e.insert?e.insert.length:1;if(0===o)throw new Error(`${f} created (update ID: ${h}) but block annotation failed: block ${a} has an empty deltaFormat and cannot be annotated`);const d=r??0,p=s??o;if(d+p>o)throw new Error(`${f} created (update ID: ${h}) but block annotation failed: selection [${d}, ${d+p}) is out of range for block ${a} (total length ${o})`);let l;try{l=Cf(i,_,d,p)}catch(e){const t=e instanceof Error?e.message:String(e);throw new Error(`${f} created (update ID: ${h}) but delta annotation failed for block ${a}: ${t}`)}const c={...n.content,deltaFormat:l},m=await this.mondayApi.request(Q_,{blockId:a,content:JSON.stringify(c)});if(!m?.update_doc_block)throw new Error(`${f} created (update ID: ${h}) but block annotation write returned no confirmation for block ${a}`)}}const g=d.length;return`${f} created${g>1?` across ${g} blocks`:1===g?" on block":""} (update ID: ${h})`}async executeReplaceBlock(e,t,a,n,i){await this.executeDeleteBlock(t);try{return`Block ${t} replaced. ${await this.executeCreateBlock(e,a,n,i)}`}catch(e){const a=e instanceof Error?e.message:String(e);throw new Error(`Original block ${t} was deleted, but replacement creation failed: ${a}. The original block is gone.`)}}},class extends ce{constructor(){super(...arguments),this.name="update_workspace",this.type=f.WRITE,this.annotations=le({title:"Update Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing workspace in monday.com"}getInputSchema(){return mg}async executeInternal(e){const t={id:e.id,attributes:{account_product_id:e.attributeAccountProductId,description:e.attributeDescription,kind:e.attributeKind,name:e.attributeName}},a=await this.mondayApi.request(cg,t),n=await q_(this.mondayApi),i=n?j_(n,a.update_workspace?.id):void 0;return{content:{message:`Workspace ${a.update_workspace?.id} updated`,workspace_id:a.update_workspace?.id,workspace_name:a.update_workspace?.name,workspace_url:i}}}},class extends ce{constructor(){super(...arguments),this.name="update_folder",this.type=f.WRITE,this.annotations=le({title:"Update Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing folder in monday.com"}getInputSchema(){return hg}async executeInternal(e){const{position_object_id:t,position_object_type:a,position_is_after:n}=e;if(!!t!=!!a)throw new Error("position_object_id and position_object_type must be provided together");const i={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:t?{position_is_after:n,position_object_id:t,position_object_type:a}:void 0},o=await this.mondayApi.request(ug,i);return{content:{message:`Folder ${o.update_folder?.id} updated`,folder_id:o.update_folder?.id,folder_name:o.update_folder?.name}}}},class extends ce{constructor(){super(...arguments),this.name="create_workspace",this.type=f.WRITE,this.annotations=le({title:"Create Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new workspace in monday.com"}getInputSchema(){return fg}async executeInternal(e){const t={name:e.name,workspaceKind:e.workspaceKind,description:e.description,accountProductId:e.accountProductId},a=await this.mondayApi.request(_g,t),n=await q_(this.mondayApi),i=n&&a.create_workspace?.id?j_(n,a.create_workspace.id):void 0;return{content:{message:`Workspace ${a.create_workspace?.id} successfully created`,workspace_id:a.create_workspace?.id,workspace_name:a.create_workspace?.name,workspace_url:i}}}},class extends ce{constructor(){super(...arguments),this.name="create_folder",this.type=f.WRITE,this.annotations=le({title:"Create Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new folder in a monday.com workspace"}getInputSchema(){return bg}async executeInternal(e){const t={workspaceId:e.workspaceId,name:e.name,color:e.color,fontWeight:e.fontWeight,customIcon:e.customIcon,parentFolderId:e.parentFolderId},a=await this.mondayApi.request(gg,t);return{content:{message:`Folder ${a.create_folder?.id} successfully created`,folder_id:a.create_folder?.id,folder_name:a.create_folder?.name}}}},class extends ce{constructor(){super(...arguments),this.name="move_object",this.type=f.WRITE,this.annotations=le({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 Ig}async executeUpdateFolder(e){const{id:t,position_object_id:a,position_object_type:n,position_is_after:i,parentFolderId:o,workspaceId:r,accountProductId:s}=e;if(!!a!=!!n)throw new Error("position_object_id and position_object_type must be provided together");const d={folderId:t,position:a?{position_is_after:i,position_object_id:a,position_object_type:n}:void 0,parentFolderId:o,workspaceId:r,accountProductId:s},p=await this.mondayApi.request(ug,d);return{content:{message:"Object moved",object_id:p.update_folder?.id}}}async executeUpdateBoardHierarchy(e){const{id:t,position_object_id:a,position_object_type:n,position_is_after:i,parentFolderId:o,workspaceId:r,accountProductId:s}=e;if(!!a!=!!n)throw new Error("position_object_id and position_object_type must be provided together");const d={boardId:t,attributes:{position:a?{position_is_after:i,position_object_id:a,position_object_type:n}:void 0,folder_id:o,workspace_id:r,account_product_id:s}},p=await this.mondayApi.request(yg,d);return p.update_board_hierarchy?.success?{content:{message:"Board position updated",object_id:p.update_board_hierarchy?.board?.id,action_name:"move_board"}}:{content:`Board position update failed: ${p.update_board_hierarchy?.message}`}}async executeUpdateOverviewHierarchy(e){const{id:t,position_object_id:a,position_object_type:n,position_is_after:i,parentFolderId:o,workspaceId:r,accountProductId:s}=e;if(!!a!=!!n)throw new Error("position_object_id and position_object_type must be provided together");const d={overviewId:t,attributes:{position:a?{position_is_after:i,position_object_id:a,position_object_type:n}:void 0,folder_id:o,workspace_id:r,account_product_id:s}},p=await this.mondayApi.request(vg,d);return p.update_overview_hierarchy?.success?{content:{message:"Overview position updated",object_id:p.update_overview_hierarchy?.overview?.id}}:{content:`Overview position update failed: ${p.update_overview_hierarchy?.message}`}}async executeInternal(e){const{objectType:t}=e;switch(t){case zs.Folder:return this.executeUpdateFolder(e);case zs.Board:return this.executeUpdateBoardHierarchy(e);case zs.Overview:return this.executeUpdateOverviewHierarchy(e);default:throw new Error(`Unsupported object type: ${t}`)}}},class extends ce{constructor(){super(...arguments),this.name="create_dashboard",this.type=f.WRITE,this.annotations=le({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 pg}async executeInternal(e){try{const t={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()},a=await this.mondayApi.request(rg,t);if(!a.create_dashboard)throw new Lc("Failed to create dashboard",Cc);const n=a.create_dashboard;return{content:{message:`Dashboard ${n.id} successfully created`,dashboard_id:n.id,dashboard_name:n.name}}}catch(e){Uc(e,"create dashboard")}}},class extends ce{constructor(){super(...arguments),this.name="all_widgets_schema",this.type=f.READ,this.annotations=le({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={},t=await this.mondayApi.request(sg,e);if(!t.all_widgets_schema||0===t.all_widgets_schema.length)throw new Error("No widget schemas found - API returned empty response");const a={};let n=0;for(const e of t.all_widgets_schema)if(e?.widget_type&&e?.schema){const t="string"==typeof e.schema?JSON.parse(e.schema):e.schema,i=t?.description||t?.title||`${e.widget_type} widget for data visualization`;a[e.widget_type]={type:e.widget_type,description:i,schema:e.schema},n++}if(0===n)throw new Error("No valid widget schemas found in API response");Object.keys(a).map((e=>`• **${e}**: ${a[e].description}`)).join("\n");return{content:{message:"Widgets schema",data:a,url:__}}}catch(e){const t=e instanceof Error?e.message:String(e);throw new Error(`Failed to fetch widget schemas: ${t}`)}}},class extends ce{constructor(){super(...arguments),this.name="create_widget",this.type=f.WRITE,this.annotations=le({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 lg}async executeInternal(e){if(!e.settings)throw new Lc("You must pass the settings parameter",kc);try{const t={parent:{kind:e.parent_container_type,id:e.parent_container_id.toString()},kind:e.widget_kind,name:e.widget_name,settings:e.settings},a=await this.mondayApi.request(dg,t);if(!a.create_widget)throw new Lc("Failed to create widget",Cc);const n=a.create_widget;n.parent?.kind===Op.Dashboard?n.parent.id:n.parent;return{content:{message:`Widget ${n.id} created`,widget_id:n.id,widget_name:n.name,dashboard_id:n.parent?.id}}}catch(t){Uc(t,`create ${e.widget_kind} widget`)}}},class extends ce{constructor(){super(...arguments),this.name="board_insights",this.type=f.READ,this.annotations=le({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 with filters.columns.only to get column metadata without fetching views. 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 Ng}async executeInternal(e){if(!e.aggregations)return{content:'Input must contain the "aggregations" field.'};const{selectElements:t,groupByElements:a}=function(e){const t={},a=e.groupBy?.map((e=>({column_id:e})))||[],n=new Set(e.aggregations.filter((e=>e.function===ki.Label)).map((e=>e.columnId))),i=e.groupBy?.filter((e=>!n.has(e))).map((e=>({function:ki.Label,columnId:e})))??[],o=e.aggregations.concat(i).map((e=>{if(e.function){const o=`${e.function}_${e.columnId}`,r=t[o]||0;t[o]=r+1;const s=`${o}_${r}`;return Ag.has(e.function)&&(a.some((e=>e.column_id===s))||a.push({column_id:s})),{type:Ci.Function,function:(n=e.function,i=e.columnId,{function:n,params:n===ki.CountItems?[]:[{type:Ci.Column,column:Sg(i),as:i}]}),as:s}}var n,i;const o={type:Ci.Column,column:Sg(e.columnId),as:e.columnId};return a.some((t=>t.column_id===e.columnId))||a.push({column_id:e.columnId}),o}));return a.forEach((e=>{o.some((t=>t.as===e.column_id))||o.push({type:Ci.Column,column:Sg(e.column_id),as:e.column_id})})),{selectElements:o,groupByElements:a}}(e),n=function(e){if(!e.filters&&!e.orderBy)return;const t={};return e.filters&&(t.rules=e.filters.map((e=>({column_id:e.columnId,compare_value:e.compareValue,operator:e.operator,compare_attribute:e.compareAttribute}))),t.operator=e.filtersOperator),e.orderBy&&(t.order_by=function(e){return e.orderBy?.map((e=>({column_id:e.columnId,direction:e.direction})))}(e)),t}(e),i=function(e){return{id:e.boardId.toString(),type:Ti.Table}}(e),o={query:{from:i,query:n,select:t,group_by:a,limit:e.limit},boardId:String(e.boardId)},r=await this.mondayApi.request(Eg,o),s=(r.aggregate?.results??[]).map((e=>{const t={};return(e.entries??[]).forEach((e=>{const a=e.alias??"";if(!a)return;const n=e.value;if(!n)return void(t[a]=null);const i=n.result??n.value??null;t[a]=i})),t}));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 ce{constructor(){super(...arguments),this.name="search",this.type=f.READ,this.annotations=le({title:"Search",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return`Search within monday.com platform. Supported searchType values: ${d_}.\nsearchTerm is the phrase the search matches against — the text/keywords to look for (e.g. a board name, item title, or a word from an update). It is required and must be non-empty. This tool has no "list everything" mode: to browse or list without a search phrase, use workspace_info (boards/docs/folders in a workspace) or get_board_items_page (items in a board) instead of calling search with an empty searchTerm.\nFor searching/listing specific users and teams, use list_users_and_teams tool.\nFor account-level info (plan, member count, products), use get_user_context tool.\nFor browsing all boards, docs, or folders within a workspace without a search term, use workspace_info tool.\nFor groups, use get_board_info tool.\nFor listing items within a specific board, use get_board_items_page tool. ITEMS search here queries items across the account.\nBOARD search returns id, title, url, and workspaceId. Optionally scope it with boardIds.\nDOCUMENTS search returns id, title, workspaceId, and highlights. highlights is an array of { field, fragments } entries (field is "name" or "content") where fragments contain matched text snippets with <em> tags around matched terms. highlights is omitted when no lexical match was made. Optionally scope it with workspaceIds and/or docIds.\nITEMS search returns id, title, url, boardId, and workspaceId. Optionally scope it with workspaceIds, boardIds, and/or creatorIds.\nWORKSPACES search returns id, title, and description.\nUPDATES search returns id, title (the update body), itemId, boardId, and creatorId. Optionally scope it with workspaceIds, boardIds, and/or creatorIds.\nTIMELINE_ITEMS search returns id, title, summary, content, itemId, and boardId. Optionally scope it with workspaceIds and/or boardIds.\nDASHBOARDS search (also called "overviews") returns id, title, and workspaceId. Optionally scope it with workspaceIds and/or creatorIds.\nFOLDERS search returns id and title. Optionally scope it with workspaceIds, which searches all accessible workspaces when omitted. Pass workspaceIds to narrow the search if results may be truncated.\n `}getInputSchema(){return Gg}async executeInternal(e){const{searchTerm:t}=e;if(!t)throw new Lc("searchTerm is required and must be a non-empty search string. To browse or list without a search term, use workspace_info (for boards, docs, and folders in a workspace) or get_board_items_page (for items within a specific board).",kc);try{if(e.searchType===s_.FOLDERS){const{results:a,truncated:n}=await this.searchFoldersAsync(e,t);return{content:{message:n?"Search results (truncated: only the first 100 folders across the searched workspaces were scanned. Narrow with workspaceIds for complete results.)":"Search results",data:a}}}return{content:{message:"Search results",data:await this.runSmartSearchAsync(e,t)}}}catch(e){throw Pc(e),e}}async runSmartSearchAsync(e,t){const a=Bg(e.workspaceIds?.map((e=>e.toString())));if(e.searchType===s_.BOARD){const n=Bg(e.boardIds?.map((e=>e.toString())));return this.searchBoardsAsync(t,e.limit,a,n)}if(e.searchType===s_.DOCUMENTS){const n=Bg(e.docIds?.map((e=>e.toString())));return this.searchDocsAsync(t,e.limit,a,n)}if(e.searchType===s_.WORKSPACES)return this.searchWorkspacesAsync(t,e.limit);if(e.searchType===s_.UPDATES){const n=Bg(e.boardIds?.map((e=>e.toString()))),i=Bg(e.creatorIds?.map((e=>e.toString())));return this.searchUpdatesAsync(t,e.limit,a,n,i)}if(e.searchType===s_.ITEMS){const n=Bg(e.boardIds?.map((e=>e.toString()))),i=Bg(e.creatorIds?.map((e=>e.toString())));return this.searchItemsAsync(t,e.limit,a,n,i)}if(e.searchType===s_.TIMELINE_ITEMS){const n=Bg(e.boardIds?.map((e=>e.toString())));return this.searchTimelineItemsAsync(t,e.limit,a,n)}if(e.searchType===s_.DASHBOARDS){const n=e.creatorIds?.map((e=>e.toString()));return this.searchOverviewsAsync(t,e.limit,a,n)}throw new Lc(`Unsupported search type for smart search: ${e.searchType}`,Oc)}async searchBoardsAsync(e,t,a,n){const i={query:e,limit:t,workspaceIds:a,boardIds:n};return(await this.mondayApi.request(Rg,i,{timeout:qc})).search.boards.results.map((e=>({id:e.indexed_data.id,title:e.indexed_data.name,url:e.indexed_data.url,workspaceId:e.indexed_data.workspace_id??void 0})))}async searchDocsAsync(e,t,a,n){const i={query:e,limit:t,workspaceIds:a,docIds:n};return(await this.mondayApi.request(Cg,i,{timeout:qc})).search.docs.results.map((e=>({id:e.indexed_data.id,title:e.indexed_data.name,workspaceId:e.indexed_data.workspace_id??void 0,highlights:zg(e.indexed_data.highlights)})))}async searchWorkspacesAsync(e,t){const a={query:e,limit:t};return(await this.mondayApi.request(kg,a,{timeout:qc})).search.workspaces.results.map((e=>({id:e.indexed_data.id,title:e.indexed_data.name,description:e.indexed_data.description||void 0})))}async searchUpdatesAsync(e,t,a,n,i){const o={query:e,limit:t,workspaceIds:a,boardIds:n,creatorIds:i};return(await this.mondayApi.request(Lg,o,{timeout:qc})).search.updates.results.map((e=>({id:e.indexed_data.id,title:e.indexed_data.body,itemId:e.indexed_data.item_id,boardId:e.indexed_data.board_id,creatorId:e.indexed_data.creator_id})))}async searchItemsAsync(e,t,a,n,i){return(i?await this.mondayApi.request(Pg,{query:e,limit:t,workspaceIds:a,boardIds:n,creatorIds:i},{versionOverride:"dev",timeout:qc}):await this.mondayApi.request(Og,{query:e,limit:t,workspaceIds:a,boardIds:n},{timeout:qc})).search.items.results.map((e=>({id:e.indexed_data.id,title:e.indexed_data.name,url:e.indexed_data.url,boardId:e.indexed_data.board_id??void 0,workspaceId:e.indexed_data.workspace_id??void 0})))}async searchTimelineItemsAsync(e,t,a,n){const i={query:e,limit:t,workspaceIds:a,boardIds:n};return(await this.mondayApi.request(Ug,i,{timeout:qc})).search.timeline_items.results.map((e=>({id:e.indexed_data.id,title:e.indexed_data.title,summary:e.indexed_data.summary||void 0,content:e.indexed_data.content||void 0,itemId:e.indexed_data.item_id,boardId:e.indexed_data.board_id??void 0})))}async searchOverviewsAsync(e,t,a,n){const i={query:e,limit:t,workspaceIds:a,creatorIds:n};return(await this.mondayApi.request($g,i,{versionOverride:"dev",timeout:qc})).search.overviews.results.map((e=>({id:e.indexed_data.id,title:e.indexed_data.name,workspaceId:e.indexed_data.workspace_id??void 0})))}async searchFoldersAsync(e,t){const a=xg(t);if(!a)return{results:[],truncated:!1};const n={page:1,limit:100,workspace_ids:Bg(e.workspaceIds?.map((e=>e.toString())))},i=(await this.mondayApi.request(Dg,n)).folders||[];return{results:i.filter((e=>e?.name&&xg(e.name).includes(a))).filter((e=>e?.id)).slice(0,e.limit).map((e=>({id:e.id,title:e.name}))),truncated:100===i.length}}},class extends ce{constructor(){super(...arguments),this.name="get_user_context",this.type=f.READ,this.annotations=le({title:"Get User Context",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Fetch current user information, account information, and their relevant items (boards, docs, folders, workspaces, dashboards).\n\n Use this tool to:\n - Get context about who the current user is (id, name, title)\n - Get account info: plan tier, active member count, trial status, and active products\n - Get the number of active members in the account (returns active_members_count)\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 docs based on load 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:t,intelligence:a}=await this.mondayApi.request(eb,{},{versionOverride:"dev"});if(!e)return{content:"AUTHENTICATION_ERROR: Unable to fetch current user. Verify API token and user permissions."};const n=await this.fetchFavorites(t||[]),i=this.extractRelevantBoards(a),o=this.extractRelevantDocs(a),r=this.extractRelevantPeople(a),{account:s,...d}=e;return{content:{message:"User context",...{user:d,account:s?{tier:s.tier,active_members_count:s.active_members_count,is_during_trial:s.is_during_trial,products:s.products?.filter(Boolean).map((e=>({kind:e.kind,tier:e.tier})))??[]}:null,favorites:n,relevantBoards:i,relevantDocs:o,relevantPeople:r}}}}async fetchFavorites(e){const t=this.groupByType(e),a=Object.keys(t);if(0===a.length)return[];const n={};for(const e of a)n[ab[e]]=t[e];const i=await this.mondayApi.request(tb,n),o=[];for(const e of a){const t=nb[e];for(const a of i[t]??[])a?.id&&o.push({id:a.id,name:a.name,type:e})}return o}extractRelevantBoards(e){if(!e?.relevant_boards)return[];const t=[];for(const a of e.relevant_boards)a?.id&&a?.board?.name&&t.push({id:a.id,name:a.board.name});return t}extractRelevantDocs(e){if(!e?.relevant_docs)return[];const t=[];for(const a of e.relevant_docs)a?.id&&a?.document?.name&&t.push({id:a.id,name:a.document.name,objectId:a.object_id});return t}extractRelevantPeople(e){if(!e?.relevant_people)return[];const t=[];for(const a of e.relevant_people)a?.id&&a?.user?.name&&t.push({id:a.id,name:a.user.name});return t}groupByType(e){const t={};for(const a of e){const e=a?.object;e?.id&&e?.type&&(t[e.type]??=[]).push(e.id)}return t}},class extends ce{constructor(){super(...arguments),this.name="update_assets_on_item",this.type=f.WRITE,this.annotations=le({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 Jg}async executeInternal(e){const t={boardId:e.boardId,itemId:e.itemId,columnId:e.columnId,files:e.files},a=await this.mondayApi.request(Kg,t);return{content:`Item ${a.update_assets_on_item?.id} (${a.update_assets_on_item?.name}) assets successfully updated`}}},class extends ce{constructor(){super(...arguments),this.name="get_assets",this.type=f.READ,this.annotations=le({title:"Get Assets",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get assets (files) by their IDs. Returns file metadata including name, extension, size, public URL (valid for 1 hour), thumbnail URL, upload date, and who uploaded it."}getInputSchema(){return Zg}async executeInternal(e){const t=await this.mondayApi.request(Xg,{ids:e.ids}),a=t.assets?.filter(Boolean);if(!a||0===a.length)return{content:`No assets found for the provided IDs: ${e.ids.join(", ")}`};return{content:{results:a.map((e=>({id:e.id,name:e.name,file_extension:e.file_extension,file_size:e.file_size,public_url:e.public_url,url:e.url,url_thumbnail:e.url_thumbnail??null,created_at:e.created_at??null,original_geometry:e.original_geometry??null,uploaded_by:e.uploaded_by})))}}}},class extends ce{constructor(){super(...arguments),this.name="create_view",this.type=f.WRITE,this.annotations=le({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\n[REQUIRED PRECONDITION]: If you pass filters or sorting, call get_board_info first with filters.columns.only to get the board column IDs, column types, and status label indexes without fetching views. Filter rules reference real column IDs and, for status columns, numeric label indexes — do not guess them. Before sending the filters, use get_column_type_info with fetchMode "${cm.Guidelines}" and use data.guidelines.filter (null if that type has no documented rules).\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 wm}async executeInternal(e){const t={boardId:e.boardId,type:e.type,name:e.name,filter:e.filter,sort:e.sort,settings:e.settings},a=await this.mondayApi.request(Tm,t);return a.create_view?{content:`View "${a.create_view.name}" (ID: ${a.create_view.id}, type: ${a.create_view.type}) successfully created`}:{content:"Failed to create view - no response from API"}}},class extends ce{constructor(){super(...arguments),this.name="update_view",this.type=f.WRITE,this.annotations=le({title:"Update View",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return`Update an existing board view (tab) — change its name, filter rules, or sort order. Provide only the fields you want to change. Omitted fields are left unchanged.\n\n[REQUIRED PRECONDITION]: Call get_board_info first — it returns the board views (so you can resolve the viewId, including from a view name the user mentioned) along with the column IDs, column types, and status label indexes that filter and sort rules reference. When the user named specific views, pass those names as get_board_info.filters.views.names to avoid fetching every view on large boards. If you pass filters, also use get_column_type_info with fetchMode "${cm.Guidelines}" and use data.guidelines.filter (null if that type has no documented rules) before sending them — do not guess compare_value/operator rules per column type.\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 Sm}async executeInternal(e){const t={viewId:e.viewId,boardId:e.boardId,type:e.type,name:e.name,filter:e.filter,sort:e.sort,settings:e.settings},a=await this.mondayApi.request(Am,t);return a.update_view?{content:`View "${a.update_view.name}" (ID: ${a.update_view.id}, type: ${a.update_view.type}) successfully updated`}:{content:"Failed to update view - no response from API"}}},class extends ce{constructor(){super(...arguments),this.name="create_view_table",this.type=f.WRITE,this.annotations=le({title:"Create Table View",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return`Create a new table-type board view with optional filters, sort, tags, and table-specific settings (column visibility/order and group-by). Use this instead of create_view when you need to configure table-specific settings. For a simple table view, create_view also works.\n\n[REQUIRED PRECONDITION]: Call get_board_info first with filters.columns.only to get the board column IDs, column types, and status label indexes without fetching views. Filters, sort, column_properties, column_order, and group_by all reference real column IDs — do not guess them. This is required even if you are not passing filters, since column_properties/column_order/group_by need real column IDs too. If you pass filters, also use get_column_type_info with fetchMode "${cm.Guidelines}" and use data.guidelines.filter (null if that type has no documented rules) before sending them — do not guess compare_value/operator rules per column type.\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 settings.columns: { "column_properties": [{ "column_id": "status", "visible": true }], "column_order": ["name", "status", "date"] }\nExample settings.group_by: { "conditions": [{ "columnId": "status" }], "hideEmptyGroups": true }`}getInputSchema(){return Rm}async executeInternal(e){const t={boardId:e.boardId,name:e.name,filter:e.filter,sort:e.sort,tags:e.tags,settings:e.settings},a=await this.mondayApi.request(Nm,t);return a.create_view_table?{content:`Table view "${a.create_view_table.name}" (ID: ${a.create_view_table.id}, type: ${a.create_view_table.type}) successfully created`}:{content:"Failed to create table view - no response from API"}}},class extends ce{constructor(){super(...arguments),this.name="update_view_table",this.type=f.WRITE,this.annotations=le({title:"Update Table View",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return`Update an existing table-type board view — change its name, filters, sort, tags, or table-specific settings (column visibility/order and group-by). Provide only the fields you want to change. Omitted fields are left unchanged.\n\n[REQUIRED PRECONDITION]: Call get_board_info first — it returns the board views (so you can resolve the viewId, including from a view name the user mentioned) along with the column IDs, column types, and status label indexes that filters, sort, column_properties, column_order, and group_by reference. When the user named specific views, pass those names as get_board_info.filters.views.names to avoid fetching every view on large boards. If you pass filters, also use get_column_type_info with fetchMode "${cm.Guidelines}" and use data.guidelines.filter (null if that type has no documented rules) before sending them — do not guess compare_value/operator rules per column type.\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 settings.columns: { "column_properties": [{ "column_id": "status", "visible": true }], "column_order": ["name", "status", "date"] }\nExample settings.group_by: { "conditions": [{ "columnId": "status" }], "hideEmptyGroups": true }`}getInputSchema(){return Um}async executeInternal(e){const t={viewId:e.viewId,boardId:e.boardId,name:e.name,filter:e.filter,sort:e.sort,tags:e.tags,settings:e.settings},a=await this.mondayApi.request(Cm,t);return a.update_view_table?{content:`Table view "${a.update_view_table.name}" (ID: ${a.update_view_table.id}, type: ${a.update_view_table.type}) successfully updated`}:{content:"Failed to update table view - no response from API"}}},class extends ce{constructor(){super(...arguments),this.name="undo_action",this.type=f.WRITE,this.annotations=le({title:"Undo Action",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Undo a previous action on a board using its action_record_uuid. Supports undoing column changes, deletes, archives, moves, duplicates, and more. Use get_board_activity with includeData=true to find the action_record_uuid."}getInputSchema(){return ob}async executeInternal(e){return await this.mondayApi.request(ib,{boardId:e.boardId.toString(),undoRecordId:e.undoRecordId},{versionOverride:"dev"}),{content:`Successfully undid action "${e.undoRecordId}" on board ${e.boardId}.`}}},class extends ce{constructor(){super(...arguments),this.name="get_object_schemas",this.type=f.READ,this.annotations=le({title:"Get Object Schemas",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Retrieve account-level object schemas by their IDs or names. Schemas define the structure and columns of boards. Provide ids or names to filter specific schemas. Omit both to list all schemas (paginated). Call this FIRST to resolve schema ids, column ids, and the current revision before any tool that modifies an existing schema: update_object_schema (which requires the revision returned here), manage_object_schema_columns with action=update, set_object_schema_column_active_state, delete_object_schema_columns, delete_object_schema, and manage_object_schema_board_connection."}getInputSchema(){return Zc}async executeInternal(e){const t={ids:e.ids,names:e.names,limit:e.limit,page:e.page,excludeCreatedByMonday:e.excludeCreatedByMonday},a=(await this.mondayApi.request(Xc,t)).get_object_schemas??[];return{content:{message:`Retrieved ${a.length} object schema(s)`,schemas:a}}}},class extends ce{constructor(){super(...arguments),this.name="create_object_schema",this.type=f.WRITE,this.annotations=le({title:"Create Object Schema",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new account-level object schema. Schemas define the structure and columns of boards. If you are nesting this schema under an existing one, call get_object_schemas first to resolve parentId. This tool creates the schema only — add its columns afterwards with manage_object_schema_columns, and attach boards with manage_object_schema_board_connection."}getInputSchema(){return tm}async executeInternal(e){const t={name:e.name,parentId:e.parentId,description:e.description},a=await this.mondayApi.request(em,t);return{content:{message:`Object schema "${a.create_object_schema?.name}" successfully created`,schema_id:a.create_object_schema?.id,schema_name:a.create_object_schema?.name,revision:a.create_object_schema?.revision}}}},class extends ce{constructor(){super(...arguments),this.name="update_object_schema",this.type=f.WRITE,this.annotations=le({title:"Update Object Schema",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Update an account-level object schema. Requires the current revision number for optimistic locking — retrieve it first via get_object_schemas."}getInputSchema(){return nm}async executeInternal(e){const t={id:e.id,revision:e.revision,parentId:e.parentId,description:e.description},a=await this.mondayApi.request(am,t);return{content:{message:`Object schema "${a.update_object_schema?.name}" successfully updated`,schema_id:a.update_object_schema?.id,schema_name:a.update_object_schema?.name,revision:a.update_object_schema?.revision}}}},class extends ce{constructor(){super(...arguments),this.name="delete_object_schema",this.type=f.WRITE,this.annotations=le({title:"Delete Object Schema",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an account-level object schema. Only allowed when no boards are connected to the schema. Provide either id or name."}getInputSchema(){return om}async executeInternal(e){if(!e.id&&!e.name)throw new Error("Either id or name must be provided");const t={id:e.id,name:e.name},a=await this.mondayApi.request(im,t);return{content:{message:`Object schema "${a.delete_object_schema?.name}" successfully deleted`,schema_id:a.delete_object_schema?.id,schema_name:a.delete_object_schema?.name}}}},class extends ce{constructor(){super(...arguments),this.name="delete_object_schema_columns",this.type=f.WRITE,this.annotations=le({title:"Delete Object Schema Columns",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Permanently delete columns from an account-level object schema. Only allowed when no boards are connected to the schema. Use manage_object_schema_column with action=deactivate for a reversible alternative. [REQUIRED PRECONDITION]: Call get_object_schemas first to resolve the schema id and the exact column ids — this deletion is irreversible, so never guess ids."}getInputSchema(){return sm}async executeInternal(e){if(!e.objectSchemaId&&!e.objectSchemaName)throw new Error("Either objectSchemaId or objectSchemaName must be provided");const t={objectSchemaId:e.objectSchemaId,objectSchemaName:e.objectSchemaName,columnIds:e.columnIds},a=await this.mondayApi.request(rm,t,{versionOverride:"dev"});return{content:{message:`${e.columnIds.length} column(s) successfully deleted from object schema "${a.delete_object_schema_columns?.name}"`,schema_id:a.delete_object_schema_columns?.id,schema_name:a.delete_object_schema_columns?.name,revision:a.delete_object_schema_columns?.revision}}}},class extends ce{constructor(){super(...arguments),this.name="manage_object_schema_board_connection",this.type=f.WRITE,this.annotations=le({title:"Manage Object Schema Board Connection",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Connect or detach a board from an account-level object schema. connect: attaches a board to an object schema so it inherits the schema column structure. detach: removes one or more boards from their object schema."}getInputSchema(){return lm}async executeInternal(e){if("connect"===e.action){if(!e.boardId)throw new Error("boardId is required for action=connect");if(!e.objectSchemaId&&!e.objectSchemaName)throw new Error("Either objectSchemaId or objectSchemaName must be provided for action=connect");const t={boardId:e.boardId,objectSchemaId:e.objectSchemaId,objectSchemaName:e.objectSchemaName},a=await this.mondayApi.request(dm,t);return{content:{message:"Board successfully connected to object schema",connection_id:a.connect_board_to_object_schema?.id,schema_id:a.connect_board_to_object_schema?.object_schema_id}}}{if(!e.boardIds?.length)throw new Error("boardIds is required for action=detach");const t={boardIds:e.boardIds},a=(await this.mondayApi.request(pm,t)).detach_boards_from_object_schema??[],n=a.filter((e=>e.success)).length,i=a.filter((e=>!e.success));return{content:{message:`${n} board(s) successfully detached`,results:a,...i.length>0&&{failures:i}}}}}},class extends ce{constructor(){super(...arguments),this.name="manage_object_schema_columns",this.type=f.WRITE,this.annotations=le({title:"Manage Object Schema Columns",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return`Create or update columns on an account-level object schema. Column changes are propagated to all boards connected to the schema. create: adds new columns. Each column requires type and title. Call get_column_type_info with fetchMode "${cm.Schema}" first to understand valid defaults per column type. update: modifies existing columns. Each entry must include column_id — call get_object_schemas first to resolve the schema id and the exact column ids. Only send the columns you want to modify — other columns are unaffected. Use opt_out_by_default=true to stop a column from being auto-added to boards (opt out), or opt_out_by_default=false to restore auto-adding (opt in).`}getInputSchema(){return gm}async executeInternal(e){if(!e.objectSchemaId&&!e.objectSchemaName)throw new Error("Either objectSchemaId or objectSchemaName must be provided");if("create"===e.action){const t=e.columns.map((e=>{const t=e;return{type:t.type,title:t.title,description:t.description,defaults:t.defaults,opt_out_by_default:t.opt_out_by_default,policy:{can_override:t.policy?.can_override??[],cannot_delete:t.policy?.cannot_delete??!1}}})),a={objectSchemaId:e.objectSchemaId,objectSchemaName:e.objectSchemaName,columns:t},n=await this.mondayApi.request(mm,a);return{content:{message:`Columns successfully added to object schema "${n.create_object_schema_columns?.name}"`,schema_id:n.create_object_schema_columns?.id,schema_name:n.create_object_schema_columns?.name,revision:n.create_object_schema_columns?.revision}}}{const t={objectSchemaId:e.objectSchemaId,objectSchemaName:e.objectSchemaName,columns:e.columns.map((e=>{const t=e;return{column_id:t.column_id,title:t.title,description:t.description,defaults:t.defaults,opt_out_by_default:t.opt_out_by_default,policy:t.policy?{can_override:t.policy.can_override??[],cannot_delete:t.policy.cannot_delete??!1}:void 0}}))},a=await this.mondayApi.request(um,t);return{content:{message:`Columns successfully updated on object schema "${a.update_object_schema_columns?.name}"`,schema_id:a.update_object_schema_columns?.id,schema_name:a.update_object_schema_columns?.name,revision:a.update_object_schema_columns?.revision}}}}},class extends ce{constructor(){super(...arguments),this.name="set_object_schema_column_active_state",this.type=f.WRITE,this.annotations=le({title:"Set Object Schema Column Active State",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Set the active state of a column on an account-level object schema. [REQUIRED PRECONDITION]: Call get_object_schemas first to resolve the schema id, the column id, and its current active state. deactivate: soft-disables the column, preventing it from being used on new boards. The column is not deleted and can be restored. reactivate: restores a previously deactivated column, making it available again."}getInputSchema(){return ym}async executeInternal(e){if(!e.objectSchemaId&&!e.objectSchemaName)throw new Error("Either objectSchemaId or objectSchemaName must be provided");const t={deactivate:qo.Deactivate,reactivate:qo.Reactivate},a={objectSchemaId:e.objectSchemaId,objectSchemaName:e.objectSchemaName,columnId:e.columnId,action:t[e.action]},n=await this.mondayApi.request(bm,a);return{content:{message:`Column successfully ${e.action}d on object schema "${n.set_object_schema_column_active_state?.name}"`,schema_id:n.set_object_schema_column_active_state?.id,schema_name:n.set_object_schema_column_active_state?.name,revision:n.set_object_schema_column_active_state?.revision}}}},class extends ce{constructor(){super(...arguments),this.name="get_asset_upload_url",this.type=f.WRITE,this.annotations=le({title:"Get Asset Upload URL",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Get a presigned URL to upload a file to monday.com. Returns an upload_id and upload_url.\n\nOnly call this tool if you can execute a direct HTTP PUT with binary file data and read response headers (e.g. via shell/curl). If you can\'t, tell the user direct file upload isn\'t supported here — don\'t call this tool.\n\nAfter calling this tool, upload the file to the returned URL using an HTTP PUT request and capture the ETag header from the response:\n\ncurl -i -X PUT "<upload_url>" \\\n -H "Content-Type: <the contentType you provided>" \\\n --data-binary @<local_file_path>\n\nThe response includes an ETag header (e.g. ETag: "abc123...") — save this value.\n\nThen call finalize_asset_upload with the upload_id, etag, board_id, item_id, and column_id to complete the upload and attach the file to an item\'s file column.\n\nMax file size: 500MB.'}getInputSchema(){return sb}async executeInternal(e){const t=(await this.mondayApi.request(rb,{input:{file_name:e.fileName,content_type:e.contentType,file_size:e.fileSize,source:"mcp",multipart:!1}},{versionOverride:"dev"})).create_upload,a=t.parts[0]?.url;if(!a)throw new Error("create_upload returned no upload URL — parts array was empty");return{content:{upload_id:t.upload_id,upload_url:a,url_expires_at:t.expires_at}}}},class extends ce{constructor(){super(...arguments),this.name="finalize_asset_upload",this.type=f.WRITE,this.annotations=le({title:"Finalize Asset Upload",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Finalize a file upload and create the asset on monday.com. Call this after uploading the file to the presigned URL from get_asset_upload_url. Requires the etag value from the PUT response headers. Automatically attaches the uploaded asset to the specified file column on the item. Returns the created asset_id."}getInputSchema(){return lb}async executeInternal(e){const t=(await this.mondayApi.request(db,{input:{upload_id:e.uploadId,holder:{type:"ITEM",id:e.itemId},board_id:e.boardId,parts:[{part_number:1,etag:e.etag}]}},{versionOverride:"dev"})).complete_upload,a=JSON.stringify({added_file:{fileType:"ASSET",name:t.filename,assetId:String(t.id)}});return await this.mondayApi.request(pb,{boardId:e.boardId,itemId:e.itemId,columnId:e.columnId,value:a}),{content:{asset_id:t.id,filename:t.filename,content_type:t.content_type,file_size:t.file_size,url:t.url,filelink:t.filelink}}}},class extends ce{constructor(){super(...arguments),this.name="link_board_items_workflow",this.type=f.READ,this.annotations=le({title:"Link Board Items Workflow",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Get the required playbook for linking items across boards via board-relation columns. When to use: any board-relation / cross-board linking task. **Hard gate — you MUST call this BEFORE get_board_items_page, or change_item_column_values in the same turn. No discovery, matching, or write happens first.** Triggers: **link** or **connect** items **across boards** (board-relation / "connect boards" / pairs) — also vague phrasings where only one side is named ("link this to **an** item on another board", "**the matching** row"). This tool is read-only (no API).'}getInputSchema(){return mb}async executeInternal(e){return{content:cb}}},class extends ce{constructor(){super(...arguments),this.name="fetch_file_content",this.type=f.READ,this.annotations=le({title:"Fetch File Content",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Fetch and extract the text content from a file stored in a monday.com files column.\n\nUse this tool when you need to read, summarize, or analyze the content of files attached to board items. Provide the item ID and column ID from the get_board_items_page response — the column value will be a URL like \"https://monday.com/protected_static/...\" indicating a file is present (null means no file).\n\nPROACTIVE USE: If you retrieve board items and notice a files column with a non-null value (a URL), consider fetching its content if it could help answer the user's question — don't wait to be explicitly asked.\n\nSupported file types and what is returned:\n- Text files (.txt, .md, .csv, .json): raw text content\n- Word documents (.docx): extracted text content\n- PDF files (.pdf): extracted text content\n- Excel files (.xlsx, .xls): extracted text content per sheet\n- Images (.png, .jpg, .gif, .webp, .svg, .bmp, .ico): returns the public URL so you can view or analyze the image directly\n\nText responses include a total_length field. If has_more is true, the content was truncated — you can call this tool again with next_offset if you need the remaining content.\n\nWhen to use:\n- User asks to summarize, read, or analyze the content of a file in a files column\n- User asks questions about what is inside a file (e.g., \"what does the PDF say?\")\n- User wants to extract data from a CSV or Excel file attached to a board item\n- A board item has a files column with a non-null value and the user's question may be answered by its content — even if the user didn't explicitly ask to read the file\n\nWhen NOT to use:\n- The files column value is null (no file uploaded for that item)"}getInputSchema(){return Eb}async executeInternal(e){const{item_id:t,column_id:a,file_name:n,offset:i=0}=e,o=await this.mondayApi.request(ub,{itemId:[t],columnId:[a]}),r=o?.items?.[0]?.assets;if(!r||0===r.length)return{content:{message:`No file found for item ${t} in column ${a}. The column may be empty or the column ID may be incorrect.`}};return{content:{files:await Promise.all(r.map((e=>Ab(e,i,n))))}}}},class extends ce{constructor(){super(...arguments),this.name="manage_agent",this.type=f.WRITE,this.annotations=le({title:"Manage monday Platform Agent",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return'Full lifecycle management for monday platform agents — create, read, update, delete, change state, and run.\n\nmonday platform agents are user-built work orchestrators on monday.com — each has a profile (name, role, avatar), a goal, and a markdown execution plan. Agents in state ACTIVE can be triggered automatically. They are NOT local LangChain or MCP agents.\n\nACTIONS (only pass fields that apply to the chosen action):\n- create: { action:"create", prompt, agent_model? } — AI-generated agent. Platform creates profile, goal, and plan from the prompt.\n- create_blank: { action:"create_blank", name?, role?, role_description?, avatar_url?, gender?, background_color?, user_prompt? } — manually defined agent.\n- get one: { action:"get", agent_id }\n- list owned: { action:"get" }\n- update: { action:"update", agent_id, name?, role?, role_description?, plan?, agent_model? }\n- delete: { action:"delete", agent_id }\n- activate: { action:"activate", agent_id }\n- deactivate: { action:"deactivate", agent_id }\n- run: { action:"run", agent_id }\n\nRULES:\n- "create_blank" with no fields creates a nameless blank agent — only do this intentionally.\n- "update" requires at least one of name/role/role_description/plan/agent_model.\n- "update", "delete", "activate", "deactivate", "run" all require "agent_id".\n- Created agents start INACTIVE. Follow with action:"activate" using the returned agent_id before they can be triggered.\n- ⚠️ DESTRUCTIVE — "delete" is permanent and irreversible. When the user refers to an agent by name, ALWAYS call action:"get" first to confirm the correct agent_id before deleting.\n- "run" is fire-and-forget. Returns trigger_uuid — no run-status query exists, treat successful enqueue as the only signal.\n- Agent state is one of ACTIVE, INACTIVE, ARCHIVED, or FAILED. DELETED only appears as the return value of action:"delete".\n\nUSAGE EXAMPLES:\n- AI create: { "action": "create", "prompt": "Run my daily standup every weekday at 9am." }\n- Manual create:{ "action": "create_blank", "name": "Standup Bot", "role": "Project Manager", "gender": "female" }\n- Fetch one: { "action": "get", "agent_id": "42" }\n- List mine: { "action": "get" }\n- Rename: { "action": "update", "agent_id": "7", "name": "New Name" }\n- Activate: { "action": "activate", "agent_id": "7" }\n- Deactivate: { "action": "deactivate", "agent_id": "7" }\n- Run: { "action": "run", "agent_id": "7" }\n- Delete: { "action": "delete", "agent_id": "7" }\n\nRELATED TOOLS:\n- agent_catalog — browse available trigger types and skills before wiring them to an agent\n- manage_agent_triggers — manage which triggers fire this agent automatically\n- manage_agent_skills — manage which skills this agent can perform\n- manage_agent_knowledge — manage which boards/docs this agent has access to'}getInputSchema(){return jw}async executeInternal(e){switch(e.action){case"create":return this.handleCreate(e);case"create_blank":return this.handleCreateBlank(e);case"get":return this.handleGet(e);case"update":return this.handleUpdate(e);case"delete":return this.handleDelete(e);case"activate":return this.handleActivate(e);case"deactivate":return this.handleDeactivate(e);case"run":return this.handleRun(e)}}async handleCreate(e){if(!e.prompt)throw new Error('manage_agent action:"create" requires "prompt". For a manually configured agent, use action:"create_blank".');try{const t={input:{prompt:e.prompt,agent_model:e.agent_model}},a=await this.mondayApi.request(Ow,t,{versionOverride:"dev"});if(!a.create_agent?.id)throw new Error("monday platform agent creation returned no id");return{content:{message:`monday platform agent ${a.create_agent.id} created in state INACTIVE — call manage_agent with action:"activate" and agent_id:"${a.create_agent.id}" to activate it`,agent:a.create_agent}}}catch(e){Uc(e,"create monday platform agent")}}async handleCreateBlank(e){try{const t={};void 0!==e.name&&(t.name=e.name),void 0!==e.role&&(t.role=e.role),void 0!==e.role_description&&(t.role_description=e.role_description),void 0!==e.avatar_url&&(t.avatar_url=e.avatar_url),void 0!==e.gender&&(t.gender=e.gender),void 0!==e.background_color&&(t.background_color=e.background_color),void 0!==e.user_prompt&&(t.user_prompt=e.user_prompt);const a={input:t},n=await this.mondayApi.request(Rw,a,{versionOverride:"dev"});if(!n.create_blank_agent?.id)throw new Error("monday platform agent creation returned no id");return{content:{message:`monday platform agent ${n.create_blank_agent.id} created in state INACTIVE — call manage_agent with action:"activate" and agent_id:"${n.create_blank_agent.id}" to activate it`,agent:n.create_blank_agent}}}catch(e){Uc(e,"create blank monday platform agent")}}async handleGet(e){if(void 0!==e.agent_id)try{const{custom_agents:t}=await this.mondayApi.request(Dw,{ids:[e.agent_id]},{versionOverride:"dev"}),a=t?.[0];return a?{content:{message:"monday platform agent",agent:a}}:{content:`monday platform agent ${e.agent_id} not found, or the authenticated user does not have access to it.`}}catch(e){Uc(e,"get monday platform agent")}try{const{custom_agents:e}=await this.mondayApi.request(Dw,{limit:100},{versionOverride:"dev"}),t=e??[];return{content:{message:"monday platform agents owned by the authenticated user (limited to 100 — ask the user if they need more)",count:t.length,agents:t}}}catch(e){Uc(e,"list monday platform agents")}}async handleUpdate(e){if(!e.agent_id)throw new Error('manage_agent action:"update" requires "agent_id".');try{const t={};if(void 0!==e.name&&(t.name=e.name),void 0!==e.role&&(t.role=e.role),void 0!==e.role_description&&(t.role_description=e.role_description),void 0!==e.plan&&(t.plan=e.plan),void 0!==e.agent_model&&(t.agent_model=e.agent_model),0===Object.keys(t).length)throw new Error('manage_agent action:"update" requires at least one of: name, role, role_description, plan, agent_model.');const a={id:e.agent_id,input:t},n=await this.mondayApi.request(Cw,a,{versionOverride:"dev"});if(!n.update_agent)throw new Error("update_agent returned no data — the agent may not exist");return{content:{message:"monday platform agent updated",agent:n.update_agent}}}catch(e){Uc(e,"update monday platform agent")}}async handleDelete(e){if(!e.agent_id)throw new Error('manage_agent action:"delete" requires "agent_id".');try{const t={id:e.agent_id},a=await this.mondayApi.request(kw,t,{versionOverride:"dev"});if(!a.delete_agent?.id)throw new Error("monday platform agent delete returned no id");return{content:{message:`monday platform agent ${a.delete_agent.id} deleted`,agent:a.delete_agent}}}catch(e){Uc(e,"delete monday platform agent")}}async handleActivate(e){if(!e.agent_id)throw new Error('manage_agent action:"activate" requires "agent_id".');try{const t=await this.mondayApi.request(Lw,{id:e.agent_id},{versionOverride:"dev"});return{content:{message:"Agent activated.",success:t.activate_agent?.success??!1}}}catch(e){Uc(e,"activate monday platform agent")}}async handleDeactivate(e){if(!e.agent_id)throw new Error('manage_agent action:"deactivate" requires "agent_id".');try{const t={id:e.agent_id,inactive_reason:DI.DeactivatedByUser},a=await this.mondayApi.request(Uw,t,{versionOverride:"dev"});return{content:{message:"Agent deactivated.",success:a.deactivate_agent?.success??!1}}}catch(e){Uc(e,"deactivate monday platform agent")}}async handleRun(e){if(!e.agent_id)throw new Error('manage_agent action:"run" requires "agent_id".');try{const t=await this.mondayApi.request(Pw,{id:e.agent_id},{versionOverride:"dev"});if(!t.run_agent)throw new Error("run_agent returned no data — the agent run may not have been enqueued");return{content:{message:"Agent run enqueued.",trigger_uuid:t.run_agent.trigger_uuid}}}catch(e){Uc(e,"run monday platform agent")}}},class extends ce{constructor(){super(...arguments),this.name="manage_agent_triggers",this.type=f.WRITE,this.annotations=le({title:"Manage monday Platform Agent Triggers",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Manage the triggers attached to a monday platform agent — triggers define WHEN the agent runs automatically.\n\nACTIONS:\n- list: { agent_id } — returns active triggers with node_id, block_reference_id, name, field_summary.\n- add: { agent_id, block_reference_id, field_values? } — attaches a trigger type to the agent.\n- remove: { agent_id, node_id } — detaches a trigger instance by node_id (NOT block_reference_id).\n\nWORKFLOW — add a trigger:\n1. Call agent_catalog action:"list_triggers" — note block_reference_id, field_schemas, and required_fields.\n2. Collect required field values from the user (e.g. board_id, column_id).\n3. Call this tool action:"add" with block_reference_id and field_values.\nNote: add returns only { success } — no node_id for the new instance. Call action:"list" afterward if you need the node_id.\n\nWORKFLOW — remove a trigger:\n1. Call action:"list" to see active triggers and note the node_id of the instance to remove.\n2. Call action:"remove" with that node_id.\n\nNOTE: Only triggers that can be added programmatically appear in the catalog. OAuth/3rd-party triggers (Slack, Gmail, Salesforce, etc.)\nrequire user setup in the monday.com UI — they will not appear in agent_catalog and cannot be managed here.\n\nUSAGE EXAMPLES:\n- List triggers: { "action": "list", "agent_id": "7" }\n- Add trigger: { "action": "add", "agent_id": "7", "block_reference_id": "status-change-ref", "field_values": { "board_id": "42" } }\n- Remove trigger: { "action": "remove", "agent_id": "7", "node_id": "node-abc" }\n\nRELATED TOOLS:\n- agent_catalog action:"list_triggers" — discover available trigger types and their required field_values before calling action:"add" here\n- manage_agent_skills — manage which skills this agent can perform\n- manage_agent — manage the agent entity itself (create, activate, deactivate, etc.)'}getInputSchema(){return Gw}async executeInternal(e){switch(e.action){case"list":return this.handleList(e);case"add":return this.handleAdd(e);case"remove":return this.handleRemove(e)}}async handleList(e){try{const t={agent_id:e.agent_id},a=(await this.mondayApi.request($w,t,{versionOverride:"dev"})).agent_active_triggers??[];return{content:{message:'Active triggers on this agent. Use node_id with action:"remove" to detach a trigger.',count:a.length,triggers:a}}}catch(e){Uc(e,"list active triggers for monday platform agent")}}async handleAdd(e){if(!e.block_reference_id)throw new Error('block_reference_id is required for action:"add". Call agent_catalog action:"list_triggers" first to find the block_reference_id.');try{const t={agent_id:e.agent_id,block_reference_id:e.block_reference_id,field_values:e.field_values},a=await this.mondayApi.request(xw,t,{versionOverride:"dev"});return{content:{message:'Trigger added to agent. Call action:"list" to verify and retrieve the node_id.',success:a.add_trigger_to_agent?.success??!1}}}catch(e){Uc(e,"add trigger to monday platform agent")}}async handleRemove(e){if(!e.node_id)throw new Error('node_id is required for action:"remove". Call action:"list" first to get node_id values.');try{const t={agent_id:e.agent_id,node_id:e.node_id},a=await this.mondayApi.request(Mw,t,{versionOverride:"dev"});return{content:{message:"Trigger removed from agent.",success:a.remove_trigger_from_agent?.success??!1}}}catch(e){Uc(e,"remove trigger from monday platform agent")}}},class extends ce{constructor(){super(...arguments),this.name="manage_agent_skills",this.type=f.WRITE,this.annotations=le({title:"Manage monday Platform Agent Skills",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Manage the full skill lifecycle for monday platform agents — create new skills in the catalog, attach skills to an agent, or detach them.\n\nSkills extend what an agent can do (e.g. sending emails, querying databases, posting to Slack).\n\nACTIONS:\n- create: { name, content, description? } — creates a new custom skill in the account-wide catalog.\n The skill becomes available to all agents in the account.\n- add: { agent_id, skill_id } — attaches a skill to this agent.\n- remove: { agent_id, skill_id } — detaches a skill from this agent.\n\nWORKFLOW — attach an existing skill:\n1. Call agent_catalog action:"list_skills" — find the skill_id of the skill to attach.\n2. Call this tool action:"add" with agent_id and that skill_id.\n\nWORKFLOW — create a new skill and attach it:\n1. Call this tool action:"create" with name and content — note the returned id.\n2. Call this tool action:"add" with agent_id and that id directly (no catalog lookup needed).\n\nNOTE: There is no action to list which skills are currently attached to a specific agent — the platform does not yet expose that query.\nTo browse all skills available in the account catalog, use agent_catalog action:"list_skills".\n\nUSAGE EXAMPLES:\n- Create a skill: { "action": "create", "name": "Send Slack Message", "content": "## Instructions\\nPost a message to a Slack channel.", "description": "Sends a message to Slack" }\n- Add a skill: { "action": "add", "agent_id": "7", "skill_id": "skill-abc-123" }\n- Remove a skill: { "action": "remove", "agent_id": "7", "skill_id": "skill-abc-123" }\n\nRELATED TOOLS:\n- agent_catalog action:"list_skills" — browse existing skills to find a skill_id before calling action:"add"\n- manage_agent_triggers — manage which triggers fire this agent automatically\n- manage_agent — manage the agent entity itself (create, activate, deactivate, etc.)'}getInputSchema(){return Hw}async executeInternal(e){switch(e.action){case"create":return this.handleCreate(e);case"add":return this.handleAdd(e);case"remove":return this.handleRemove(e)}}async handleCreate(e){if(!e.name||!e.content)throw new Error('action:"create" requires both "name" and "content".');try{const t={name:e.name,content:e.content,description:e.description},a=await this.mondayApi.request(qw,t,{versionOverride:"dev"});if(!a.create_agent_skill)throw new Error("create_agent_skill returned no data");return{content:{message:'Skill created and added to the account catalog. Use the returned id with action:"add" to attach it to an agent.',skill:a.create_agent_skill}}}catch(e){Uc(e,"create monday platform agent skill")}}async handleAdd(e){if(!e.agent_id)throw new Error('agent_id is required for action:"add".');if(!e.skill_id)throw new Error('skill_id is required for action:"add". Get it from agent_catalog action:"list_skills" or from action:"create" in this tool.');try{const t={agent_id:e.agent_id,skill_id:e.skill_id},a=await this.mondayApi.request(Vw,t,{versionOverride:"dev"});return{content:{message:"Skill added to agent.",success:a.add_skill_to_agent?.success??!1}}}catch(e){Uc(e,"add skill to monday platform agent")}}async handleRemove(e){if(!e.agent_id)throw new Error('agent_id is required for action:"remove".');if(!e.skill_id)throw new Error('skill_id is required for action:"remove".');try{const t={agent_id:e.agent_id,skill_id:e.skill_id},a=await this.mondayApi.request(Fw,t,{versionOverride:"dev"});return{content:{message:"Skill removed from agent.",success:a.remove_skill_from_agent?.success??!1}}}catch(e){Uc(e,"remove skill from monday platform agent")}}},class extends ce{constructor(){super(...arguments),this.name="manage_agent_knowledge",this.type=f.WRITE,this.annotations=le({title:"Manage monday Platform Agent Knowledge",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'List, grant, update, or revoke a monday platform agent\'s access to boards and docs.\n\nAn agent\'s "knowledge" is the set of monday.com boards and docs it can read from or write to during a run.\n\n- list: Returns all resources the agent currently has access to, including permission level and resource type.\n- add: Grants the agent access to a board or doc with the specified permission level.\n- update: Changes the permission level on a resource the agent already has access to. Call action:"list" first to confirm the resource_id exists.\n- remove: Revokes the agent\'s access to a board or doc entirely. Call action:"list" first to confirm the resource_id exists.\n\nPermission types:\n- READ: Agent can read data from the resource.\n- READ_WRITE: Agent can read and write data to the resource.\n\nUSAGE EXAMPLES:\n- List: { "action": "list", "agent_id": "7" }\n- Add board access: { "action": "add", "agent_id": "7", "resource_id": "42", "scope_type": "BOARD", "permission_type": "READ" }\n- Update to read-write: { "action": "update", "agent_id": "7", "resource_id": "42", "scope_type": "BOARD", "permission_type": "READ_WRITE" }\n- Remove access: { "action": "remove", "agent_id": "7", "resource_id": "42", "scope_type": "BOARD" }\n\nRELATED TOOLS:\n- manage_agent — manage the agent entity itself (create, activate, deactivate, etc.)\n- manage_agent_triggers — manage which triggers fire this agent automatically\n- manage_agent_skills — manage which skills this agent can perform'}getInputSchema(){return Jw}async executeInternal(e){switch(e.action){case"list":return this.handleList(e);case"add":return this.handleAdd(e);case"update":return this.handleUpdate(e);case"remove":return this.handleRemove(e)}}async handleList(e){try{const t=(await this.mondayApi.request(Ww,{id:e.agent_id},{versionOverride:"dev"})).agent_knowledge??{resources:[],files:[]};return{content:{message:"Current agent resource access.",count:t.resources?.length??0,knowledge:t}}}catch(e){Uc(e,"list agent knowledge for monday platform agent")}}async handleAdd(e){if(!e.resource_id||!e.scope_type||!e.permission_type)throw new Error("resource_id, scope_type, and permission_type are required for action:add");try{const t=await this.mondayApi.request(Yw,{id:e.agent_id,resource_id:e.resource_id,scope_type:e.scope_type,permission_type:e.permission_type},{versionOverride:"dev"});return{content:{message:"Resource access granted to agent.",success:t.add_agent_resource_access?.success??!1}}}catch(e){Uc(e,"add agent resource access for monday platform agent")}}async handleUpdate(e){if(!e.resource_id||!e.scope_type||!e.permission_type)throw new Error("resource_id, scope_type, and permission_type are required for action:update");try{const t=await this.mondayApi.request(Qw,{id:e.agent_id,resource_id:e.resource_id,scope_type:e.scope_type,permission_type:e.permission_type},{versionOverride:"dev"});return{content:{message:"Resource access updated.",success:t.update_agent_resource_access?.success??!1}}}catch(e){Uc(e,"update agent resource access for monday platform agent")}}async handleRemove(e){if(!e.resource_id||!e.scope_type)throw new Error("resource_id and scope_type are required for action:remove");try{const t=await this.mondayApi.request(Kw,{id:e.agent_id,resource_id:e.resource_id,scope_type:e.scope_type},{versionOverride:"dev"});return{content:{message:"Resource access removed from agent.",success:t.remove_agent_resource_access?.success??!1}}}catch(e){Uc(e,"remove agent resource access for monday platform agent")}}},class extends ce{constructor(){super(...arguments),this.name="agent_catalog",this.type=f.READ,this.annotations=le({title:"monday Platform Agent Catalog",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Browse the account-wide catalog of available trigger types and skills for monday platform agents. READ-ONLY — no agent_id required.\n\nUse this tool to discover what\'s available BEFORE wiring anything to a specific agent.\n\nACTIONS:\n- list_triggers: { block_reference_ids? } — returns available trigger types.\n Each entry has block_reference_id (required for manage_agent_triggers action:"add"), name, description,\n field_schemas (describes field_values shape), and required_fields (fields to collect from the user).\n Note: only triggers that can be added programmatically appear here. OAuth/3rd-party triggers (Slack, Gmail, Salesforce, etc.)\n require user setup in the monday.com UI and will not appear here.\n\n- list_skills: {} — returns available skills with id, name, description.\n Never guess or invent a skill id — always look it up here before calling manage_agent_skills action:"add".\n\nUSAGE EXAMPLES:\n- List all trigger types: { "action": "list_triggers" }\n- Fetch specific trigger: { "action": "list_triggers", "block_reference_ids": ["some-block-ref-id"] }\n- List all skills: { "action": "list_skills" }\n\nRELATED TOOLS:\n- manage_agent_triggers — use block_reference_id from list_triggers to attach a trigger to a specific agent\n- manage_agent_skills — use skill id from list_skills, or action:"create" to author a new skill, then attach to an agent\n- manage_agent — manage the agent entity itself (create, update, delete, activate, etc.)'}getInputSchema(){return Xw}async executeInternal(e){switch(e.action){case"list_triggers":return this.handleListTriggers(e);case"list_skills":return this.handleListSkills()}}async handleListTriggers(e){try{const t={block_reference_ids:e.block_reference_ids},a=(await this.mondayApi.request(Bw,t,{versionOverride:"dev"})).agent_triggers_catalog??[];return{content:{message:'Available trigger types. Use block_reference_id and inspect field_schemas/required_fields before calling manage_agent_triggers action:"add".',count:a.length,triggers:a}}}catch(e){Uc(e,"fetch monday platform agent triggers catalog")}}async handleListSkills(){try{const e=(await this.mondayApi.request(zw,{},{versionOverride:"dev"})).agent_skills_catalog??[];return{content:{message:'Available skills. Use id when calling manage_agent_skills action:"add".',count:e.length,skills:e}}}catch(e){Uc(e,"fetch monday platform agent skills catalog")}}},class extends ce{constructor(){super(...arguments),this.name="list_automations",this.type=f.READ,this.annotations=le({title:"List Board Automations",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'List all automations on a specific monday.com board, including their ids, titles, active state, and configuration.\nReturns two groups: "workflows" (fully manageable, supports pagination via limit/cursor) and "legacyAutomations" (READ-ONLY automations set up in an older way — returned on the first page only, when no cursor is given).\nAlways present BOTH groups to the user together as one list of board automations — never omit or hide "legacyAutomations". The split and the read-only limitation are internal context for you only: don\'t volunteer them and don\'t label any automation "legacy" or "read-only". Only if the user asks to act on a legacy one, briefly explain it can\'t be changed (e.g. "This one was set up in an older way and can\'t be modified here").\nCall this FIRST before manage_automations — it is the only way to resolve an automation id from a name or description. Never guess an automation id.\nWhen NOT to use: Do not call this tool to get general board information unrelated to automations.\n'}getInputSchema(){return aA}async executeInternal(e){try{const a=!e.cursor,n={boardIds:[e.boardId],limit:e.limit??100,includeLegacy:a,...e.cursor?{cursor:e.cursor}:{}},i=await this.mondayApi.request(Zw,n),o=(i.board_automations?.items??[]).map(tA),r=i.board_automations?.cursor??null,s=a?(t=i.board_automations?.legacy_automations,null==t||"object"==typeof t&&"error"in t?null:t):null;return{content:{message:`Found ${o.length} live workflow(s) on board ${e.boardId}`,workflows:o,...null!=s?{legacyAutomations:s}:{},pagination:{nextCursor:r,hasMore:null!==r}}}}catch(e){Uc(e,"list live workflows")}var t}},class extends ce{constructor(){super(...arguments),this.name="manage_automations",this.type=f.WRITE,this.annotations=le({title:"Manage Automations",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return'Activate, deactivate, or delete an existing monday.com automation.\n\nRequires an automation id. When the user refers to an automation by name, always call list_automations first to resolve the id — never guess or infer ids.\n\nActions:\n- activate: enables a paused automation so it starts responding to its trigger.\n- deactivate: pauses an automation while preserving its definition.\n- delete: permanently removes an automation — irreversible.\n\nWhen intent is ambiguous ("stop", "turn off", "pause"), prefer deactivate over delete.'}getInputSchema(){return rA}async executeInternal(e){const t=e;switch(t.action){case"activate":return this.activateWorkflow(t);case"deactivate":return this.deactivateWorkflow(t);case"delete":return this.deleteWorkflow(t)}}async activateWorkflow(e){try{const t={id:e.workflowId},a=await this.mondayApi.request(nA,t,{versionOverride:"dev"});if(!a.activate_live_workflow?.is_success)throw new Error(`Workflow ${e.workflowId} activation did not report success`);return{content:{message:`Workflow ${e.workflowId} activated`,workflowId:e.workflowId,isActive:!0}}}catch(e){Uc(e,"activate workflow")}}async deactivateWorkflow(e){try{const t={id:e.workflowId},a=await this.mondayApi.request(iA,t,{versionOverride:"dev"});if(!a.deactivate_live_workflow?.is_success)throw new Error(`Workflow ${e.workflowId} deactivation did not report success`);return{content:{message:`Workflow ${e.workflowId} deactivated`,workflowId:e.workflowId,isActive:!1}}}catch(e){Uc(e,"deactivate workflow")}}async deleteWorkflow(e){try{const t={id:e.workflowId},a=await this.mondayApi.request(oA,t,{versionOverride:"dev"});if(!a.delete_live_workflow?.is_success)throw new Error(`Workflow ${e.workflowId} deletion did not report success`);return{content:{message:`Workflow ${e.workflowId} deleted`,workflowId:e.workflowId}}}catch(e){Uc(e,"delete workflow")}}},class extends ce{constructor(e,t,a){super(e,a),this.apiToken=t,this.name="create_automation",this.type=f.WRITE,this.annotations=le({title:"Create Automation",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'\n Creates an automation on a monday board from a structured natural-language description.\n\nUse this tool only when you know:\n- boardId\n- the user\'s intended trigger\n- at least one intended action\n- any details the user provided that are relevant to the trigger, conditions, or actions\n\nThe caller does not need to know the exact available automation blocks or their required fields. Describe the user\'s intent clearly — the tool will translate that intent into supported blocks and values.\n\nIf a required detail is missing from the user\'s request, ask for clarification before calling the tool.\n\nIf the tool returns status: "needs_clarification", present the unresolved fields to the user, gather answers, then call the tool again.\n\nDescribe the automation in this format:\n\nTrigger:\n When <the event that should start the automation>\n Details:\n <relevant detail>: <value>\n\nConditions:\n - Only if <condition that should be true>\n Details:\n <relevant detail>: <value>\n\nActions:\n - <action the automation should perform>:\n <relevant detail>: <value>\n\nRules:\n- Use one trigger.\n- Conditions are optional.\n- Multiple conditions mean AND.\n- Use one or more actions.\n- Do not use branching.\n- Use natural language, not block IDs or internal field names.\n- Actions may reference values from the trigger context, such as "{{item name}}", "{{creator}}", "{{status}}", "{{group}}", or "{{board}}".\n\nTerminology:\n- Trigger: the event that starts the automation, such as "when a new item is created".\n- Conditions: optional requirements that must be true before actions run.\n- Actions: what the automation does when it runs.\n\nExample:\n\nTrigger:\n When a new item is created\n\nActions:\n - Send a notification:\n Recipient: John Snow\n Title: Important Update\n Message: The item "{{item name}}" was created.\n\n - Move the item to a group:\n Group: Top group\n'}getInputSchema(){return dA}async executeInternal(e){try{const a="function"==typeof this.apiToken?this.apiToken():this.apiToken,n=(t=this.context,t?.fetchConfig?.fetch??sA),i=await n({serviceName:"platform-agent",path:"/platform-ai-gateway/agents/lite-builder",method:"POST",headers:{...this.context?.fetchConfig?.fetch?{}:{Authorization:a},"Content-Type":"application/json"},body:JSON.stringify({userPrompt:e.userPrompt,boardId:e.boardId}),signal:AbortSignal.timeout(18e4)});if(!i.ok){const e=await i.text().catch((()=>""));throw new Lc(`lite-builder responded with HTTP ${i.status}${e?`: ${e}`:""}`,"UPSTREAM_HTTP_ERROR")}return{content:await i.json()}}catch(e){Uc(e,"create automation")}var t}},class extends ce{constructor(){super(...arguments),this.name="get_automation_runs",this.type=f.READ,this.annotations=le({title:"Get Automation Runs",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Read automation/workflow run history. Read-only.\n\nModes:\n- "history": paginated run feed (state, duration, error reason). Use "filters" to narrow results and "nextPageOffset" to page (offset-only — next page = previous offset + returned count).\n- "detail": single run by "triggerUuid" (required) — returns block steps and MCP tool calls. Set "includeToolEvents": false to skip tool calls.\n\nScope: provide "boardId" for a specific board or "accountWide": true. One is required.\n\nKnown event states: "success", "failure", "exhausted".'}getInputSchema(){return _A}async executeInternal(e){if(!e.boardId&&!e.accountWide)return{content:{message:'Either "boardId" or "accountWide": true must be provided.'}};try{return"detail"===e.mode?await this.runDetail(e):await this.runHistory(e)}catch(e){Uc(e,"get automation runs")}}async runHistory(e){const t=e.nextPageOffset??0,a={...e.filters??{},...e.boardId?{boardId:e.boardId}:{}},n=await this.mondayApi.request(lA,{nextPageOffset:t,filters:a}),i=n.trigger_events?.triggerEvents??[],o=function(e){return e.reduce(((e,t)=>{const a=t.eventState??"unknown";return e[a]=(e[a]??0)+1,e}),{})}(i),r=e.boardId?`board ${e.boardId}`:"account-wide";return{content:{message:`Returned ${i.length} run(s) (${r}) at offset ${t}. By state: ${function(e){const t=Object.entries(e).map((([e,t])=>`${e}=${t}`));return t.length?t.join(", "):"none"}(o)}. Offset-only pagination — for the next page request offset ${t+i.length}.`,scope:r,offset:t,count:i.length,stateCounts:o,runs:i}}}async runDetail(e){if(!e.triggerUuid)return{content:{message:'detail mode requires "triggerUuid".'}};const t=!1!==e.includeToolEvents,a=e.blockEventsOffset??0,n=e.toolEventsOffset??0,i=(await this.mondayApi.request(cA,{triggerUuid:e.triggerUuid})).trigger_event;if(!i)return{content:{message:`No run found for triggerUuid ${e.triggerUuid}.`,triggerUuid:e.triggerUuid,found:!1}};const[o,r]=await Promise.all([this.mondayApi.request(mA,{triggerUuid:e.triggerUuid,nextPageOffset:a}),t?this.mondayApi.request(uA,{triggerUuid:e.triggerUuid,nextPageOffset:n}):Promise.resolve(null)]),s=o.block_events?.blockEvents??[],d=r?.tool_events?.tool_events??[];return{content:{message:`Run ${e.triggerUuid}: state=${i.eventState??"unknown"}, ${s.length} block step(s), ${d.length} tool call(s).`,found:!0,run:i,blockEvents:s,blockEventsOffset:a,toolEvents:d,toolEventsOffset:n,toolEventsIncluded:t}}}},class extends ce{constructor(){super(...arguments),this.name="get_automation_statistics",this.type=f.READ,this.annotations=le({title:"Get Automation Statistics",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Aggregate automation run statistics. Read-only.\n\nBreakdowns:\n- "totals": success/failure/total counts at the account or board level.\n- "by_entity": per-automation and per-workflow counts for a given "runStatus" (required: "success" | "failure" | "exhausted"). Use "excludeAutomationIds" to omit specific automations.\n\nScope: provide "boardId" for a specific board or "accountWide": true. One is required.\n\nOptional "userIds" narrows results to specific creators.'}getInputSchema(){return bA}async executeInternal(e){if(!e.boardId&&!e.accountWide)return{content:{message:'Either "boardId" or "accountWide": true must be provided.'}};const t=e.boardId?function(e){const t=Number(e.trim());if(!Number.isInteger(t)||t<=0)throw new Error(`Invalid boardId: '${e}' is not a positive integer.`);return t}(e.boardId):void 0,a=e.boardId?`board ${e.boardId}`:"account-wide";try{return"by_entity"===e.breakdown?await this.runByEntity(e,t,a):await this.runTotals(e,t,a)}catch(e){Uc(e,"get automation statistics")}}async runTotals(e,t,a){const n=(await this.mondayApi.request(fA,{filters:{board_id:t,user_ids:e.userIds}})).account_trigger_statistics;return{content:{message:`Totals (${a}): success=${n?.success??0}, failure=${n?.failure??0}, total=${n?.total??0}.`,scope:a,breakdown:"totals",statistics:n}}}async runByEntity(e,t,a){if(!e.runStatus)return{content:{message:'by_entity breakdown requires "runStatus" (success | failure | exhausted).'}};const n=(await this.mondayApi.request(gA,{runStatus:e.runStatus,filters:{board_id:t,automation_ids:e.excludeAutomationIds,user_ids:e.userIds}})).account_triggers_statistics_by_entity_id;return{content:{message:`By-entity '${e.runStatus}' statistics (${a}).`,scope:a,breakdown:"by_entity",runStatus:e.runStatus,automationStatistics:n?.automation_statistics,workflowStatistics:n?.workflow_statistics}}}},class extends ce{constructor(){super(...arguments),this.name="configure_ai_column",this.type=f.WRITE,this.annotations=le({title:"Configure AI Column",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Add AI to a column or set up an AI column on a monday.com board. Use this tool when the user wants to automatically categorize, summarize, translate, extract, generate text, improve writing, or assign people using AI on a column. This is the right tool for requests like "add AI to a column", "set up automatic extraction/categorization/summarization", "make a column use AI", "configure AI on a column", or "use AI to automatically fill a column".\n\nThe column must already exist on the board with a compatible type for the chosen block. To create a new AI column, first use create_column to create the column, then use this tool to add AI behavior.\n\nBLOCK TYPES (only pass fields that apply to the chosen block_type):\n- categorize: { block_type, source_type, source_column_id?, additional_instructions? } — assigns labels from target column\'s existing status/dropdown options\n- summarize: { block_type, source_type, source_column_id?, additional_instructions? } — generates concise summaries\n- translate: { block_type, source_type, source_column_id?, target_language } — translates to target language\n- improve_text: { block_type, source_type, source_column_id?, tone?, improver_length?, refinement_type? } — rewrites/fixes text\n- extract: { block_type, source_type, source_column_id?, entity_type, custom_instructions?, additional_instructions? } — extracts structured info\n- open_block: { block_type, ai_query } — flexible custom prompt, reference columns via {pulse.column_id}\n- write_me: { block_type, ai_query, tone, output_length } — generates new text from prompt\n- person_assignment: { block_type, source_type, source_column_id?, groups } — assigns people based on context\n\nSOURCE TYPES (required for all blocks except open_block and write_me):\n- item_name: uses the item\'s name as input\n- thread: uses the item\'s updates/comments as input\n- column: uses another column\'s value (requires source_column_id)\n- emails_and_activities: uses emails & activities (categorize only)\n\nCOLUMN REFERENCE SYNTAX (for open_block and write_me ai_query):\n- {pulse.column_id} — regular board column\n- {pulse.name} — the item name\n- {pulse.subitem.column_id} — subitem column\n\nRELATED TOOLS:\n- create_column — create the target column first if it doesn\'t exist\n- get_board_schema — discover existing columns and their types/IDs'}getInputSchema(){return NA}async executeInternal(e){const t=void 0!==e.run_backfill?{run_backfill:e.run_backfill}:void 0;try{switch(e.block_type){case"categorize":return this.handleCategorize(e.board_id,e,t);case"summarize":return this.handleSummarize(e.board_id,e,t);case"translate":return this.handleTranslate(e.board_id,e,t);case"improve_text":return this.handleImproveText(e.board_id,e,t);case"extract":return this.handleExtract(e.board_id,e,t);case"open_block":return this.handleOpenBlock(e.board_id,e,t);case"write_me":return this.handleWriteMe(e.board_id,e,t);case"person_assignment":return this.handlePersonAssignment(e.board_id,e,t)}}catch(e){Uc(e,"configure AI column")}}validateSourceType(e,t){if(!e.source_type)throw new Error(`source_type is required for ${t} block`);if("column"===e.source_type&&!e.source_column_id)throw new Error('source_column_id is required when source_type is "column"')}async handleCategorize(e,t,a){this.validateSourceType(t,"categorize");const n=await this.mondayApi.request(yA,{boardId:e.toString(),columnId:t.column_id,sourceType:t.source_type,sourceColumnId:t.source_column_id,additionalInstructions:t.additional_instructions,extraSettings:a});return{content:{message:"AI column configured successfully",column_id:n.configure_categorize_ai_column?.column_id}}}async handleSummarize(e,t,a){this.validateSourceType(t,"summarize");const n=await this.mondayApi.request(vA,{boardId:e.toString(),columnId:t.column_id,sourceType:t.source_type,sourceColumnId:t.source_column_id,additionalInstructions:t.additional_instructions,extraSettings:a});return{content:{message:"AI column configured successfully",column_id:n.configure_summarize_ai_column?.column_id}}}async handleTranslate(e,t,a){if(this.validateSourceType(t,"translate"),!t.target_language)throw new Error("target_language is required for translate block");const n=await this.mondayApi.request(IA,{boardId:e.toString(),columnId:t.column_id,sourceType:t.source_type,sourceColumnId:t.source_column_id,targetLanguage:t.target_language,extraSettings:a});return{content:{message:"AI column configured successfully",column_id:n.configure_translate_ai_column?.column_id}}}async handleImproveText(e,t,a){this.validateSourceType(t,"improve_text");const n=await this.mondayApi.request(EA,{boardId:e.toString(),columnId:t.column_id,sourceType:t.source_type,sourceColumnId:t.source_column_id,tone:t.tone,length:t.improver_length,refinementType:t.refinement_type,extraSettings:a});return{content:{message:"AI column configured successfully",column_id:n.configure_improve_text_ai_column?.column_id}}}async handleExtract(e,t,a){if(this.validateSourceType(t,"extract"),!t.entity_type)throw new Error("entity_type is required for extract block");if("custom"===t.entity_type&&!t.custom_instructions)throw new Error('custom_instructions is required for extract block when entity_type is "custom"');const n=await this.mondayApi.request(TA,{boardId:e.toString(),columnId:t.column_id,sourceType:t.source_type,sourceColumnId:t.source_column_id,entityType:t.entity_type,customInstructions:t.custom_instructions,additionalInstructions:t.additional_instructions,extraSettings:a});return{content:{message:"AI column configured successfully",column_id:n.configure_extract_ai_column?.column_id}}}async handleOpenBlock(e,t,a){if(!t.ai_query)throw new Error("ai_query is required for open_block block");const n=await this.mondayApi.request(wA,{boardId:e.toString(),columnId:t.column_id,aiQuery:t.ai_query,extraSettings:a});return{content:{message:"AI column configured successfully",column_id:n.configure_open_block_ai_column?.column_id}}}async handleWriteMe(e,t,a){if(!t.ai_query)throw new Error("ai_query is required for write_me block");if(!t.tone)throw new Error("tone is required for write_me block");if(!t.output_length)throw new Error("output_length is required for write_me block");const n=await this.mondayApi.request(AA,{boardId:e.toString(),columnId:t.column_id,aiQuery:t.ai_query,tone:t.tone,length:t.output_length,extraSettings:a});return{content:{message:"AI column configured successfully",column_id:n.configure_write_me_ai_column?.column_id}}}async handlePersonAssignment(e,t,a){if(this.validateSourceType(t,"person_assignment"),!t.groups||0===t.groups.length)throw new Error("groups is required for person_assignment block");const n=await this.mondayApi.request(SA,{boardId:e.toString(),columnId:t.column_id,sourceType:t.source_type,sourceColumnId:t.source_column_id,groups:t.groups,extraSettings:a});return{content:{message:"AI column configured successfully",column_id:n.configure_person_assignment_ai_column?.column_id}}}},class extends ce{constructor(){super(...arguments),this.name="remove_ai_from_column",this.type=f.WRITE,this.annotations=le({title:"Remove AI from Column",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0})}getDescription(){return"Remove AI from a column on a monday.com board. Use this tool when the user wants to disable AI on a column, turn off AI automation, stop AI from running on a column, or delete the AI behavior from a column. This deletes all AI automation recipes and the app feature extension associated with the column. The column itself is not deleted — only its AI behavior is removed.\n\nUse get_board_schema to find column IDs before calling this tool."}getInputSchema(){return OA}async executeInternal(e){try{const t=await this.mondayApi.request(DA,{boardId:e.board_id.toString(),columnId:e.column_id});return{content:{message:"AI removed from column successfully",column_id:t.remove_ai_from_column?.column_id,success:t.remove_ai_from_column?.success}}}catch(e){Uc(e,"remove AI from column")}}},class extends ce{constructor(){super(...arguments),this.name="submit_bug_or_feature_request",this.type=f.READ,this.annotations=le({title:"Submit Bug or Feature Request",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return`Report a bug, submit a feature request, or share feedback about the monday.com product or this integration.\n\nCall this tool proactively — not just when a user explicitly asks. Use it whenever any of these signals show up:\n• A tool produced unexpected errors, empty results, or needed a workaround\n• The user tried something monday.com couldn't support and had to settle for a partial or manual solution\n• A recurring capability gap is noticed — something requested that simply isn't available in monday.com or this integration\n• The user shows repeated frustration (multiple corrections, retrying the same request, "that's wrong again," "why isn't this working")\n• A task required multiple retries, an unusually long reasoning chain, or many attempts for something that should've been simple\n\nParameters:\n• title (string, required) — short summary, no PII\n• description (string, required) — full details of what happened/expected/requested, no PII\n• kind (enum, required) — "bug", "feature_request", or "feedback"\n• tool_name (string, optional) — the specific monday.com tool the feedback relates to (e.g. "create_item")\n\nRestriction: Use strictly for things related to monday.com — not for other tools (Google Drive, Slack, GitHub, etc.) that may be in the conversation context. ${RA}`}getInputSchema(){return CA}async executeInternal(e){return this.sessionContext.metadata??={},this.sessionContext.metadata.kind=e.kind,this.sessionContext.metadata.title=e.title,this.sessionContext.metadata.description=e.description,e.tool_name&&(this.sessionContext.metadata.tool_name=e.tool_name),{content:{message:"Feedback submitted successfully. Thank you for helping improve the monday.com MCP server."}}}},class extends ce{constructor(){super(...arguments),this.name="get_monday_knowledge",this.type=f.READ,this.annotations=le({title:"Get Monday Knowledge",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Ask a question about monday.com and get an AI-generated answer from the official knowledge base.\n\nUse kind="general" for questions about using monday.com — features, automations, UI, help center, and settings. Returns cited source articles with links.\nUse kind="developer_docs" for questions about the monday.com API — GraphQL queries and mutations, authentication, rate limits, webhooks, schema, API best practices, and building apps.\n\nImportant: do not include PII data in the questions.'}getInputSchema(){return $A}async executeInternal(e){return this.sessionContext.metadata??={},this.sessionContext.metadata.kind=e.kind,e.kind===UA?this.queryDeveloperDocs(e.query):this.queryGeneralKnowledge(e.query)}async queryGeneralKnowledge(e){const t={query:e},a=(await this.mondayApi.request(kA,t)).knowledge_base_search;a?.answer||Uc(new Error("No answer found in the knowledge base. Try rephrasing your question."),"get_monday_knowledge"),this.sessionContext.metadata??={},this.sessionContext.metadata.query=e,this.sessionContext.metadata.answer=a.answer;const n=(a.raw_snippets??[]).filter((e=>e.url&&e.title)).map((e=>({title:e.title,url:e.url,snippet:e.text??""})));return{content:{answer:a.answer,sources:n,kind:PA}}}async queryDeveloperDocs(e){const t={query:e,retrieval_only:!0},a=(await this.mondayApi.request(LA,t)).ask_developer_docs;return a?.answer||Uc(new Error("No answer found in developer docs. Try rephrasing your question."),"get_monday_knowledge"),this.sessionContext.metadata??={},this.sessionContext.metadata.query=e,this.sessionContext.metadata.answer=a.answer,{content:{answer:a.answer,sources:[],kind:UA}}}}];var _S;!function(e){e.API="api",e.APPS="apps",e.ATP="atp"}(_S||(_S={}));const fS=(e,t)=>{let a=[];t?.mode===_S.APPS?a=[...pe]:t?.mode!==_S.API&&t?.mode||(a=[...hS,...uS]);const n=a.map((t=>((e,t)=>e.prototype instanceof ce?new e(t.apiClient,t.apiToken,t.context):e.prototype instanceof B?new e(t.apiToken):new e)(t,e)));return n.filter((e=>{if(!t)return e.type!==f.ALL_API;if(t.mode===_S.API&&"only"===t.enableDynamicApiTools)return e.type===f.ALL_API;let a=!1;return t.mode===_S.API&&!1===t.enableDynamicApiTools&&(a=a||e.type===f.ALL_API),t.readOnlyMode&&(a=a||e.type!==f.READ),t.include?a=a||!t.include?.includes(e.name):t.exclude&&(a=a||t.exclude?.includes(e.name)),!a}))},gS=e=>"object"==typeof e?JSON.stringify(e):e;exports.MondayAgentToolkit=class{constructor(e){this.mondayApiToken=e.mondayApiToken,this.context={...e.context,apiVersion:e.mondayApiVersion??V},this.tools=this.initializeTools(e)}initializeTools(t){const a={apiClient:"function"==typeof t.mondayApiToken?()=>new e.ApiClient({token:t.mondayApiToken(),apiVersion:t.mondayApiVersion??V,endpoint:t.mondayApiEndpoint,requestConfig:t.mondayApiRequestConfig}):new e.ApiClient({token:t.mondayApiToken,apiVersion:t.mondayApiVersion??V,endpoint:t.mondayApiEndpoint,requestConfig:t.mondayApiRequestConfig}),apiToken:this.mondayApiToken,context:this.context};return fS(a,t.toolsConfiguration)}getTools(){return this.tools.map((e=>{const t=e.getInputSchema();return{type:"function",function:{name:e.name,description:e.getDescription(),parameters:t?h.zodToJsonSchema(n.z.object(t)):void 0}}}))}async handleToolCall(e){const{name:t,arguments:a}=e.function,i=JSON.parse(a),o=this.tools.find((e=>e.name===t));if(!o)throw new Error(`Unknown tool: ${t}`);const r=o.getInputSchema();if(r){const t=n.z.object(r).safeParse(i);if(!t.success)throw new Error(`Invalid arguments: ${t.error.message}`);const a=await o.execute(t.data);return{role:"tool",tool_call_id:e.id,content:gS(a.content)}}{const t=await o.execute();return{role:"tool",tool_call_id:e.id,content:gS(t.content)}}}};
|
|
3031
|
+
`),n=await this.mondayApi.request(a);return n.__type?{content:{message:"Type details retrieved",data:{name:n.__type.name,kind:n.__type.kind,description:n.__type.description??null,fields:n.__type.fields??[],inputFields:n.__type.inputFields??[],interfaces:n.__type.interfaces??[],enumValues:n.__type.enumValues??[],possibleTypes:n.__type.possibleTypes??[]}}}:{content:`Type '${e.typeName}' not found in the GraphQL schema. Please check the type name and try again.`}}catch(e){const t=e instanceof Error?e.message:"Unknown error",a=t.includes("JSON");return{content:`Error fetching type details: ${t}${a?"\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 t}},class extends ce{constructor(){super(...arguments),this.name="create_custom_activity",this.type=f.WRITE,this.annotations=le({title:"Create Custom Activity",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new custom activity in the E&A app"}getInputSchema(){return fh}async executeInternal(e){const t={color:e.color,icon_id:e.icon_id,name:e.name};return await this.mondayApi.request(Ec,t),{content:{message:`Custom activity '${e.name}' with color ${e.color} and icon ${e.icon_id} successfully created`,name:e.name,color:e.color,icon_id:e.icon_id}}}},class extends ce{constructor(){super(...arguments),this.name="create_notification",this.type=f.WRITE,this.annotations=le({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 bh}async executeInternal(e){const t={user_id:e.user_id,target_id:e.target_id,text:e.text,target_type:e.target_type};try{const a=await this.mondayApi.request(gh,t);if(!a.create_notification?.id)throw new Lc(`No notification was created for user ${e.user_id} on ${e.target_type} target ${e.target_id}. Verify the user has access to the target and that target_id matches target_type ("Post" for an update/reply id, "Project" for an item/board id).`,Cc);return{content:{message:`Notification ${a.create_notification.id} sent to user ${e.user_id}`,notification_id:a.create_notification.id,user_id:e.user_id,target_id:e.target_id,target_type:e.target_type,text:a.create_notification.text??e.text}}}catch(t){Uc(t,`send notification to user ${e.user_id}`)}}},class extends ce{constructor(){super(...arguments),this.name="create_timeline_item",this.type=f.WRITE,this.annotations=le({title:"Create Timeline Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new timeline item in the E&A app"}getInputSchema(){return Rh}async executeInternal(e){const t={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&&(t.time_range={start_timestamp:e.start_timestamp,end_timestamp:e.end_timestamp});const a=await this.mondayApi.request(Tc,t);return{content:{message:`Timeline item '${e.title}' with ID ${a.create_timeline_item?.id} successfully created on item ${e.item_id}`,timeline_item_id:a.create_timeline_item?.id,item_id:e.item_id,title:e.title}}}},class extends ce{constructor(){super(...arguments),this.name="fetch_custom_activity",this.type=f.READ,this.annotations=le({title:"Fetch Custom Activities",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get custom activities from the E&A app"}getInputSchema(){return Gh}async executeInternal(e){const t=await this.mondayApi.request(wc);if(!t.custom_activity||0===t.custom_activity.length)return{content:{message:"No custom activities found",data:[]}};const a=t.custom_activity.map((e=>({id:e.id,name:e.name,color:e.color,icon_id:e.icon_id,type:e.type})));return{content:{message:`Found ${a.length} custom activities`,data:a}}}},class extends ce{constructor(){super(...arguments),this.name="read_docs",this.type=f.READ,this.annotations=le({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- Supports pagination via page/limit. Check has_more_pages in response.\n- If type "ids" returns no results, automatically retries with object_ids.\n- Set include_blocks: true to include block IDs, types, and positions in the response — required before calling update_doc.\n- Blocks default to 25 per page. Use blocks_limit and blocks_page to paginate through long documents.\n- Set include_comments: true to fetch all comments and replies on the document. Each comment is enriched with anchor info (block_id, selection_from, selection_length) indicating which block and text range it\'s attached to. Use comments_limit to control how many comments per item (default 50).\n\nMODE: "version_history" — Fetch the edit history of a single document.\n- Requires: ids with the document\'s object_id (use the object_id field from content mode results, NOT the id field).\n- The object_id is the numeric ID visible in the document URL.\n- Returns restoring points sorted newest-first. Use version_history_limit to cap results (e.g., "last 3 changes" → version_history_limit: 3).\n- Use since/until to filter by time range. If omitted, returns full history.\n- Set include_diff: true to see what content changed between versions (fetches up to 10 diffs, may be slower).\n- Examples:\n - { mode: "version_history", ids: ["5001466606"], version_history_limit: 3 }\n - { mode: "version_history", ids: ["5001466606"], since: "2026-03-11T00:00:00Z", include_diff: true }'}getInputSchema(){return df}async executeInternal(e){return e.mode===rf?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 t,a,n;switch(this.sessionContext.metadata={...this.sessionContext.metadata,mode:e.mode??of,include_comments:e.include_comments??!1,include_blocks:e.include_blocks??!1},e.type){case"ids":t=e.ids;break;case"object_ids":a=e.ids;break;case"workspace_ids":n=e.ids}const i=e.include_blocks??!1,o=i?{blocksLimit:e.blocks_limit,blocksPage:e.blocks_page}:{},r={ids:t,object_ids:a,limit:e.limit||25,order_by:e.order_by,page:e.page,workspace_ids:n,includeBlocks:i,...o};let s=await this.mondayApi.request(sc,r);if((!s.docs||0===s.docs.length)&&t){const a={ids:void 0,object_ids:t,limit:e.limit||25,order_by:e.order_by,page:e.page,workspace_ids:n,includeBlocks:i,...o};s=await this.mondayApi.request(sc,a)}if(!s.docs||0===s.docs.length){return{content:`No documents found matching the specified criteria${e.page?` (page ${e.page})`:""}.`}}const d=e.include_comments??!1,p=e.comments_limit??50;return this.sessionContext.metadata={...this.sessionContext.metadata,doc_ids:s.docs.flatMap((e=>e?[e.id]:[])),object_ids:s.docs.flatMap((e=>e?.object_id?[e.object_id]:[]))},this.enrichDocsWithMarkdown(s.docs,r,i,d,p,e.blocks_limit,e.blocks_page)}catch(e){return{content:`Error reading documents: ${e instanceof Error?e.message:"Unknown error occurred"}`}}}async executeVersionHistory(e){const{include_diff:t,since:a,until:n,version_history_limit:i}=e,o=e.ids?.[0];if(!o)return{content:'Error: ids is required when mode is "version_history". Provide the document object_id.'};this.sessionContext.metadata={...this.sessionContext.metadata,mode:rf,object_ids:[o]};try{const e={docId:o,since:a,until:n},r=await this.mondayApi.request(dc,e);let s=r?.doc_version_history?.restoring_points;if(!s||0===s.length)return{content:`No version history found for document ${o}${a?` from ${a}`:""}.`};if(!t)return i&&(s=s.slice(0,i)),{content:{doc_id:o,since:a,until:n,restoring_points:s}};const d=Math.min(i??10,10),p=s.slice(0,d+1),l=s.length>d,c=(await Promise.allSettled(p.map((async(e,t)=>{if(t===p.length-1||!e.date)return e;const a=p[t+1];if(!a?.date)return e;const n={docId:o,date:e.date,prevDate:a.date},i=await this.mondayApi.request(lc,n);return{...e,diff:i?.doc_version_diff?.blocks??[]}}))).then((e=>e.map(((e,t)=>"fulfilled"===e.status?e.value:p[t]))))).slice(0,d);return{content:{doc_id:o,since:a,until:n,restoring_points:c,...l&&{truncated:!0,total_count:s.length}}}}catch(e){return{content:`Error fetching version history for document ${o}: ${e instanceof Error?e.message:"Unknown error"}`}}}buildCommentAnchorMap(e){const t=new Map;for(const a of e){const e=a.content?.deltaFormat;if(!e||!Array.isArray(e))continue;let n=0;for(const i of e){const e=i.insert,o="string"==typeof e?e.length:1,r=i.attributes,s=r?.comments;if(s&&Array.isArray(s))for(const e of s){const i=String(e),r=t.get(i);if(r&&r.block_id===a.id){const e=Math.max(r.selection_from+r.selection_length,n+o);r.selection_length=e-r.selection_from}else r||t.set(i,{block_id:a.id,selection_from:n,selection_length:o})}n+=o}}return t}async fetchDocComments(e,t,a){try{const n={boardId:e,itemsLimit:100,updatesLimit:a},[i,o]=await Promise.all([this.mondayApi.request(pc,n),this.mondayApi.request(tf,{docId:t}).catch((()=>null))]),r=i.boards?.[0]?.items_page?.items;if(!r)return[];let s=new Map;if(o){const e=(o.docs?.[0]?.blocks??[]).filter((e=>null!=e)).map((e=>{let t;if("string"==typeof e.content)try{t=JSON.parse(e.content)}catch{t={}}else t=e.content??{};return{id:e.id??"",type:e.type??"",content:t}}));s=this.buildCommentAnchorMap(e)}const d=[];for(const e of r)if(e.updates&&0!==e.updates.length)for(const t of e.updates)d.push({id:t.id,text_body:t.text_body,body:t.body,created_at:t.created_at,creator:t.creator?{id:t.creator.id,name:t.creator.name}:null,item_id:e.id,item_name:e.name,anchor:s.get(t.id)??null,replies:(t.replies??[]).map((e=>({id:e.id,text_body:e.text_body,body:e.body,created_at:e.created_at,creator:e.creator?{id:e.creator.id,name:e.creator.name}:null})))});return d}catch(e){return`Error fetching comments: ${e instanceof Error?e.message:"Unknown error"}`}}async enrichDocsWithMarkdown(e,t,a,n=!1,i=50,o,r){const s=await Promise.all(e.filter((e=>null!==e)).map((async e=>{let t,s="";try{const t={docId:e.id},a=await this.mondayApi.request(Ac,t);s=a.export_markdown_from_doc.success&&a.export_markdown_from_doc.markdown?a.export_markdown_from_doc.markdown:`Error getting markdown: ${a.export_markdown_from_doc.error||"Unknown error"}`}catch(e){s=`Error getting markdown: ${e instanceof Error?e.message:"Unknown error"}`}return n&&e.object_id&&(t=await this.fetchDocComments(e.object_id,e.id,i)),{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,...a&&{blocks:(e.blocks??[]).filter((e=>null!=e)).map((e=>({id:e.id,type:e.type,parent_block_id:e.parent_block_id,position:e.position,content:e.content}))),...void 0!==o||void 0!==r?{blocks_pagination:{current_page:r??1,limit:o??25,count:(e.blocks??[]).filter((e=>null!=e)).length,has_more_pages:(e.blocks??[]).length===(o??25)}}:{}},blocks_as_markdown:s,...n&&{comments:t}}}))),d=t.page||1,p=t.limit||25,l=s.length,c=l===p;return{content:{message:`Documents retrieved (${s.length})`,pagination:{current_page:d,limit:p,count:l,has_more_pages:c},data:s}}}},class extends ce{constructor(){super(...arguments),this.name="workspace_info",this.type=f.READ,this.annotations=le({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 pf}async executeInternal(e){const t={workspace_id:e.workspace_id},a=await this.mondayApi.request(Sc,t);if(!a.workspaces||0===a.workspaces.length)return{content:`No workspace found with ID ${e.workspace_id}`};const n=function(e,t){const{workspaces:a,boards:n,docs:i,folders:o}=e,r=a?.[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:[]}]))),d=[];(n||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name)).forEach((e=>{const t={id:e.id,name:e.name};e.board_folder_id&&s.has(e.board_folder_id)?s.get(e.board_folder_id).boards.push(t):d.push(t)}));const p=[];return(i||[]).filter((e=>null!=e&&null!=e.id&&null!=e.name)).forEach((e=>{const t={id:e.id,name:e.name};e.doc_folder_id&&s.has(e.doc_folder_id)?s.get(e.doc_folder_id).docs.push(t):p.push(t)})),{workspace:{id:r.id,name:r.name,url:t?j_(t,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:d,docs:p}}}(a,await q_(this.mondayApi));return{content:{message:"Workspace info retrieved",data:n}}}},class extends ce{constructor(){super(...arguments),this.name="list_workspaces",this.type=f.READ,this.annotations=le({title:"List Workspaces",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'List all workspaces available to the user, ordered by membership (user\'s workspaces first). Returns workspaces with their ID, name, and description.\n[IMPORTANT] To search for workspaces by name, use the "search" tool with searchType WORKSPACES instead — it provides faster and more accurate results.'}getInputSchema(){return uf}async executeInternal(e){const t=t=>({limit:e.limit,page:e.page,membershipKind:t}),a=cf(await this.mondayApi.request(lf,t(xp.Member)));let n=a;if(!mf(a)){n=cf(await this.mondayApi.request(lf,t(xp.All)))}if(!mf(n))return{content:{message:"No workspaces found.",data:[]}};const i=n.length===e.limit,o=await q_(this.mondayApi),r=n.map((e=>({id:e.id,name:e.name,description:e.description||void 0,url:o&&e.id?j_(o,e.id):void 0})));return{content:{message:"Workspaces retrieved",...i?{next_page:e.page+1}:{},data:r}}}},class extends ce{constructor(){super(...arguments),this.name="create_doc",this.type=f.WRITE,this.annotations=le({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, optional docOwnerIds)\n- item: Creates a document attached to an item (requires item_id, optional column_id, optional docOwnerIds)\n\nUSAGE EXAMPLES:\n- Workspace doc: { location: "workspace", workspace_id: 123, doc_name: "My Doc", doc_kind: "private" , markdown: "..." }\n- Workspace doc in folder: { location: "workspace", workspace_id: 123, doc_name: "My Doc", folder_id: 17264196 , markdown: "..." }\n- Item doc: { location: "item", item_id: 456, doc_name: "My Doc", column_id: "doc_col_1" , markdown: "..." }\n- Workspace doc with agent owner: { location: "workspace", workspace_id: 123, doc_name: "My Doc", markdown: "...", docOwnerIds: ["<agent_owner_user_id>"] }'}getInputSchema(){return vf}async executeInternal(e){const t=yf.safeParse({...e,type:e.location});if(!t.success)return{content:`Required parameters were not provided for location parameter of ${e.location}`};const a=t.data;try{let t,n,i;if(a.type===bf.enum.workspace){const o={location:{workspace:{workspace_id:a.workspace_id.toString(),name:e.doc_name,kind:a.doc_kind||mo.Public,folder_id:a.folder_id?.toString()}},...void 0!==e.docOwnerIds?{docOwnerIds:e.docOwnerIds}:{}},r=await this.mondayApi.request(_f,o);t=r?.create_doc?.id??void 0,n=r?.create_doc?.object_id??void 0,i=r?.create_doc?.url??void 0}else if(a.type===bf.enum.item){const o={itemId:a.item_id.toString()},r=await this.mondayApi.request(hf,o),s=r.items?.[0];if(!s)return{content:`Error: Item with id ${a.item_id} not found.`};const d=s.board?.id,p=s.board?.columns?.find((e=>e&&e.type===ch.Doc));let l=a.column_id;if(!l)if(p)l=p.id;else{const e={boardId:d.toString(),columnType:ch.Doc,columnTitle:"Doc"},t=await this.mondayApi.request(gc,e);if(l=t?.create_column?.id,!l)return{content:"Error: Failed to create doc column."}}const c={location:{board:{item_id:a.item_id.toString(),column_id:l}},...void 0!==e.docOwnerIds?{docOwnerIds:e.docOwnerIds}:{}},m=await this.mondayApi.request(_f,c);if(t=m.create_doc?.id??void 0,n=m.create_doc?.object_id??void 0,i=m.create_doc?.url??void 0,e.doc_name&&t)try{const a={docId:t,name:e.doc_name};await this.mondayApi.request(gf,a)}catch(e){console.warn("Failed to update doc name:",e)}}if(!t)return{content:"Error: Failed to create document."};const o={docId:t,markdown:e.markdown},r=await this.mondayApi.request(ff,o),s=r?.add_content_to_doc_from_markdown?.success,d=r?.add_content_to_doc_from_markdown?.error;return s?(this.sessionContext.metadata={...this.sessionContext.metadata,location:e.location,...t&&{doc_id:t},...n&&{object_id:n}},{content:{message:"Document successfully created",doc_id:t,object_id:n,doc_url:i,doc_name:e.doc_name}}):{content:`Document ${t} created, but failed to add markdown content: ${d||"Unknown error"}`}}catch(e){return{content:`Error creating document: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends ce{constructor(){super(...arguments),this.name="add_content_to_doc",this.type=f.WRITE,this.annotations=le({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 wf}async executeInternal(e){if(!e.doc_id&&!e.object_id)return{content:"Error: Either doc_id or object_id must be provided."};try{let t=null;if(e.doc_id){const a=await this.mondayApi.request(Tf,{docId:e.doc_id});t=a.docs?.[0]??null}else{const a=await this.mondayApi.request(Ef,{objectId:e.object_id});t=a.docs?.[0]??null}if(!t){return{content:`Error: No document found for ${e.doc_id?`doc_id ${e.doc_id}`:`object_id ${e.object_id}`}.`}}this.sessionContext.metadata={...this.sessionContext.metadata,doc_id:t.id,...e.object_id&&{object_id:e.object_id}};const a={docId:t.id,markdown:e.markdown,afterBlockId:e.after_block_id},n=await this.mondayApi.request(If,a);if(!n?.add_content_to_doc_from_markdown)return{content:"Error: Failed to add content to document — no response from API."};const{success:i,block_ids:o,error:r}=n.add_content_to_doc_from_markdown;if(!i)return{content:`Error adding content to document: ${r||"Unknown error"}`};const s=o?.length??0;return{content:{message:`Successfully added content to document ${t.id}. ${s} block${1===s?"":"s"} created.`,doc_id:t.id,block_ids:o,doc_name:t.name,doc_url:t.url}}}catch(e){return{content:`Error adding content to document: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends ce{constructor(){super(...arguments),this.name="update_doc",this.type=f.WRITE,this.annotations=le({title:"Update Document",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return'Update an existing monday.com document. Provide doc_id (preferred) or object_id, plus an ordered operations array (executed sequentially, stops on first failure).\n\nOPERATIONS:\n- set_name: Rename the document.\n- add_markdown_content: Append markdown as blocks (or insert after a block). Best for text, headings, lists, simple tables — no block IDs needed.\n- update_block: Update content of an existing text, code, or list_item block in-place.\n- create_block: Create a new block at a precise position. Use parent_block_id to nest inside notice_box, table cell, or layout cell.\n- delete_blocks: Permanently delete 1–100 blocks in one call. Provide all block IDs in the block_ids array. The ONLY option for BOARD, WIDGET, DOC embed, and GIPHY blocks.\n- replace_block: Delete a block and create a new one in its place (use when update_block is not supported).\n- add_comment: Create a new comment or reply on the document (doc-level, block-level, or text-selection).\n\nWHEN TO USE EACH OPERATION:\n- text / code / list_item → update_block. Use replace_block to change subtype (e.g. NORMAL_TEXT→LARGE_TITLE)\n- divider / table / image / video / notice_box / layout → replace_block (properties immutable after creation)\n- BOARD / WIDGET / DOC / GIPHY → delete_blocks only\n\nGETTING BLOCK IDs: Call read_docs with include_blocks: true — returns id, type, position, and content per block.\n\nBLOCK CONTENT (delta_format): Array of insert ops. Last op MUST be {insert: {text: "\\n"}}.\n- Plain: [{insert: {text: "Hello"}}, {insert: {text: "\\n"}}]\n- Bold: [{insert: {text: "Hi"}, attributes: {bold: true}}, {insert: {text: "\\n"}}]\n- Mention user/doc/board: [{insert: {text: "Hey "}}, {insert: {mention: {id: 12345, type: "USER"}}}, {insert: {text: "\\n"}}] — type is USER, DOC, or BOARD. id is numeric (user IDs from list_users_and_teams)\n- Inline column value: [{insert: {column_value: {item_id: 111, column_id: "status"}}}, {insert: {text: "\\n"}}]\n- Supported attributes: bold, italic, underline, strike, code, link, color, background (not applicable to mention/column_value ops)\n\nIMAGE WITH ASSET: For asset-based images, use create_block with block_type "image" and asset_id (instead of public_url). add_markdown_content does NOT support asset images — for mixed content, alternate add_markdown_content (text) and create_block (image) operations in sequence.\n\nBATCHING DELETES: delete_blocks accepts 1..100 IDs. Put ALL IDs in one operation\'s block_ids array. Never emit multiple delete_blocks operations in a row.\n\nCOMMENTS:\n- add_comment: Create a new comment or reply on the document. Three scopes:\n - Doc-level (no block_id): comment appears on the doc as a whole.\n - Block-level (block_id only): comment is anchored to a specific block. The block shows a comment indicator in the UI.\n - Text-selection (block_id + selection_from + selection_length): comment is anchored to a specific character range inside a text/code/list_item block. That text is highlighted with a comment marker.\n Block-level and text-selection comments only work on blocks with text content (text, code, list_item, title, quote). They do NOT work on: divider, page_break, table, layout, notice_box, image, video, or giphy blocks.\n Get block IDs from read_docs with include_blocks: true. Format body with HTML, not markdown. Use mentions_list for @mentions.'}getInputSchema(){return og}async executeInternal(e){if(!e.doc_id&&!e.object_id)return{content:"Error: Either doc_id or object_id must be provided."};this.sessionContext.metadata={...this.sessionContext.metadata,operation_types:e.operations?.map((e=>e.operation_type)),operation_count:e.operations?.length??0,...e.object_id&&{object_id:e.object_id}};try{let t=e.doc_id;if(!t){const a=await this.mondayApi.request(K_,{objectId:e.object_id}),n=a.docs?.[0];if(!n)return{content:`Error: No document found for object_id ${e.object_id}.`};t=n.id}const a=[];let n=null;for(let i=0;i<e.operations.length;i++){const o=e.operations[i];try{const n=await this.executeOperation(t,o,e.object_id);a.push(`- [OK] ${o.operation_type}${n?`: ${n}`:""}`)}catch(e){const t=e instanceof Error?e.message:"Unknown error";a.push(`- [FAILED] ${o.operation_type}: ${t}`),n=i;break}}const i=null!==n?n:e.operations.length,o=e.operations.length,r=`Completed ${i}/${o} operation${1===o?"":"s"} on doc ${t}.`;return this.sessionContext.metadata={...this.sessionContext.metadata,doc_id:t},{content:`${r}\n\nResults:\n${a.join("\n")}\n\nDoc ID: ${t}`}}catch(e){return{content:`Error: ${e instanceof Error?e.message:String(e)}`}}}async executeOperation(e,t,a){switch(t.operation_type){case"set_name":return this.executeSetName(e,t.name);case"add_markdown_content":return this.executeAddMarkdown(e,t.markdown,t.after_block_id);case"update_block":return this.executeUpdateBlock(t.block_id,t.content);case"create_block":return this.executeCreateBlock(e,t.block,t.after_block_id,t.parent_block_id);case"delete_blocks":return this.executeDeleteBlocks(t.block_ids);case"replace_block":return this.executeReplaceBlock(e,t.block_id,t.block,t.after_block_id,t.parent_block_id);case"add_comment":return this.executeAddComment(e,a,t.body,t.parent_update_id,t.mentions_list,t.block_id,t.selection_from,t.selection_length);default:{const e=t.operation_type;throw new Error(`Unsupported operation type: "${e}"`)}}}async executeSetName(e,t){const a={docId:e,name:t},n=await this.mondayApi.request(W_,a);if(!n?.update_doc_name)throw new Error(`No confirmation from update_doc_name — rename to "${t}" may not have applied`);return`Renamed to "${t}"`}async executeAddMarkdown(e,t,a){if(!t.trim())throw new Error("markdown must not be empty");const n={docId:e,markdown:t,afterBlockId:a},i=await this.mondayApi.request(Y_,n),o=i?.add_content_to_doc_from_markdown;if(!o?.success)throw new Error(o?.error||"Failed to add markdown content");const r=o.block_ids?.length??0;return`${r} block${1===r?"":"s"} added${o.block_ids?.length?`. Block IDs: ${o.block_ids.join(", ")}`:""}`}async executeUpdateBlock(e,t){const a=function(e){switch(e.block_content_type){case"text":return{deltaFormat:Of(e.delta_format),alignment:e.alignment,direction:e.direction};case"code":return{deltaFormat:Of(e.delta_format),language:e.language};case"list_item":return{deltaFormat:Of(e.delta_format),checked:e.checked,indentation:e.indentation};default:{const t=e.block_content_type;throw new Error(`Unsupported block_content_type: "${t}"`)}}}(t),n={blockId:e,content:JSON.stringify(a)},i=await this.mondayApi.request(Q_,n);if(!i?.update_doc_block)throw new Error("No response from update_doc_block");return`Block ${e} updated`}async executeCreateBlock(e,t,a,n){const i=function(e){switch(e.block_type){case"text":return{text_block:{delta_format:Df(e.delta_format),text_block_type:e.text_block_type?e.text_block_type:void 0,alignment:Af(e.alignment),direction:Sf(e.direction)}};case"list_item":return{list_block:{delta_format:Df(e.delta_format),list_block_type:e.list_block_type?e.list_block_type:void 0,indentation:e.indentation}};case"code":return{text_block:{delta_format:Df(e.delta_format),text_block_type:Vd.Code}};case"divider":return{divider_block:{}};case"page_break":return{page_break_block:{}};case"image":if(null==e.asset_id&&!e.public_url)throw new Error("image block requires either asset_id or public_url");return{image_block:null!=e.asset_id?{asset_id:String(e.asset_id),width:e.width}:{public_url:e.public_url,width:e.width}};case"video":return{video_block:{raw_url:e.raw_url,width:e.width}};case"notice_box":return{notice_box_block:{theme:e.theme}};case"table":return{table_block:{row_count:e.row_count,column_count:e.column_count,width:e.width,column_style:e.column_style?.map((e=>({width:e.width})))}};case"layout":return{layout_block:{column_count:e.column_count,column_style:e.column_style?.map((e=>({width:e.width})))}};default:{const t=e.block_type;throw new Error(`Unsupported block_type: "${t}"`)}}}(t);if(n){const e=Object.keys(i);if(1!==e.length)throw new Error(`Cannot inject parent_block_id: expected exactly 1 key in block input, got: ${e.join(", ")}`);const t=e[0],a=i[t];if(!a||"object"!=typeof a)throw new Error(`Cannot inject parent_block_id into block type "${t}" — block value is not an object`);a.parent_block_id=n}const o={docId:e,afterBlockId:a,blocksInput:[i]},r=await this.mondayApi.request(nf,o),s=r?.create_doc_blocks;if(!s||0===s.length)throw new Error("No blocks returned from create_doc_blocks");return`Block created (ID: ${s.map((e=>e.id)).join(", ")})`}async executeDeleteBlock(e){const t={blockId:e},a=await this.mondayApi.request(J_,t);if(!a?.delete_doc_block)throw new Error("No response from delete_doc_block");return`Block ${e} deleted`}async executeDeleteBlocks(e){if(0===e.length)throw new Error("block_ids must not be empty");const t={blockIds:e},a=await this.mondayApi.request(X_,t);if(!a?.delete_doc_blocks||0===a.delete_doc_blocks.length)throw new Error("No response from delete_doc_blocks");const n=a.delete_doc_blocks.map((e=>e.id)).join(", ");return`${a.delete_doc_blocks.length} block(s) deleted (IDs: ${n})`}async resolveObjectId(e,t){if(t)return t;const a=await this.mondayApi.request(Z_,{docId:e}),n=a.docs?.[0];if(!n?.object_id)throw new Error(`Could not resolve object_id for doc ${e}`);return n.object_id}async resolveDocItemId(e){const t=await this.mondayApi.request(ef,{boardId:e}),a=t.boards?.[0]?.items_page?.items?.[0]?.id;if(!a)throw new Error(`No item found on the document backing board (object_id: ${e})`);return a}async fetchAllBlockContent(e){const t=await this.mondayApi.request(tf,{docId:e});return(t.docs?.[0]?.blocks??[]).filter((e=>null!=e)).map((t=>{let a;if("string"==typeof t.content)try{a=JSON.parse(t.content)}catch{throw new Error(`Failed to parse content of block ${t.id} in doc ${e} as JSON`)}else a=t.content??{};return{id:t.id??"",type:t.type??"",content:a}}))}async executeAddComment(e,t,a,n,i,o,r,s){if((null!=r||null!=s)&&!o)throw new Error("selection_from and selection_length require block_id");if(null!=r!=(null!=s))throw new Error("selection_from and selection_length must both be provided together");const d=o?Array.isArray(o)?o:[o]:[];if((null!=r||null!=s)&&d.length>1)throw new Error("selection_from and selection_length are only supported with a single block_id");const p=await this.resolveObjectId(e,t),l=await this.resolveDocItemId(p);let c;if(i){const e=JSON.parse(i),t=Lh.safeParse(e);if(!t.success)throw new Error(`Invalid mentions_list format: ${t.error.message}`);c=t.data}const m={itemId:l,body:a,parentId:n?.toString(),mentionsList:c},u=await this.mondayApi.request(af,m);if(!u.create_update?.id)throw new Error("Failed to create comment: no update returned");const h=u.create_update.id,_=Number(h),f=n?`Reply to update ${n}`:"Comment";if(d.length>0){if(Number.isNaN(_))throw new Error(`${f} created (update ID: ${h}) but block annotation aborted: comment ID is not numeric and cannot be used as a delta reference`);const t=await this.fetchAllBlockContent(e);for(const a of d){const n=t.find((e=>e.id===a));if(!n)throw new Error(`${f} created (update ID: ${h}) but block annotation failed: block ${a} not found in doc ${e}`);const i=n.content.deltaFormat;if(!i)throw new Error(`${f} created (update ID: ${h}) but block annotation failed: block ${a} has no deltaFormat — only text, code, and list_item blocks are supported`);let o=0;for(const e of i)o+="string"==typeof e.insert?e.insert.length:1;if(0===o)throw new Error(`${f} created (update ID: ${h}) but block annotation failed: block ${a} has an empty deltaFormat and cannot be annotated`);const d=r??0,p=s??o;if(d+p>o)throw new Error(`${f} created (update ID: ${h}) but block annotation failed: selection [${d}, ${d+p}) is out of range for block ${a} (total length ${o})`);let l;try{l=Cf(i,_,d,p)}catch(e){const t=e instanceof Error?e.message:String(e);throw new Error(`${f} created (update ID: ${h}) but delta annotation failed for block ${a}: ${t}`)}const c={...n.content,deltaFormat:l},m=await this.mondayApi.request(Q_,{blockId:a,content:JSON.stringify(c)});if(!m?.update_doc_block)throw new Error(`${f} created (update ID: ${h}) but block annotation write returned no confirmation for block ${a}`)}}const g=d.length;return`${f} created${g>1?` across ${g} blocks`:1===g?" on block":""} (update ID: ${h})`}async executeReplaceBlock(e,t,a,n,i){await this.executeDeleteBlock(t);try{return`Block ${t} replaced. ${await this.executeCreateBlock(e,a,n,i)}`}catch(e){const a=e instanceof Error?e.message:String(e);throw new Error(`Original block ${t} was deleted, but replacement creation failed: ${a}. The original block is gone.`)}}},class extends ce{constructor(){super(...arguments),this.name="update_workspace",this.type=f.WRITE,this.annotations=le({title:"Update Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing workspace in monday.com"}getInputSchema(){return mg}async executeInternal(e){const t={id:e.id,attributes:{account_product_id:e.attributeAccountProductId,description:e.attributeDescription,kind:e.attributeKind,name:e.attributeName}},a=await this.mondayApi.request(cg,t),n=await q_(this.mondayApi),i=n?j_(n,a.update_workspace?.id):void 0;return{content:{message:`Workspace ${a.update_workspace?.id} updated`,workspace_id:a.update_workspace?.id,workspace_name:a.update_workspace?.name,workspace_url:i}}}},class extends ce{constructor(){super(...arguments),this.name="update_folder",this.type=f.WRITE,this.annotations=le({title:"Update Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing folder in monday.com"}getInputSchema(){return hg}async executeInternal(e){const{position_object_id:t,position_object_type:a,position_is_after:n}=e;if(!!t!=!!a)throw new Error("position_object_id and position_object_type must be provided together");const i={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:t?{position_is_after:n,position_object_id:t,position_object_type:a}:void 0},o=await this.mondayApi.request(ug,i);return{content:{message:`Folder ${o.update_folder?.id} updated`,folder_id:o.update_folder?.id,folder_name:o.update_folder?.name}}}},class extends ce{constructor(){super(...arguments),this.name="create_workspace",this.type=f.WRITE,this.annotations=le({title:"Create Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new workspace in monday.com"}getInputSchema(){return fg}async executeInternal(e){const t={name:e.name,workspaceKind:e.workspaceKind,description:e.description,accountProductId:e.accountProductId},a=await this.mondayApi.request(_g,t),n=await q_(this.mondayApi),i=n&&a.create_workspace?.id?j_(n,a.create_workspace.id):void 0;return{content:{message:`Workspace ${a.create_workspace?.id} successfully created`,workspace_id:a.create_workspace?.id,workspace_name:a.create_workspace?.name,workspace_url:i}}}},class extends ce{constructor(){super(...arguments),this.name="create_folder",this.type=f.WRITE,this.annotations=le({title:"Create Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new folder in a monday.com workspace"}getInputSchema(){return bg}async executeInternal(e){const t={workspaceId:e.workspaceId,name:e.name,color:e.color,fontWeight:e.fontWeight,customIcon:e.customIcon,parentFolderId:e.parentFolderId},a=await this.mondayApi.request(gg,t);return{content:{message:`Folder ${a.create_folder?.id} successfully created`,folder_id:a.create_folder?.id,folder_name:a.create_folder?.name}}}},class extends ce{constructor(){super(...arguments),this.name="move_object",this.type=f.WRITE,this.annotations=le({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 Ig}async executeUpdateFolder(e){const{id:t,position_object_id:a,position_object_type:n,position_is_after:i,parentFolderId:o,workspaceId:r,accountProductId:s}=e;if(!!a!=!!n)throw new Error("position_object_id and position_object_type must be provided together");const d={folderId:t,position:a?{position_is_after:i,position_object_id:a,position_object_type:n}:void 0,parentFolderId:o,workspaceId:r,accountProductId:s},p=await this.mondayApi.request(ug,d);return{content:{message:"Object moved",object_id:p.update_folder?.id}}}async executeUpdateBoardHierarchy(e){const{id:t,position_object_id:a,position_object_type:n,position_is_after:i,parentFolderId:o,workspaceId:r,accountProductId:s}=e;if(!!a!=!!n)throw new Error("position_object_id and position_object_type must be provided together");const d={boardId:t,attributes:{position:a?{position_is_after:i,position_object_id:a,position_object_type:n}:void 0,folder_id:o,workspace_id:r,account_product_id:s}},p=await this.mondayApi.request(yg,d);return p.update_board_hierarchy?.success?{content:{message:"Board position updated",object_id:p.update_board_hierarchy?.board?.id,action_name:"move_board"}}:{content:`Board position update failed: ${p.update_board_hierarchy?.message}`}}async executeUpdateOverviewHierarchy(e){const{id:t,position_object_id:a,position_object_type:n,position_is_after:i,parentFolderId:o,workspaceId:r,accountProductId:s}=e;if(!!a!=!!n)throw new Error("position_object_id and position_object_type must be provided together");const d={overviewId:t,attributes:{position:a?{position_is_after:i,position_object_id:a,position_object_type:n}:void 0,folder_id:o,workspace_id:r,account_product_id:s}},p=await this.mondayApi.request(vg,d);return p.update_overview_hierarchy?.success?{content:{message:"Overview position updated",object_id:p.update_overview_hierarchy?.overview?.id}}:{content:`Overview position update failed: ${p.update_overview_hierarchy?.message}`}}async executeInternal(e){const{objectType:t}=e;switch(t){case zs.Folder:return this.executeUpdateFolder(e);case zs.Board:return this.executeUpdateBoardHierarchy(e);case zs.Overview:return this.executeUpdateOverviewHierarchy(e);default:throw new Error(`Unsupported object type: ${t}`)}}},class extends ce{constructor(){super(...arguments),this.name="create_dashboard",this.type=f.WRITE,this.annotations=le({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 pg}async executeInternal(e){try{const t={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()},a=await this.mondayApi.request(rg,t);if(!a.create_dashboard)throw new Lc("Failed to create dashboard",Cc);const n=a.create_dashboard;return{content:{message:`Dashboard ${n.id} successfully created`,dashboard_id:n.id,dashboard_name:n.name}}}catch(e){Uc(e,"create dashboard")}}},class extends ce{constructor(){super(...arguments),this.name="all_widgets_schema",this.type=f.READ,this.annotations=le({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={},t=await this.mondayApi.request(sg,e);if(!t.all_widgets_schema||0===t.all_widgets_schema.length)throw new Error("No widget schemas found - API returned empty response");const a={};let n=0;for(const e of t.all_widgets_schema)if(e?.widget_type&&e?.schema){const t="string"==typeof e.schema?JSON.parse(e.schema):e.schema,i=t?.description||t?.title||`${e.widget_type} widget for data visualization`;a[e.widget_type]={type:e.widget_type,description:i,schema:e.schema},n++}if(0===n)throw new Error("No valid widget schemas found in API response");Object.keys(a).map((e=>`• **${e}**: ${a[e].description}`)).join("\n");return{content:{message:"Widgets schema",data:a,url:__}}}catch(e){const t=e instanceof Error?e.message:String(e);throw new Error(`Failed to fetch widget schemas: ${t}`)}}},class extends ce{constructor(){super(...arguments),this.name="create_widget",this.type=f.WRITE,this.annotations=le({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 lg}async executeInternal(e){if(!e.settings)throw new Lc("You must pass the settings parameter",kc);try{const t={parent:{kind:e.parent_container_type,id:e.parent_container_id.toString()},kind:e.widget_kind,name:e.widget_name,settings:e.settings},a=await this.mondayApi.request(dg,t);if(!a.create_widget)throw new Lc("Failed to create widget",Cc);const n=a.create_widget;n.parent?.kind===Op.Dashboard?n.parent.id:n.parent;return{content:{message:`Widget ${n.id} created`,widget_id:n.id,widget_name:n.name,dashboard_id:n.parent?.id}}}catch(t){Uc(t,`create ${e.widget_kind} widget`)}}},class extends ce{constructor(){super(...arguments),this.name="board_insights",this.type=f.READ,this.annotations=le({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 with filters.columns.only to get column metadata without fetching views. 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 Ng}async executeInternal(e){if(!e.aggregations)return{content:'Input must contain the "aggregations" field.'};const{selectElements:t,groupByElements:a}=function(e){const t={},a=e.groupBy?.map((e=>({column_id:e})))||[],n=new Set(e.aggregations.filter((e=>e.function===ki.Label)).map((e=>e.columnId))),i=e.groupBy?.filter((e=>!n.has(e))).map((e=>({function:ki.Label,columnId:e})))??[],o=e.aggregations.concat(i).map((e=>{if(e.function){const o=`${e.function}_${e.columnId}`,r=t[o]||0;t[o]=r+1;const s=`${o}_${r}`;return Ag.has(e.function)&&(a.some((e=>e.column_id===s))||a.push({column_id:s})),{type:Ci.Function,function:(n=e.function,i=e.columnId,{function:n,params:n===ki.CountItems?[]:[{type:Ci.Column,column:Sg(i),as:i}]}),as:s}}var n,i;const o={type:Ci.Column,column:Sg(e.columnId),as:e.columnId};return a.some((t=>t.column_id===e.columnId))||a.push({column_id:e.columnId}),o}));return a.forEach((e=>{o.some((t=>t.as===e.column_id))||o.push({type:Ci.Column,column:Sg(e.column_id),as:e.column_id})})),{selectElements:o,groupByElements:a}}(e),n=function(e){if(!e.filters&&!e.orderBy)return;const t={};return e.filters&&(t.rules=e.filters.map((e=>({column_id:e.columnId,compare_value:e.compareValue,operator:e.operator,compare_attribute:e.compareAttribute}))),t.operator=e.filtersOperator),e.orderBy&&(t.order_by=function(e){return e.orderBy?.map((e=>({column_id:e.columnId,direction:e.direction})))}(e)),t}(e),i=function(e){return{id:e.boardId.toString(),type:Ti.Table}}(e),o={query:{from:i,query:n,select:t,group_by:a,limit:e.limit},boardId:String(e.boardId)},r=await this.mondayApi.request(Eg,o),s=(r.aggregate?.results??[]).map((e=>{const t={};return(e.entries??[]).forEach((e=>{const a=e.alias??"";if(!a)return;const n=e.value;if(!n)return void(t[a]=null);const i=n.result??n.value??null;t[a]=i})),t}));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 ce{constructor(){super(...arguments),this.name="search",this.type=f.READ,this.annotations=le({title:"Search",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return`Search within monday.com platform. Supported searchType values: ${d_}.\nsearchTerm is the phrase the search matches against — the text/keywords to look for (e.g. a board name, item title, or a word from an update). It is required and must be non-empty. This tool has no "list everything" mode: to browse or list without a search phrase, use workspace_info (boards/docs/folders in a workspace) or get_board_items_page (items in a board) instead of calling search with an empty searchTerm.\nFor searching/listing specific users and teams, use list_users_and_teams tool.\nFor account-level info (plan, member count, products), use get_user_context tool.\nFor browsing all boards, docs, or folders within a workspace without a search term, use workspace_info tool.\nFor groups, use get_board_info tool.\nFor listing items within a specific board, use get_board_items_page tool. ITEMS search here queries items across the account.\nBOARD search returns id, title, url, and workspaceId. Optionally scope it with boardIds.\nDOCUMENTS search returns id, title, workspaceId, and highlights. highlights is an array of { field, fragments } entries (field is "name" or "content") where fragments contain matched text snippets with <em> tags around matched terms. highlights is omitted when no lexical match was made. Optionally scope it with workspaceIds and/or docIds.\nITEMS search returns id, title, url, boardId, and workspaceId. Optionally scope it with workspaceIds, boardIds, and/or creatorIds.\nWORKSPACES search returns id, title, and description.\nUPDATES search returns id, title (the update body), itemId, boardId, and creatorId. Optionally scope it with workspaceIds, boardIds, and/or creatorIds.\nTIMELINE_ITEMS search returns id, title, summary, content, itemId, and boardId. Optionally scope it with workspaceIds and/or boardIds.\nDASHBOARDS search (also called "overviews") returns id, title, and workspaceId. Optionally scope it with workspaceIds and/or creatorIds.\nFOLDERS search returns id and title. Optionally scope it with workspaceIds, which searches all accessible workspaces when omitted. Pass workspaceIds to narrow the search if results may be truncated.\n `}getInputSchema(){return Gg}async executeInternal(e){const{searchTerm:t}=e;if(!t)throw new Lc("searchTerm is required and must be a non-empty search string. To browse or list without a search term, use workspace_info (for boards, docs, and folders in a workspace) or get_board_items_page (for items within a specific board).",kc);try{if(e.searchType===s_.FOLDERS){const{results:a,truncated:n}=await this.searchFoldersAsync(e,t);return{content:{message:n?"Search results (truncated: only the first 100 folders across the searched workspaces were scanned. Narrow with workspaceIds for complete results.)":"Search results",data:a}}}return{content:{message:"Search results",data:await this.runSmartSearchAsync(e,t)}}}catch(e){throw Pc(e),e}}async runSmartSearchAsync(e,t){const a=Bg(e.workspaceIds?.map((e=>e.toString())));if(e.searchType===s_.BOARD){const n=Bg(e.boardIds?.map((e=>e.toString())));return this.searchBoardsAsync(t,e.limit,a,n)}if(e.searchType===s_.DOCUMENTS){const n=Bg(e.docIds?.map((e=>e.toString())));return this.searchDocsAsync(t,e.limit,a,n)}if(e.searchType===s_.WORKSPACES)return this.searchWorkspacesAsync(t,e.limit);if(e.searchType===s_.UPDATES){const n=Bg(e.boardIds?.map((e=>e.toString()))),i=Bg(e.creatorIds?.map((e=>e.toString())));return this.searchUpdatesAsync(t,e.limit,a,n,i)}if(e.searchType===s_.ITEMS){const n=Bg(e.boardIds?.map((e=>e.toString()))),i=Bg(e.creatorIds?.map((e=>e.toString())));return this.searchItemsAsync(t,e.limit,a,n,i)}if(e.searchType===s_.TIMELINE_ITEMS){const n=Bg(e.boardIds?.map((e=>e.toString())));return this.searchTimelineItemsAsync(t,e.limit,a,n)}if(e.searchType===s_.DASHBOARDS){const n=e.creatorIds?.map((e=>e.toString()));return this.searchOverviewsAsync(t,e.limit,a,n)}throw new Lc(`Unsupported search type for smart search: ${e.searchType}`,Oc)}async searchBoardsAsync(e,t,a,n){const i={query:e,limit:t,workspaceIds:a,boardIds:n};return(await this.mondayApi.request(Rg,i,{timeout:qc})).search.boards.results.map((e=>({id:e.indexed_data.id,title:e.indexed_data.name,url:e.indexed_data.url,workspaceId:e.indexed_data.workspace_id??void 0})))}async searchDocsAsync(e,t,a,n){const i={query:e,limit:t,workspaceIds:a,docIds:n};return(await this.mondayApi.request(Cg,i,{timeout:qc})).search.docs.results.map((e=>({id:e.indexed_data.id,title:e.indexed_data.name,workspaceId:e.indexed_data.workspace_id??void 0,highlights:zg(e.indexed_data.highlights)})))}async searchWorkspacesAsync(e,t){const a={query:e,limit:t};return(await this.mondayApi.request(kg,a,{timeout:qc})).search.workspaces.results.map((e=>({id:e.indexed_data.id,title:e.indexed_data.name,description:e.indexed_data.description||void 0})))}async searchUpdatesAsync(e,t,a,n,i){const o={query:e,limit:t,workspaceIds:a,boardIds:n,creatorIds:i};return(await this.mondayApi.request(Lg,o,{timeout:qc})).search.updates.results.map((e=>({id:e.indexed_data.id,title:e.indexed_data.body,itemId:e.indexed_data.item_id,boardId:e.indexed_data.board_id,creatorId:e.indexed_data.creator_id})))}async searchItemsAsync(e,t,a,n,i){return(i?await this.mondayApi.request(Pg,{query:e,limit:t,workspaceIds:a,boardIds:n,creatorIds:i},{versionOverride:"dev",timeout:qc}):await this.mondayApi.request(Og,{query:e,limit:t,workspaceIds:a,boardIds:n},{timeout:qc})).search.items.results.map((e=>({id:e.indexed_data.id,title:e.indexed_data.name,url:e.indexed_data.url,boardId:e.indexed_data.board_id??void 0,workspaceId:e.indexed_data.workspace_id??void 0})))}async searchTimelineItemsAsync(e,t,a,n){const i={query:e,limit:t,workspaceIds:a,boardIds:n};return(await this.mondayApi.request(Ug,i,{timeout:qc})).search.timeline_items.results.map((e=>({id:e.indexed_data.id,title:e.indexed_data.title,summary:e.indexed_data.summary||void 0,content:e.indexed_data.content||void 0,itemId:e.indexed_data.item_id,boardId:e.indexed_data.board_id??void 0})))}async searchOverviewsAsync(e,t,a,n){const i={query:e,limit:t,workspaceIds:a,creatorIds:n};return(await this.mondayApi.request($g,i,{versionOverride:"dev",timeout:qc})).search.overviews.results.map((e=>({id:e.indexed_data.id,title:e.indexed_data.name,workspaceId:e.indexed_data.workspace_id??void 0})))}async searchFoldersAsync(e,t){const a=xg(t);if(!a)return{results:[],truncated:!1};const n={page:1,limit:100,workspace_ids:Bg(e.workspaceIds?.map((e=>e.toString())))},i=(await this.mondayApi.request(Dg,n)).folders||[];return{results:i.filter((e=>e?.name&&xg(e.name).includes(a))).filter((e=>e?.id)).slice(0,e.limit).map((e=>({id:e.id,title:e.name}))),truncated:100===i.length}}},class extends ce{constructor(){super(...arguments),this.name="get_user_context",this.type=f.READ,this.annotations=le({title:"Get User Context",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Fetch current user information, account information, and their relevant items (boards, docs, folders, workspaces, dashboards).\n\n Use this tool to:\n - Get context about who the current user is (id, name, title)\n - Get account info: plan tier, active member count, trial status, and active products\n - Get the number of active members in the account (returns active_members_count)\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 docs based on load 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:t,intelligence:a}=await this.mondayApi.request(eb,{},{versionOverride:"dev"});if(!e)return{content:"AUTHENTICATION_ERROR: Unable to fetch current user. Verify API token and user permissions."};const n=await this.fetchFavorites(t||[]),i=this.extractRelevantBoards(a),o=this.extractRelevantDocs(a),r=this.extractRelevantPeople(a),{account:s,...d}=e;return{content:{message:"User context",...{user:d,account:s?{tier:s.tier,active_members_count:s.active_members_count,is_during_trial:s.is_during_trial,products:s.products?.filter(Boolean).map((e=>({kind:e.kind,tier:e.tier})))??[]}:null,favorites:n,relevantBoards:i,relevantDocs:o,relevantPeople:r}}}}async fetchFavorites(e){const t=this.groupByType(e),a=Object.keys(t);if(0===a.length)return[];const n={};for(const e of a)n[ab[e]]=t[e];const i=await this.mondayApi.request(tb,n),o=[];for(const e of a){const t=nb[e];for(const a of i[t]??[])a?.id&&o.push({id:a.id,name:a.name,type:e})}return o}extractRelevantBoards(e){if(!e?.relevant_boards)return[];const t=[];for(const a of e.relevant_boards)a?.id&&a?.board?.name&&t.push({id:a.id,name:a.board.name});return t}extractRelevantDocs(e){if(!e?.relevant_docs)return[];const t=[];for(const a of e.relevant_docs)a?.id&&a?.document?.name&&t.push({id:a.id,name:a.document.name,objectId:a.object_id});return t}extractRelevantPeople(e){if(!e?.relevant_people)return[];const t=[];for(const a of e.relevant_people)a?.id&&a?.user?.name&&t.push({id:a.id,name:a.user.name});return t}groupByType(e){const t={};for(const a of e){const e=a?.object;e?.id&&e?.type&&(t[e.type]??=[]).push(e.id)}return t}},class extends ce{constructor(){super(...arguments),this.name="update_assets_on_item",this.type=f.WRITE,this.annotations=le({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 Jg}async executeInternal(e){const t={boardId:e.boardId,itemId:e.itemId,columnId:e.columnId,files:e.files},a=await this.mondayApi.request(Kg,t);return{content:`Item ${a.update_assets_on_item?.id} (${a.update_assets_on_item?.name}) assets successfully updated`}}},class extends ce{constructor(){super(...arguments),this.name="get_assets",this.type=f.READ,this.annotations=le({title:"Get Assets",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get assets (files) by their IDs. Returns file metadata including name, extension, size, public URL (valid for 1 hour), thumbnail URL, upload date, and who uploaded it."}getInputSchema(){return Zg}async executeInternal(e){const t=await this.mondayApi.request(Xg,{ids:e.ids}),a=t.assets?.filter(Boolean);if(!a||0===a.length)return{content:`No assets found for the provided IDs: ${e.ids.join(", ")}`};return{content:{results:a.map((e=>({id:e.id,name:e.name,file_extension:e.file_extension,file_size:e.file_size,public_url:e.public_url,url:e.url,url_thumbnail:e.url_thumbnail??null,created_at:e.created_at??null,original_geometry:e.original_geometry??null,uploaded_by:e.uploaded_by})))}}}},class extends ce{constructor(){super(...arguments),this.name="create_view",this.type=f.WRITE,this.annotations=le({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\n[REQUIRED PRECONDITION]: If you pass filters or sorting, call get_board_info first with filters.columns.only to get the board column IDs, column types, and status label indexes without fetching views. Filter rules reference real column IDs and, for status columns, numeric label indexes — do not guess them. Before sending the filters, use get_column_type_info with fetchMode "${cm.Guidelines}" and use data.guidelines.filter (null if that type has no documented rules).\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 wm}async executeInternal(e){const t={boardId:e.boardId,type:e.type,name:e.name,filter:e.filter,sort:e.sort,settings:e.settings},a=await this.mondayApi.request(Tm,t);return a.create_view?{content:`View "${a.create_view.name}" (ID: ${a.create_view.id}, type: ${a.create_view.type}) successfully created`}:{content:"Failed to create view - no response from API"}}},class extends ce{constructor(){super(...arguments),this.name="update_view",this.type=f.WRITE,this.annotations=le({title:"Update View",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return`Update an existing board view (tab) — change its name, filter rules, or sort order. Provide only the fields you want to change. Omitted fields are left unchanged.\n\n[REQUIRED PRECONDITION]: Call get_board_info first — it returns the board views (so you can resolve the viewId, including from a view name the user mentioned) along with the column IDs, column types, and status label indexes that filter and sort rules reference. When the user named specific views, pass those names as get_board_info.filters.views.names to avoid fetching every view on large boards. If you pass filters, also use get_column_type_info with fetchMode "${cm.Guidelines}" and use data.guidelines.filter (null if that type has no documented rules) before sending them — do not guess compare_value/operator rules per column type.\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 Sm}async executeInternal(e){const t={viewId:e.viewId,boardId:e.boardId,type:e.type,name:e.name,filter:e.filter,sort:e.sort,settings:e.settings},a=await this.mondayApi.request(Am,t);return a.update_view?{content:`View "${a.update_view.name}" (ID: ${a.update_view.id}, type: ${a.update_view.type}) successfully updated`}:{content:"Failed to update view - no response from API"}}},class extends ce{constructor(){super(...arguments),this.name="create_view_table",this.type=f.WRITE,this.annotations=le({title:"Create Table View",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return`Create a new table-type board view with optional filters, sort, tags, and table-specific settings (column visibility/order and group-by). Use this instead of create_view when you need to configure table-specific settings. For a simple table view, create_view also works.\n\n[REQUIRED PRECONDITION]: Call get_board_info first with filters.columns.only to get the board column IDs, column types, and status label indexes without fetching views. Filters, sort, column_properties, column_order, and group_by all reference real column IDs — do not guess them. This is required even if you are not passing filters, since column_properties/column_order/group_by need real column IDs too. If you pass filters, also use get_column_type_info with fetchMode "${cm.Guidelines}" and use data.guidelines.filter (null if that type has no documented rules) before sending them — do not guess compare_value/operator rules per column type.\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 settings.columns: { "column_properties": [{ "column_id": "status", "visible": true }], "column_order": ["name", "status", "date"] }\nExample settings.group_by: { "conditions": [{ "columnId": "status" }], "hideEmptyGroups": true }`}getInputSchema(){return Rm}async executeInternal(e){const t={boardId:e.boardId,name:e.name,filter:e.filter,sort:e.sort,tags:e.tags,settings:e.settings},a=await this.mondayApi.request(Nm,t);return a.create_view_table?{content:`Table view "${a.create_view_table.name}" (ID: ${a.create_view_table.id}, type: ${a.create_view_table.type}) successfully created`}:{content:"Failed to create table view - no response from API"}}},class extends ce{constructor(){super(...arguments),this.name="update_view_table",this.type=f.WRITE,this.annotations=le({title:"Update Table View",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return`Update an existing table-type board view — change its name, filters, sort, tags, or table-specific settings (column visibility/order and group-by). Provide only the fields you want to change. Omitted fields are left unchanged.\n\n[REQUIRED PRECONDITION]: Call get_board_info first — it returns the board views (so you can resolve the viewId, including from a view name the user mentioned) along with the column IDs, column types, and status label indexes that filters, sort, column_properties, column_order, and group_by reference. When the user named specific views, pass those names as get_board_info.filters.views.names to avoid fetching every view on large boards. If you pass filters, also use get_column_type_info with fetchMode "${cm.Guidelines}" and use data.guidelines.filter (null if that type has no documented rules) before sending them — do not guess compare_value/operator rules per column type.\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 settings.columns: { "column_properties": [{ "column_id": "status", "visible": true }], "column_order": ["name", "status", "date"] }\nExample settings.group_by: { "conditions": [{ "columnId": "status" }], "hideEmptyGroups": true }`}getInputSchema(){return Um}async executeInternal(e){const t={viewId:e.viewId,boardId:e.boardId,name:e.name,filter:e.filter,sort:e.sort,tags:e.tags,settings:e.settings},a=await this.mondayApi.request(Cm,t);return a.update_view_table?{content:`Table view "${a.update_view_table.name}" (ID: ${a.update_view_table.id}, type: ${a.update_view_table.type}) successfully updated`}:{content:"Failed to update table view - no response from API"}}},class extends ce{constructor(){super(...arguments),this.name="undo_action",this.type=f.WRITE,this.annotations=le({title:"Undo Action",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Undo a previous action on a board using its action_record_uuid. Supports undoing column changes, deletes, archives, moves, duplicates, and more. Use get_board_activity with includeData=true to find the action_record_uuid."}getInputSchema(){return ob}async executeInternal(e){return await this.mondayApi.request(ib,{boardId:e.boardId.toString(),undoRecordId:e.undoRecordId},{versionOverride:"dev"}),{content:`Successfully undid action "${e.undoRecordId}" on board ${e.boardId}.`}}},class extends ce{constructor(){super(...arguments),this.name="get_object_schemas",this.type=f.READ,this.annotations=le({title:"Get Object Schemas",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Retrieve account-level object schemas by their IDs or names. Schemas define the structure and columns of boards. Provide ids or names to filter specific schemas. Omit both to list all schemas (paginated). Call this FIRST to resolve schema ids, column ids, and the current revision before any tool that modifies an existing schema: update_object_schema (which requires the revision returned here), manage_object_schema_columns with action=update, set_object_schema_column_active_state, delete_object_schema_columns, delete_object_schema, and manage_object_schema_board_connection."}getInputSchema(){return Zc}async executeInternal(e){const t={ids:e.ids,names:e.names,limit:e.limit,page:e.page,excludeCreatedByMonday:e.excludeCreatedByMonday},a=(await this.mondayApi.request(Xc,t)).get_object_schemas??[];return{content:{message:`Retrieved ${a.length} object schema(s)`,schemas:a}}}},class extends ce{constructor(){super(...arguments),this.name="create_object_schema",this.type=f.WRITE,this.annotations=le({title:"Create Object Schema",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new account-level object schema. Schemas define the structure and columns of boards. If you are nesting this schema under an existing one, call get_object_schemas first to resolve parentId. This tool creates the schema only — add its columns afterwards with manage_object_schema_columns, and attach boards with manage_object_schema_board_connection."}getInputSchema(){return tm}async executeInternal(e){const t={name:e.name,parentId:e.parentId,description:e.description},a=await this.mondayApi.request(em,t);return{content:{message:`Object schema "${a.create_object_schema?.name}" successfully created`,schema_id:a.create_object_schema?.id,schema_name:a.create_object_schema?.name,revision:a.create_object_schema?.revision}}}},class extends ce{constructor(){super(...arguments),this.name="update_object_schema",this.type=f.WRITE,this.annotations=le({title:"Update Object Schema",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Update an account-level object schema. Requires the current revision number for optimistic locking — retrieve it first via get_object_schemas."}getInputSchema(){return nm}async executeInternal(e){const t={id:e.id,revision:e.revision,parentId:e.parentId,description:e.description},a=await this.mondayApi.request(am,t);return{content:{message:`Object schema "${a.update_object_schema?.name}" successfully updated`,schema_id:a.update_object_schema?.id,schema_name:a.update_object_schema?.name,revision:a.update_object_schema?.revision}}}},class extends ce{constructor(){super(...arguments),this.name="delete_object_schema",this.type=f.WRITE,this.annotations=le({title:"Delete Object Schema",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an account-level object schema. Only allowed when no boards are connected to the schema. Provide either id or name."}getInputSchema(){return om}async executeInternal(e){if(!e.id&&!e.name)throw new Error("Either id or name must be provided");const t={id:e.id,name:e.name},a=await this.mondayApi.request(im,t);return{content:{message:`Object schema "${a.delete_object_schema?.name}" successfully deleted`,schema_id:a.delete_object_schema?.id,schema_name:a.delete_object_schema?.name}}}},class extends ce{constructor(){super(...arguments),this.name="delete_object_schema_columns",this.type=f.WRITE,this.annotations=le({title:"Delete Object Schema Columns",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Permanently delete columns from an account-level object schema. Only allowed when no boards are connected to the schema. Use manage_object_schema_column with action=deactivate for a reversible alternative. [REQUIRED PRECONDITION]: Call get_object_schemas first to resolve the schema id and the exact column ids — this deletion is irreversible, so never guess ids."}getInputSchema(){return sm}async executeInternal(e){if(!e.objectSchemaId&&!e.objectSchemaName)throw new Error("Either objectSchemaId or objectSchemaName must be provided");const t={objectSchemaId:e.objectSchemaId,objectSchemaName:e.objectSchemaName,columnIds:e.columnIds},a=await this.mondayApi.request(rm,t,{versionOverride:"dev"});return{content:{message:`${e.columnIds.length} column(s) successfully deleted from object schema "${a.delete_object_schema_columns?.name}"`,schema_id:a.delete_object_schema_columns?.id,schema_name:a.delete_object_schema_columns?.name,revision:a.delete_object_schema_columns?.revision}}}},class extends ce{constructor(){super(...arguments),this.name="manage_object_schema_board_connection",this.type=f.WRITE,this.annotations=le({title:"Manage Object Schema Board Connection",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Connect or detach a board from an account-level object schema. connect: attaches a board to an object schema so it inherits the schema column structure. detach: removes one or more boards from their object schema."}getInputSchema(){return lm}async executeInternal(e){if("connect"===e.action){if(!e.boardId)throw new Error("boardId is required for action=connect");if(!e.objectSchemaId&&!e.objectSchemaName)throw new Error("Either objectSchemaId or objectSchemaName must be provided for action=connect");const t={boardId:e.boardId,objectSchemaId:e.objectSchemaId,objectSchemaName:e.objectSchemaName},a=await this.mondayApi.request(dm,t);return{content:{message:"Board successfully connected to object schema",connection_id:a.connect_board_to_object_schema?.id,schema_id:a.connect_board_to_object_schema?.object_schema_id}}}{if(!e.boardIds?.length)throw new Error("boardIds is required for action=detach");const t={boardIds:e.boardIds},a=(await this.mondayApi.request(pm,t)).detach_boards_from_object_schema??[],n=a.filter((e=>e.success)).length,i=a.filter((e=>!e.success));return{content:{message:`${n} board(s) successfully detached`,results:a,...i.length>0&&{failures:i}}}}}},class extends ce{constructor(){super(...arguments),this.name="manage_object_schema_columns",this.type=f.WRITE,this.annotations=le({title:"Manage Object Schema Columns",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return`Create or update columns on an account-level object schema. Column changes are propagated to all boards connected to the schema. create: adds new columns. Each column requires type and title. Call get_column_type_info with fetchMode "${cm.Schema}" first to understand valid defaults per column type. update: modifies existing columns. Each entry must include column_id — call get_object_schemas first to resolve the schema id and the exact column ids. Only send the columns you want to modify — other columns are unaffected. Use opt_out_by_default=true to stop a column from being auto-added to boards (opt out), or opt_out_by_default=false to restore auto-adding (opt in).`}getInputSchema(){return gm}async executeInternal(e){if(!e.objectSchemaId&&!e.objectSchemaName)throw new Error("Either objectSchemaId or objectSchemaName must be provided");if("create"===e.action){const t=e.columns.map((e=>{const t=e;return{type:t.type,title:t.title,description:t.description,defaults:t.defaults,opt_out_by_default:t.opt_out_by_default,policy:{can_override:t.policy?.can_override??[],cannot_delete:t.policy?.cannot_delete??!1}}})),a={objectSchemaId:e.objectSchemaId,objectSchemaName:e.objectSchemaName,columns:t},n=await this.mondayApi.request(mm,a);return{content:{message:`Columns successfully added to object schema "${n.create_object_schema_columns?.name}"`,schema_id:n.create_object_schema_columns?.id,schema_name:n.create_object_schema_columns?.name,revision:n.create_object_schema_columns?.revision}}}{const t={objectSchemaId:e.objectSchemaId,objectSchemaName:e.objectSchemaName,columns:e.columns.map((e=>{const t=e;return{column_id:t.column_id,title:t.title,description:t.description,defaults:t.defaults,opt_out_by_default:t.opt_out_by_default,policy:t.policy?{can_override:t.policy.can_override??[],cannot_delete:t.policy.cannot_delete??!1}:void 0}}))},a=await this.mondayApi.request(um,t);return{content:{message:`Columns successfully updated on object schema "${a.update_object_schema_columns?.name}"`,schema_id:a.update_object_schema_columns?.id,schema_name:a.update_object_schema_columns?.name,revision:a.update_object_schema_columns?.revision}}}}},class extends ce{constructor(){super(...arguments),this.name="set_object_schema_column_active_state",this.type=f.WRITE,this.annotations=le({title:"Set Object Schema Column Active State",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Set the active state of a column on an account-level object schema. [REQUIRED PRECONDITION]: Call get_object_schemas first to resolve the schema id, the column id, and its current active state. deactivate: soft-disables the column, preventing it from being used on new boards. The column is not deleted and can be restored. reactivate: restores a previously deactivated column, making it available again."}getInputSchema(){return ym}async executeInternal(e){if(!e.objectSchemaId&&!e.objectSchemaName)throw new Error("Either objectSchemaId or objectSchemaName must be provided");const t={deactivate:qo.Deactivate,reactivate:qo.Reactivate},a={objectSchemaId:e.objectSchemaId,objectSchemaName:e.objectSchemaName,columnId:e.columnId,action:t[e.action]},n=await this.mondayApi.request(bm,a);return{content:{message:`Column successfully ${e.action}d on object schema "${n.set_object_schema_column_active_state?.name}"`,schema_id:n.set_object_schema_column_active_state?.id,schema_name:n.set_object_schema_column_active_state?.name,revision:n.set_object_schema_column_active_state?.revision}}}},class extends ce{constructor(){super(...arguments),this.name="get_asset_upload_url",this.type=f.WRITE,this.annotations=le({title:"Get Asset Upload URL",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Get a presigned URL to upload a file to monday.com. Returns an upload_id and upload_url.\n\nOnly call this tool if you can execute a direct HTTP PUT with binary file data and read response headers (e.g. via shell/curl). If you can\'t, tell the user direct file upload isn\'t supported here — don\'t call this tool.\n\nAfter calling this tool, upload the file to the returned URL using an HTTP PUT request and capture the ETag header from the response:\n\ncurl -i -X PUT "<upload_url>" \\\n -H "Content-Type: <the contentType you provided>" \\\n --data-binary @<local_file_path>\n\nThe response includes an ETag header (e.g. ETag: "abc123...") — save this value.\n\nThen call finalize_asset_upload with the upload_id, etag, board_id, item_id, and column_id to complete the upload and attach the file to an item\'s file column.\n\nMax file size: 500MB.'}getInputSchema(){return sb}async executeInternal(e){const t=(await this.mondayApi.request(rb,{input:{file_name:e.fileName,content_type:e.contentType,file_size:e.fileSize,source:"mcp",multipart:!1}},{versionOverride:"dev"})).create_upload,a=t.parts[0]?.url;if(!a)throw new Error("create_upload returned no upload URL — parts array was empty");return{content:{upload_id:t.upload_id,upload_url:a,url_expires_at:t.expires_at}}}},class extends ce{constructor(){super(...arguments),this.name="finalize_asset_upload",this.type=f.WRITE,this.annotations=le({title:"Finalize Asset Upload",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Finalize a file upload and create the asset on monday.com. Call this after uploading the file to the presigned URL from get_asset_upload_url. Requires the etag value from the PUT response headers. Automatically attaches the uploaded asset to the specified file column on the item. Returns the created asset_id."}getInputSchema(){return lb}async executeInternal(e){const t=(await this.mondayApi.request(db,{input:{upload_id:e.uploadId,holder:{type:"ITEM",id:e.itemId},board_id:e.boardId,parts:[{part_number:1,etag:e.etag}]}},{versionOverride:"dev"})).complete_upload,a=JSON.stringify({added_file:{fileType:"ASSET",name:t.filename,assetId:String(t.id)}});return await this.mondayApi.request(pb,{boardId:e.boardId,itemId:e.itemId,columnId:e.columnId,value:a}),{content:{asset_id:t.id,filename:t.filename,content_type:t.content_type,file_size:t.file_size,url:t.url,filelink:t.filelink}}}},class extends ce{constructor(){super(...arguments),this.name="link_board_items_workflow",this.type=f.READ,this.annotations=le({title:"Link Board Items Workflow",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Get the required playbook for linking items across boards via board-relation columns. When to use: any board-relation / cross-board linking task. **Hard gate — you MUST call this BEFORE get_board_items_page, or change_item_column_values in the same turn. No discovery, matching, or write happens first.** Triggers: **link** or **connect** items **across boards** (board-relation / "connect boards" / pairs) — also vague phrasings where only one side is named ("link this to **an** item on another board", "**the matching** row"). This tool is read-only (no API).'}getInputSchema(){return mb}async executeInternal(e){return{content:cb}}},class extends ce{constructor(){super(...arguments),this.name="fetch_file_content",this.type=f.READ,this.annotations=le({title:"Fetch File Content",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Fetch and extract the text content from a file stored in a monday.com files column.\n\nUse this tool when you need to read, summarize, or analyze the content of files attached to board items. Provide the item ID and column ID from the get_board_items_page response — the column value will be a URL like \"https://monday.com/protected_static/...\" indicating a file is present (null means no file).\n\nPROACTIVE USE: If you retrieve board items and notice a files column with a non-null value (a URL), consider fetching its content if it could help answer the user's question — don't wait to be explicitly asked.\n\nSupported file types and what is returned:\n- Text files (.txt, .md, .csv, .json): raw text content\n- Word documents (.docx): extracted text content\n- PDF files (.pdf): extracted text content\n- Excel files (.xlsx, .xls): extracted text content per sheet\n- Images (.png, .jpg, .gif, .webp, .svg, .bmp, .ico): returns the public URL so you can view or analyze the image directly\n\nText responses include a total_length field. If has_more is true, the content was truncated — you can call this tool again with next_offset if you need the remaining content.\n\nWhen to use:\n- User asks to summarize, read, or analyze the content of a file in a files column\n- User asks questions about what is inside a file (e.g., \"what does the PDF say?\")\n- User wants to extract data from a CSV or Excel file attached to a board item\n- A board item has a files column with a non-null value and the user's question may be answered by its content — even if the user didn't explicitly ask to read the file\n\nWhen NOT to use:\n- The files column value is null (no file uploaded for that item)"}getInputSchema(){return Eb}async executeInternal(e){const{item_id:t,column_id:a,file_name:n,offset:i=0}=e,o=await this.mondayApi.request(ub,{itemId:t,columnId:a}),r=o?.items?.[0]?.assets;if(!r||0===r.length)return{content:{message:`No file found for item ${t} in column ${a}. The column may be empty or the column ID may be incorrect.`}};return{content:{files:await Promise.all(r.map((e=>Ab(e,i,n))))}}}},class extends ce{constructor(){super(...arguments),this.name="manage_agent",this.type=f.WRITE,this.annotations=le({title:"Manage monday Platform Agent",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return'Full lifecycle management for monday platform agents — create, read, update, delete, change state, and run.\n\nmonday platform agents are user-built work orchestrators on monday.com — each has a profile (name, role, avatar), a goal, and a markdown execution plan. Agents in state ACTIVE can be triggered automatically. They are NOT local LangChain or MCP agents.\n\nACTIONS (only pass fields that apply to the chosen action):\n- create: { action:"create", prompt, agent_model? } — AI-generated agent. Platform creates profile, goal, and plan from the prompt.\n- create_blank: { action:"create_blank", name?, role?, role_description?, avatar_url?, gender?, background_color?, user_prompt? } — manually defined agent.\n- get one: { action:"get", agent_id }\n- list owned: { action:"get" }\n- update: { action:"update", agent_id, name?, role?, role_description?, plan?, agent_model? }\n- delete: { action:"delete", agent_id }\n- activate: { action:"activate", agent_id }\n- deactivate: { action:"deactivate", agent_id }\n- run: { action:"run", agent_id }\n\nRULES:\n- "create_blank" with no fields creates a nameless blank agent — only do this intentionally.\n- "update" requires at least one of name/role/role_description/plan/agent_model.\n- "update", "delete", "activate", "deactivate", "run" all require "agent_id".\n- Created agents start INACTIVE. Follow with action:"activate" using the returned agent_id before they can be triggered.\n- ⚠️ DESTRUCTIVE — "delete" is permanent and irreversible. When the user refers to an agent by name, ALWAYS call action:"get" first to confirm the correct agent_id before deleting.\n- "run" is fire-and-forget. Returns trigger_uuid — no run-status query exists, treat successful enqueue as the only signal.\n- Agent state is one of ACTIVE, INACTIVE, ARCHIVED, or FAILED. DELETED only appears as the return value of action:"delete".\n\nUSAGE EXAMPLES:\n- AI create: { "action": "create", "prompt": "Run my daily standup every weekday at 9am." }\n- Manual create:{ "action": "create_blank", "name": "Standup Bot", "role": "Project Manager", "gender": "female" }\n- Fetch one: { "action": "get", "agent_id": "42" }\n- List mine: { "action": "get" }\n- Rename: { "action": "update", "agent_id": "7", "name": "New Name" }\n- Activate: { "action": "activate", "agent_id": "7" }\n- Deactivate: { "action": "deactivate", "agent_id": "7" }\n- Run: { "action": "run", "agent_id": "7" }\n- Delete: { "action": "delete", "agent_id": "7" }\n\nRELATED TOOLS:\n- agent_catalog — browse available trigger types and skills before wiring them to an agent\n- manage_agent_triggers — manage which triggers fire this agent automatically\n- manage_agent_skills — manage which skills this agent can perform\n- manage_agent_knowledge — manage which boards/docs this agent has access to'}getInputSchema(){return jw}async executeInternal(e){switch(e.action){case"create":return this.handleCreate(e);case"create_blank":return this.handleCreateBlank(e);case"get":return this.handleGet(e);case"update":return this.handleUpdate(e);case"delete":return this.handleDelete(e);case"activate":return this.handleActivate(e);case"deactivate":return this.handleDeactivate(e);case"run":return this.handleRun(e)}}async handleCreate(e){if(!e.prompt)throw new Error('manage_agent action:"create" requires "prompt". For a manually configured agent, use action:"create_blank".');try{const t={input:{prompt:e.prompt,agent_model:e.agent_model}},a=await this.mondayApi.request(Ow,t,{versionOverride:"dev"});if(!a.create_agent?.id)throw new Error("monday platform agent creation returned no id");return{content:{message:`monday platform agent ${a.create_agent.id} created in state INACTIVE — call manage_agent with action:"activate" and agent_id:"${a.create_agent.id}" to activate it`,agent:a.create_agent}}}catch(e){Uc(e,"create monday platform agent")}}async handleCreateBlank(e){try{const t={};void 0!==e.name&&(t.name=e.name),void 0!==e.role&&(t.role=e.role),void 0!==e.role_description&&(t.role_description=e.role_description),void 0!==e.avatar_url&&(t.avatar_url=e.avatar_url),void 0!==e.gender&&(t.gender=e.gender),void 0!==e.background_color&&(t.background_color=e.background_color),void 0!==e.user_prompt&&(t.user_prompt=e.user_prompt);const a={input:t},n=await this.mondayApi.request(Rw,a,{versionOverride:"dev"});if(!n.create_blank_agent?.id)throw new Error("monday platform agent creation returned no id");return{content:{message:`monday platform agent ${n.create_blank_agent.id} created in state INACTIVE — call manage_agent with action:"activate" and agent_id:"${n.create_blank_agent.id}" to activate it`,agent:n.create_blank_agent}}}catch(e){Uc(e,"create blank monday platform agent")}}async handleGet(e){if(void 0!==e.agent_id)try{const{custom_agents:t}=await this.mondayApi.request(Dw,{ids:[e.agent_id]},{versionOverride:"dev"}),a=t?.[0];return a?{content:{message:"monday platform agent",agent:a}}:{content:`monday platform agent ${e.agent_id} not found, or the authenticated user does not have access to it.`}}catch(e){Uc(e,"get monday platform agent")}try{const{custom_agents:e}=await this.mondayApi.request(Dw,{limit:100},{versionOverride:"dev"}),t=e??[];return{content:{message:"monday platform agents owned by the authenticated user (limited to 100 — ask the user if they need more)",count:t.length,agents:t}}}catch(e){Uc(e,"list monday platform agents")}}async handleUpdate(e){if(!e.agent_id)throw new Error('manage_agent action:"update" requires "agent_id".');try{const t={};if(void 0!==e.name&&(t.name=e.name),void 0!==e.role&&(t.role=e.role),void 0!==e.role_description&&(t.role_description=e.role_description),void 0!==e.plan&&(t.plan=e.plan),void 0!==e.agent_model&&(t.agent_model=e.agent_model),0===Object.keys(t).length)throw new Error('manage_agent action:"update" requires at least one of: name, role, role_description, plan, agent_model.');const a={id:e.agent_id,input:t},n=await this.mondayApi.request(Cw,a,{versionOverride:"dev"});if(!n.update_agent)throw new Error("update_agent returned no data — the agent may not exist");return{content:{message:"monday platform agent updated",agent:n.update_agent}}}catch(e){Uc(e,"update monday platform agent")}}async handleDelete(e){if(!e.agent_id)throw new Error('manage_agent action:"delete" requires "agent_id".');try{const t={id:e.agent_id},a=await this.mondayApi.request(kw,t,{versionOverride:"dev"});if(!a.delete_agent?.id)throw new Error("monday platform agent delete returned no id");return{content:{message:`monday platform agent ${a.delete_agent.id} deleted`,agent:a.delete_agent}}}catch(e){Uc(e,"delete monday platform agent")}}async handleActivate(e){if(!e.agent_id)throw new Error('manage_agent action:"activate" requires "agent_id".');try{const t=await this.mondayApi.request(Lw,{id:e.agent_id},{versionOverride:"dev"});return{content:{message:"Agent activated.",success:t.activate_agent?.success??!1}}}catch(e){Uc(e,"activate monday platform agent")}}async handleDeactivate(e){if(!e.agent_id)throw new Error('manage_agent action:"deactivate" requires "agent_id".');try{const t={id:e.agent_id,inactive_reason:DI.DeactivatedByUser},a=await this.mondayApi.request(Uw,t,{versionOverride:"dev"});return{content:{message:"Agent deactivated.",success:a.deactivate_agent?.success??!1}}}catch(e){Uc(e,"deactivate monday platform agent")}}async handleRun(e){if(!e.agent_id)throw new Error('manage_agent action:"run" requires "agent_id".');try{const t=await this.mondayApi.request(Pw,{id:e.agent_id},{versionOverride:"dev"});if(!t.run_agent)throw new Error("run_agent returned no data — the agent run may not have been enqueued");return{content:{message:"Agent run enqueued.",trigger_uuid:t.run_agent.trigger_uuid}}}catch(e){Uc(e,"run monday platform agent")}}},class extends ce{constructor(){super(...arguments),this.name="manage_agent_triggers",this.type=f.WRITE,this.annotations=le({title:"Manage monday Platform Agent Triggers",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Manage the triggers attached to a monday platform agent — triggers define WHEN the agent runs automatically.\n\nACTIONS:\n- list: { agent_id } — returns active triggers with node_id, block_reference_id, name, field_summary.\n- add: { agent_id, block_reference_id, field_values? } — attaches a trigger type to the agent.\n- remove: { agent_id, node_id } — detaches a trigger instance by node_id (NOT block_reference_id).\n\nWORKFLOW — add a trigger:\n1. Call agent_catalog action:"list_triggers" — note block_reference_id, field_schemas, and required_fields.\n2. Collect required field values from the user (e.g. board_id, column_id).\n3. Call this tool action:"add" with block_reference_id and field_values.\nNote: add returns only { success } — no node_id for the new instance. Call action:"list" afterward if you need the node_id.\n\nWORKFLOW — remove a trigger:\n1. Call action:"list" to see active triggers and note the node_id of the instance to remove.\n2. Call action:"remove" with that node_id.\n\nNOTE: Only triggers that can be added programmatically appear in the catalog. OAuth/3rd-party triggers (Slack, Gmail, Salesforce, etc.)\nrequire user setup in the monday.com UI — they will not appear in agent_catalog and cannot be managed here.\n\nUSAGE EXAMPLES:\n- List triggers: { "action": "list", "agent_id": "7" }\n- Add trigger: { "action": "add", "agent_id": "7", "block_reference_id": "status-change-ref", "field_values": { "board_id": "42" } }\n- Remove trigger: { "action": "remove", "agent_id": "7", "node_id": "node-abc" }\n\nRELATED TOOLS:\n- agent_catalog action:"list_triggers" — discover available trigger types and their required field_values before calling action:"add" here\n- manage_agent_skills — manage which skills this agent can perform\n- manage_agent — manage the agent entity itself (create, activate, deactivate, etc.)'}getInputSchema(){return Gw}async executeInternal(e){switch(e.action){case"list":return this.handleList(e);case"add":return this.handleAdd(e);case"remove":return this.handleRemove(e)}}async handleList(e){try{const t={agent_id:e.agent_id},a=(await this.mondayApi.request($w,t,{versionOverride:"dev"})).agent_active_triggers??[];return{content:{message:'Active triggers on this agent. Use node_id with action:"remove" to detach a trigger.',count:a.length,triggers:a}}}catch(e){Uc(e,"list active triggers for monday platform agent")}}async handleAdd(e){if(!e.block_reference_id)throw new Error('block_reference_id is required for action:"add". Call agent_catalog action:"list_triggers" first to find the block_reference_id.');try{const t={agent_id:e.agent_id,block_reference_id:e.block_reference_id,field_values:e.field_values},a=await this.mondayApi.request(xw,t,{versionOverride:"dev"});return{content:{message:'Trigger added to agent. Call action:"list" to verify and retrieve the node_id.',success:a.add_trigger_to_agent?.success??!1}}}catch(e){Uc(e,"add trigger to monday platform agent")}}async handleRemove(e){if(!e.node_id)throw new Error('node_id is required for action:"remove". Call action:"list" first to get node_id values.');try{const t={agent_id:e.agent_id,node_id:e.node_id},a=await this.mondayApi.request(Mw,t,{versionOverride:"dev"});return{content:{message:"Trigger removed from agent.",success:a.remove_trigger_from_agent?.success??!1}}}catch(e){Uc(e,"remove trigger from monday platform agent")}}},class extends ce{constructor(){super(...arguments),this.name="manage_agent_skills",this.type=f.WRITE,this.annotations=le({title:"Manage monday Platform Agent Skills",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Manage the full skill lifecycle for monday platform agents — create new skills in the catalog, attach skills to an agent, or detach them.\n\nSkills extend what an agent can do (e.g. sending emails, querying databases, posting to Slack).\n\nACTIONS:\n- create: { name, content, description? } — creates a new custom skill in the account-wide catalog.\n The skill becomes available to all agents in the account.\n- add: { agent_id, skill_id } — attaches a skill to this agent.\n- remove: { agent_id, skill_id } — detaches a skill from this agent.\n\nWORKFLOW — attach an existing skill:\n1. Call agent_catalog action:"list_skills" — find the skill_id of the skill to attach.\n2. Call this tool action:"add" with agent_id and that skill_id.\n\nWORKFLOW — create a new skill and attach it:\n1. Call this tool action:"create" with name and content — note the returned id.\n2. Call this tool action:"add" with agent_id and that id directly (no catalog lookup needed).\n\nNOTE: There is no action to list which skills are currently attached to a specific agent — the platform does not yet expose that query.\nTo browse all skills available in the account catalog, use agent_catalog action:"list_skills".\n\nUSAGE EXAMPLES:\n- Create a skill: { "action": "create", "name": "Send Slack Message", "content": "## Instructions\\nPost a message to a Slack channel.", "description": "Sends a message to Slack" }\n- Add a skill: { "action": "add", "agent_id": "7", "skill_id": "skill-abc-123" }\n- Remove a skill: { "action": "remove", "agent_id": "7", "skill_id": "skill-abc-123" }\n\nRELATED TOOLS:\n- agent_catalog action:"list_skills" — browse existing skills to find a skill_id before calling action:"add"\n- manage_agent_triggers — manage which triggers fire this agent automatically\n- manage_agent — manage the agent entity itself (create, activate, deactivate, etc.)'}getInputSchema(){return Hw}async executeInternal(e){switch(e.action){case"create":return this.handleCreate(e);case"add":return this.handleAdd(e);case"remove":return this.handleRemove(e)}}async handleCreate(e){if(!e.name||!e.content)throw new Error('action:"create" requires both "name" and "content".');try{const t={name:e.name,content:e.content,description:e.description},a=await this.mondayApi.request(qw,t,{versionOverride:"dev"});if(!a.create_agent_skill)throw new Error("create_agent_skill returned no data");return{content:{message:'Skill created and added to the account catalog. Use the returned id with action:"add" to attach it to an agent.',skill:a.create_agent_skill}}}catch(e){Uc(e,"create monday platform agent skill")}}async handleAdd(e){if(!e.agent_id)throw new Error('agent_id is required for action:"add".');if(!e.skill_id)throw new Error('skill_id is required for action:"add". Get it from agent_catalog action:"list_skills" or from action:"create" in this tool.');try{const t={agent_id:e.agent_id,skill_id:e.skill_id},a=await this.mondayApi.request(Vw,t,{versionOverride:"dev"});return{content:{message:"Skill added to agent.",success:a.add_skill_to_agent?.success??!1}}}catch(e){Uc(e,"add skill to monday platform agent")}}async handleRemove(e){if(!e.agent_id)throw new Error('agent_id is required for action:"remove".');if(!e.skill_id)throw new Error('skill_id is required for action:"remove".');try{const t={agent_id:e.agent_id,skill_id:e.skill_id},a=await this.mondayApi.request(Fw,t,{versionOverride:"dev"});return{content:{message:"Skill removed from agent.",success:a.remove_skill_from_agent?.success??!1}}}catch(e){Uc(e,"remove skill from monday platform agent")}}},class extends ce{constructor(){super(...arguments),this.name="manage_agent_knowledge",this.type=f.WRITE,this.annotations=le({title:"Manage monday Platform Agent Knowledge",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'List, grant, update, or revoke a monday platform agent\'s access to boards and docs.\n\nAn agent\'s "knowledge" is the set of monday.com boards and docs it can read from or write to during a run.\n\n- list: Returns all resources the agent currently has access to, including permission level and resource type.\n- add: Grants the agent access to a board or doc with the specified permission level.\n- update: Changes the permission level on a resource the agent already has access to. Call action:"list" first to confirm the resource_id exists.\n- remove: Revokes the agent\'s access to a board or doc entirely. Call action:"list" first to confirm the resource_id exists.\n\nPermission types:\n- READ: Agent can read data from the resource.\n- READ_WRITE: Agent can read and write data to the resource.\n\nUSAGE EXAMPLES:\n- List: { "action": "list", "agent_id": "7" }\n- Add board access: { "action": "add", "agent_id": "7", "resource_id": "42", "scope_type": "BOARD", "permission_type": "READ" }\n- Update to read-write: { "action": "update", "agent_id": "7", "resource_id": "42", "scope_type": "BOARD", "permission_type": "READ_WRITE" }\n- Remove access: { "action": "remove", "agent_id": "7", "resource_id": "42", "scope_type": "BOARD" }\n\nRELATED TOOLS:\n- manage_agent — manage the agent entity itself (create, activate, deactivate, etc.)\n- manage_agent_triggers — manage which triggers fire this agent automatically\n- manage_agent_skills — manage which skills this agent can perform'}getInputSchema(){return Jw}async executeInternal(e){switch(e.action){case"list":return this.handleList(e);case"add":return this.handleAdd(e);case"update":return this.handleUpdate(e);case"remove":return this.handleRemove(e)}}async handleList(e){try{const t=(await this.mondayApi.request(Ww,{id:e.agent_id},{versionOverride:"dev"})).agent_knowledge??{resources:[],files:[]};return{content:{message:"Current agent resource access.",count:t.resources?.length??0,knowledge:t}}}catch(e){Uc(e,"list agent knowledge for monday platform agent")}}async handleAdd(e){if(!e.resource_id||!e.scope_type||!e.permission_type)throw new Error("resource_id, scope_type, and permission_type are required for action:add");try{const t=await this.mondayApi.request(Yw,{id:e.agent_id,resource_id:e.resource_id,scope_type:e.scope_type,permission_type:e.permission_type},{versionOverride:"dev"});return{content:{message:"Resource access granted to agent.",success:t.add_agent_resource_access?.success??!1}}}catch(e){Uc(e,"add agent resource access for monday platform agent")}}async handleUpdate(e){if(!e.resource_id||!e.scope_type||!e.permission_type)throw new Error("resource_id, scope_type, and permission_type are required for action:update");try{const t=await this.mondayApi.request(Qw,{id:e.agent_id,resource_id:e.resource_id,scope_type:e.scope_type,permission_type:e.permission_type},{versionOverride:"dev"});return{content:{message:"Resource access updated.",success:t.update_agent_resource_access?.success??!1}}}catch(e){Uc(e,"update agent resource access for monday platform agent")}}async handleRemove(e){if(!e.resource_id||!e.scope_type)throw new Error("resource_id and scope_type are required for action:remove");try{const t=await this.mondayApi.request(Kw,{id:e.agent_id,resource_id:e.resource_id,scope_type:e.scope_type},{versionOverride:"dev"});return{content:{message:"Resource access removed from agent.",success:t.remove_agent_resource_access?.success??!1}}}catch(e){Uc(e,"remove agent resource access for monday platform agent")}}},class extends ce{constructor(){super(...arguments),this.name="agent_catalog",this.type=f.READ,this.annotations=le({title:"monday Platform Agent Catalog",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Browse the account-wide catalog of available trigger types and skills for monday platform agents. READ-ONLY — no agent_id required.\n\nUse this tool to discover what\'s available BEFORE wiring anything to a specific agent.\n\nACTIONS:\n- list_triggers: { block_reference_ids? } — returns available trigger types.\n Each entry has block_reference_id (required for manage_agent_triggers action:"add"), name, description,\n field_schemas (describes field_values shape), and required_fields (fields to collect from the user).\n Note: only triggers that can be added programmatically appear here. OAuth/3rd-party triggers (Slack, Gmail, Salesforce, etc.)\n require user setup in the monday.com UI and will not appear here.\n\n- list_skills: {} — returns available skills with id, name, description.\n Never guess or invent a skill id — always look it up here before calling manage_agent_skills action:"add".\n\nUSAGE EXAMPLES:\n- List all trigger types: { "action": "list_triggers" }\n- Fetch specific trigger: { "action": "list_triggers", "block_reference_ids": ["some-block-ref-id"] }\n- List all skills: { "action": "list_skills" }\n\nRELATED TOOLS:\n- manage_agent_triggers — use block_reference_id from list_triggers to attach a trigger to a specific agent\n- manage_agent_skills — use skill id from list_skills, or action:"create" to author a new skill, then attach to an agent\n- manage_agent — manage the agent entity itself (create, update, delete, activate, etc.)'}getInputSchema(){return Xw}async executeInternal(e){switch(e.action){case"list_triggers":return this.handleListTriggers(e);case"list_skills":return this.handleListSkills()}}async handleListTriggers(e){try{const t={block_reference_ids:e.block_reference_ids},a=(await this.mondayApi.request(Bw,t,{versionOverride:"dev"})).agent_triggers_catalog??[];return{content:{message:'Available trigger types. Use block_reference_id and inspect field_schemas/required_fields before calling manage_agent_triggers action:"add".',count:a.length,triggers:a}}}catch(e){Uc(e,"fetch monday platform agent triggers catalog")}}async handleListSkills(){try{const e=(await this.mondayApi.request(zw,{},{versionOverride:"dev"})).agent_skills_catalog??[];return{content:{message:'Available skills. Use id when calling manage_agent_skills action:"add".',count:e.length,skills:e}}}catch(e){Uc(e,"fetch monday platform agent skills catalog")}}},class extends ce{constructor(){super(...arguments),this.name="list_automations",this.type=f.READ,this.annotations=le({title:"List Board Automations",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'List all automations on a specific monday.com board, including their ids, titles, active state, and configuration.\nReturns two groups: "workflows" (fully manageable, supports pagination via limit/cursor) and "legacyAutomations" (READ-ONLY automations set up in an older way — returned on the first page only, when no cursor is given).\nAlways present BOTH groups to the user together as one list of board automations — never omit or hide "legacyAutomations". The split and the read-only limitation are internal context for you only: don\'t volunteer them and don\'t label any automation "legacy" or "read-only". Only if the user asks to act on a legacy one, briefly explain it can\'t be changed (e.g. "This one was set up in an older way and can\'t be modified here").\nCall this FIRST before manage_automations — it is the only way to resolve an automation id from a name or description. Never guess an automation id.\nWhen NOT to use: Do not call this tool to get general board information unrelated to automations.\n'}getInputSchema(){return aA}async executeInternal(e){try{const a=!e.cursor,n={boardIds:[e.boardId],limit:e.limit??100,includeLegacy:a,...e.cursor?{cursor:e.cursor}:{}},i=await this.mondayApi.request(Zw,n),o=(i.board_automations?.items??[]).map(tA),r=i.board_automations?.cursor??null,s=a?(t=i.board_automations?.legacy_automations,null==t||"object"==typeof t&&"error"in t?null:t):null;return{content:{message:`Found ${o.length} live workflow(s) on board ${e.boardId}`,workflows:o,...null!=s?{legacyAutomations:s}:{},pagination:{nextCursor:r,hasMore:null!==r}}}}catch(e){Uc(e,"list live workflows")}var t}},class extends ce{constructor(){super(...arguments),this.name="manage_automations",this.type=f.WRITE,this.annotations=le({title:"Manage Automations",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return'Activate, deactivate, or delete an existing monday.com automation.\n\nRequires an automation id. When the user refers to an automation by name, always call list_automations first to resolve the id — never guess or infer ids.\n\nActions:\n- activate: enables a paused automation so it starts responding to its trigger.\n- deactivate: pauses an automation while preserving its definition.\n- delete: permanently removes an automation — irreversible.\n\nWhen intent is ambiguous ("stop", "turn off", "pause"), prefer deactivate over delete.'}getInputSchema(){return rA}async executeInternal(e){const t=e;switch(t.action){case"activate":return this.activateWorkflow(t);case"deactivate":return this.deactivateWorkflow(t);case"delete":return this.deleteWorkflow(t)}}async activateWorkflow(e){try{const t={id:e.workflowId},a=await this.mondayApi.request(nA,t,{versionOverride:"dev"});if(!a.activate_live_workflow?.is_success)throw new Error(`Workflow ${e.workflowId} activation did not report success`);return{content:{message:`Workflow ${e.workflowId} activated`,workflowId:e.workflowId,isActive:!0}}}catch(e){Uc(e,"activate workflow")}}async deactivateWorkflow(e){try{const t={id:e.workflowId},a=await this.mondayApi.request(iA,t,{versionOverride:"dev"});if(!a.deactivate_live_workflow?.is_success)throw new Error(`Workflow ${e.workflowId} deactivation did not report success`);return{content:{message:`Workflow ${e.workflowId} deactivated`,workflowId:e.workflowId,isActive:!1}}}catch(e){Uc(e,"deactivate workflow")}}async deleteWorkflow(e){try{const t={id:e.workflowId},a=await this.mondayApi.request(oA,t,{versionOverride:"dev"});if(!a.delete_live_workflow?.is_success)throw new Error(`Workflow ${e.workflowId} deletion did not report success`);return{content:{message:`Workflow ${e.workflowId} deleted`,workflowId:e.workflowId}}}catch(e){Uc(e,"delete workflow")}}},class extends ce{constructor(e,t,a){super(e,a),this.apiToken=t,this.name="create_automation",this.type=f.WRITE,this.annotations=le({title:"Create Automation",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'\n Creates an automation on a monday board from a structured natural-language description.\n\nUse this tool only when you know:\n- boardId\n- the user\'s intended trigger\n- at least one intended action\n- any details the user provided that are relevant to the trigger, conditions, or actions\n\nThe caller does not need to know the exact available automation blocks or their required fields. Describe the user\'s intent clearly — the tool will translate that intent into supported blocks and values.\n\nIf a required detail is missing from the user\'s request, ask for clarification before calling the tool.\n\nIf the tool returns status: "needs_clarification", present the unresolved fields to the user, gather answers, then call the tool again.\n\nDescribe the automation in this format:\n\nTrigger:\n When <the event that should start the automation>\n Details:\n <relevant detail>: <value>\n\nConditions:\n - Only if <condition that should be true>\n Details:\n <relevant detail>: <value>\n\nActions:\n - <action the automation should perform>:\n <relevant detail>: <value>\n\nRules:\n- Use one trigger.\n- Conditions are optional.\n- Multiple conditions mean AND.\n- Use one or more actions.\n- Do not use branching.\n- Use natural language, not block IDs or internal field names.\n- Actions may reference values from the trigger context, such as "{{item name}}", "{{creator}}", "{{status}}", "{{group}}", or "{{board}}".\n\nTerminology:\n- Trigger: the event that starts the automation, such as "when a new item is created".\n- Conditions: optional requirements that must be true before actions run.\n- Actions: what the automation does when it runs.\n\nExample:\n\nTrigger:\n When a new item is created\n\nActions:\n - Send a notification:\n Recipient: John Snow\n Title: Important Update\n Message: The item "{{item name}}" was created.\n\n - Move the item to a group:\n Group: Top group\n'}getInputSchema(){return dA}async executeInternal(e){try{const a="function"==typeof this.apiToken?this.apiToken():this.apiToken,n=(t=this.context,t?.fetchConfig?.fetch??sA),i=await n({serviceName:"platform-agent",path:"/platform-ai-gateway/agents/lite-builder",method:"POST",headers:{...this.context?.fetchConfig?.fetch?{}:{Authorization:a},"Content-Type":"application/json"},body:JSON.stringify({userPrompt:e.userPrompt,boardId:e.boardId}),signal:AbortSignal.timeout(18e4)});if(!i.ok){const e=await i.text().catch((()=>""));throw new Lc(`lite-builder responded with HTTP ${i.status}${e?`: ${e}`:""}`,"UPSTREAM_HTTP_ERROR")}return{content:await i.json()}}catch(e){Uc(e,"create automation")}var t}},class extends ce{constructor(){super(...arguments),this.name="get_automation_runs",this.type=f.READ,this.annotations=le({title:"Get Automation Runs",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Read automation/workflow run history. Read-only.\n\nModes:\n- "history": paginated run feed (state, duration, error reason). Use "filters" to narrow results and "nextPageOffset" to page (offset-only — next page = previous offset + returned count).\n- "detail": single run by "triggerUuid" (required) — returns block steps and MCP tool calls. Set "includeToolEvents": false to skip tool calls.\n\nScope: provide "boardId" for a specific board or "accountWide": true. One is required.\n\nKnown event states: "success", "failure", "exhausted".'}getInputSchema(){return _A}async executeInternal(e){if(!e.boardId&&!e.accountWide)return{content:{message:'Either "boardId" or "accountWide": true must be provided.'}};try{return"detail"===e.mode?await this.runDetail(e):await this.runHistory(e)}catch(e){Uc(e,"get automation runs")}}async runHistory(e){const t=e.nextPageOffset??0,a={...e.filters??{},...e.boardId?{boardId:e.boardId}:{}},n=await this.mondayApi.request(lA,{nextPageOffset:t,filters:a}),i=n.trigger_events?.triggerEvents??[],o=function(e){return e.reduce(((e,t)=>{const a=t.eventState??"unknown";return e[a]=(e[a]??0)+1,e}),{})}(i),r=e.boardId?`board ${e.boardId}`:"account-wide";return{content:{message:`Returned ${i.length} run(s) (${r}) at offset ${t}. By state: ${function(e){const t=Object.entries(e).map((([e,t])=>`${e}=${t}`));return t.length?t.join(", "):"none"}(o)}. Offset-only pagination — for the next page request offset ${t+i.length}.`,scope:r,offset:t,count:i.length,stateCounts:o,runs:i}}}async runDetail(e){if(!e.triggerUuid)return{content:{message:'detail mode requires "triggerUuid".'}};const t=!1!==e.includeToolEvents,a=e.blockEventsOffset??0,n=e.toolEventsOffset??0,i=(await this.mondayApi.request(cA,{triggerUuid:e.triggerUuid})).trigger_event;if(!i)return{content:{message:`No run found for triggerUuid ${e.triggerUuid}.`,triggerUuid:e.triggerUuid,found:!1}};const[o,r]=await Promise.all([this.mondayApi.request(mA,{triggerUuid:e.triggerUuid,nextPageOffset:a}),t?this.mondayApi.request(uA,{triggerUuid:e.triggerUuid,nextPageOffset:n}):Promise.resolve(null)]),s=o.block_events?.blockEvents??[],d=r?.tool_events?.tool_events??[];return{content:{message:`Run ${e.triggerUuid}: state=${i.eventState??"unknown"}, ${s.length} block step(s), ${d.length} tool call(s).`,found:!0,run:i,blockEvents:s,blockEventsOffset:a,toolEvents:d,toolEventsOffset:n,toolEventsIncluded:t}}}},class extends ce{constructor(){super(...arguments),this.name="get_automation_statistics",this.type=f.READ,this.annotations=le({title:"Get Automation Statistics",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Aggregate automation run statistics. Read-only.\n\nBreakdowns:\n- "totals": success/failure/total counts at the account or board level.\n- "by_entity": per-automation and per-workflow counts for a given "runStatus" (required: "success" | "failure" | "exhausted"). Use "excludeAutomationIds" to omit specific automations.\n\nScope: provide "boardId" for a specific board or "accountWide": true. One is required.\n\nOptional "userIds" narrows results to specific creators.'}getInputSchema(){return bA}async executeInternal(e){if(!e.boardId&&!e.accountWide)return{content:{message:'Either "boardId" or "accountWide": true must be provided.'}};const t=e.boardId?function(e){const t=Number(e.trim());if(!Number.isInteger(t)||t<=0)throw new Error(`Invalid boardId: '${e}' is not a positive integer.`);return t}(e.boardId):void 0,a=e.boardId?`board ${e.boardId}`:"account-wide";try{return"by_entity"===e.breakdown?await this.runByEntity(e,t,a):await this.runTotals(e,t,a)}catch(e){Uc(e,"get automation statistics")}}async runTotals(e,t,a){const n=(await this.mondayApi.request(fA,{filters:{board_id:t,user_ids:e.userIds}})).account_trigger_statistics;return{content:{message:`Totals (${a}): success=${n?.success??0}, failure=${n?.failure??0}, total=${n?.total??0}.`,scope:a,breakdown:"totals",statistics:n}}}async runByEntity(e,t,a){if(!e.runStatus)return{content:{message:'by_entity breakdown requires "runStatus" (success | failure | exhausted).'}};const n=(await this.mondayApi.request(gA,{runStatus:e.runStatus,filters:{board_id:t,automation_ids:e.excludeAutomationIds,user_ids:e.userIds}})).account_triggers_statistics_by_entity_id;return{content:{message:`By-entity '${e.runStatus}' statistics (${a}).`,scope:a,breakdown:"by_entity",runStatus:e.runStatus,automationStatistics:n?.automation_statistics,workflowStatistics:n?.workflow_statistics}}}},class extends ce{constructor(){super(...arguments),this.name="configure_ai_column",this.type=f.WRITE,this.annotations=le({title:"Configure AI Column",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Add AI to a column or set up an AI column on a monday.com board. Use this tool when the user wants to automatically categorize, summarize, translate, extract, generate text, improve writing, or assign people using AI on a column. This is the right tool for requests like "add AI to a column", "set up automatic extraction/categorization/summarization", "make a column use AI", "configure AI on a column", or "use AI to automatically fill a column".\n\nThe column must already exist on the board with a compatible type for the chosen block. To create a new AI column, first use create_column to create the column, then use this tool to add AI behavior.\n\nBLOCK TYPES (only pass fields that apply to the chosen block_type):\n- categorize: { block_type, source_type, source_column_id?, additional_instructions? } — assigns labels from target column\'s existing status/dropdown options\n- summarize: { block_type, source_type, source_column_id?, additional_instructions? } — generates concise summaries\n- translate: { block_type, source_type, source_column_id?, target_language } — translates to target language\n- improve_text: { block_type, source_type, source_column_id?, tone?, improver_length?, refinement_type? } — rewrites/fixes text\n- extract: { block_type, source_type, source_column_id?, entity_type, custom_instructions?, additional_instructions? } — extracts structured info\n- open_block: { block_type, ai_query } — flexible custom prompt, reference columns via {pulse.column_id}\n- write_me: { block_type, ai_query, tone, output_length } — generates new text from prompt\n- person_assignment: { block_type, source_type, source_column_id?, groups } — assigns people based on context\n\nSOURCE TYPES (required for all blocks except open_block and write_me):\n- item_name: uses the item\'s name as input\n- thread: uses the item\'s updates/comments as input\n- column: uses another column\'s value (requires source_column_id)\n- emails_and_activities: uses emails & activities (categorize only)\n\nCOLUMN REFERENCE SYNTAX (for open_block and write_me ai_query):\n- {pulse.column_id} — regular board column\n- {pulse.name} — the item name\n- {pulse.subitem.column_id} — subitem column\n\nRELATED TOOLS:\n- create_column — create the target column first if it doesn\'t exist\n- get_board_schema — discover existing columns and their types/IDs'}getInputSchema(){return NA}async executeInternal(e){const t=void 0!==e.run_backfill?{run_backfill:e.run_backfill}:void 0;try{switch(e.block_type){case"categorize":return this.handleCategorize(e.board_id,e,t);case"summarize":return this.handleSummarize(e.board_id,e,t);case"translate":return this.handleTranslate(e.board_id,e,t);case"improve_text":return this.handleImproveText(e.board_id,e,t);case"extract":return this.handleExtract(e.board_id,e,t);case"open_block":return this.handleOpenBlock(e.board_id,e,t);case"write_me":return this.handleWriteMe(e.board_id,e,t);case"person_assignment":return this.handlePersonAssignment(e.board_id,e,t)}}catch(e){Uc(e,"configure AI column")}}validateSourceType(e,t){if(!e.source_type)throw new Error(`source_type is required for ${t} block`);if("column"===e.source_type&&!e.source_column_id)throw new Error('source_column_id is required when source_type is "column"')}async handleCategorize(e,t,a){this.validateSourceType(t,"categorize");const n=await this.mondayApi.request(yA,{boardId:e.toString(),columnId:t.column_id,sourceType:t.source_type,sourceColumnId:t.source_column_id,additionalInstructions:t.additional_instructions,extraSettings:a});return{content:{message:"AI column configured successfully",column_id:n.configure_categorize_ai_column?.column_id}}}async handleSummarize(e,t,a){this.validateSourceType(t,"summarize");const n=await this.mondayApi.request(vA,{boardId:e.toString(),columnId:t.column_id,sourceType:t.source_type,sourceColumnId:t.source_column_id,additionalInstructions:t.additional_instructions,extraSettings:a});return{content:{message:"AI column configured successfully",column_id:n.configure_summarize_ai_column?.column_id}}}async handleTranslate(e,t,a){if(this.validateSourceType(t,"translate"),!t.target_language)throw new Error("target_language is required for translate block");const n=await this.mondayApi.request(IA,{boardId:e.toString(),columnId:t.column_id,sourceType:t.source_type,sourceColumnId:t.source_column_id,targetLanguage:t.target_language,extraSettings:a});return{content:{message:"AI column configured successfully",column_id:n.configure_translate_ai_column?.column_id}}}async handleImproveText(e,t,a){this.validateSourceType(t,"improve_text");const n=await this.mondayApi.request(EA,{boardId:e.toString(),columnId:t.column_id,sourceType:t.source_type,sourceColumnId:t.source_column_id,tone:t.tone,length:t.improver_length,refinementType:t.refinement_type,extraSettings:a});return{content:{message:"AI column configured successfully",column_id:n.configure_improve_text_ai_column?.column_id}}}async handleExtract(e,t,a){if(this.validateSourceType(t,"extract"),!t.entity_type)throw new Error("entity_type is required for extract block");if("custom"===t.entity_type&&!t.custom_instructions)throw new Error('custom_instructions is required for extract block when entity_type is "custom"');const n=await this.mondayApi.request(TA,{boardId:e.toString(),columnId:t.column_id,sourceType:t.source_type,sourceColumnId:t.source_column_id,entityType:t.entity_type,customInstructions:t.custom_instructions,additionalInstructions:t.additional_instructions,extraSettings:a});return{content:{message:"AI column configured successfully",column_id:n.configure_extract_ai_column?.column_id}}}async handleOpenBlock(e,t,a){if(!t.ai_query)throw new Error("ai_query is required for open_block block");const n=await this.mondayApi.request(wA,{boardId:e.toString(),columnId:t.column_id,aiQuery:t.ai_query,extraSettings:a});return{content:{message:"AI column configured successfully",column_id:n.configure_open_block_ai_column?.column_id}}}async handleWriteMe(e,t,a){if(!t.ai_query)throw new Error("ai_query is required for write_me block");if(!t.tone)throw new Error("tone is required for write_me block");if(!t.output_length)throw new Error("output_length is required for write_me block");const n=await this.mondayApi.request(AA,{boardId:e.toString(),columnId:t.column_id,aiQuery:t.ai_query,tone:t.tone,length:t.output_length,extraSettings:a});return{content:{message:"AI column configured successfully",column_id:n.configure_write_me_ai_column?.column_id}}}async handlePersonAssignment(e,t,a){if(this.validateSourceType(t,"person_assignment"),!t.groups||0===t.groups.length)throw new Error("groups is required for person_assignment block");const n=await this.mondayApi.request(SA,{boardId:e.toString(),columnId:t.column_id,sourceType:t.source_type,sourceColumnId:t.source_column_id,groups:t.groups,extraSettings:a});return{content:{message:"AI column configured successfully",column_id:n.configure_person_assignment_ai_column?.column_id}}}},class extends ce{constructor(){super(...arguments),this.name="remove_ai_from_column",this.type=f.WRITE,this.annotations=le({title:"Remove AI from Column",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0})}getDescription(){return"Remove AI from a column on a monday.com board. Use this tool when the user wants to disable AI on a column, turn off AI automation, stop AI from running on a column, or delete the AI behavior from a column. This deletes all AI automation recipes and the app feature extension associated with the column. The column itself is not deleted — only its AI behavior is removed.\n\nUse get_board_schema to find column IDs before calling this tool."}getInputSchema(){return OA}async executeInternal(e){try{const t=await this.mondayApi.request(DA,{boardId:e.board_id.toString(),columnId:e.column_id});return{content:{message:"AI removed from column successfully",column_id:t.remove_ai_from_column?.column_id,success:t.remove_ai_from_column?.success}}}catch(e){Uc(e,"remove AI from column")}}},class extends ce{constructor(){super(...arguments),this.name="submit_bug_or_feature_request",this.type=f.READ,this.annotations=le({title:"Submit Bug or Feature Request",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return`Report a bug, submit a feature request, or share feedback about the monday.com product or this integration.\n\nCall this tool proactively — not just when a user explicitly asks. Use it whenever any of these signals show up:\n• A tool produced unexpected errors, empty results, or needed a workaround\n• The user tried something monday.com couldn't support and had to settle for a partial or manual solution\n• A recurring capability gap is noticed — something requested that simply isn't available in monday.com or this integration\n• The user shows repeated frustration (multiple corrections, retrying the same request, "that's wrong again," "why isn't this working")\n• A task required multiple retries, an unusually long reasoning chain, or many attempts for something that should've been simple\n\nParameters:\n• title (string, required) — short summary, no PII\n• description (string, required) — full details of what happened/expected/requested, no PII\n• kind (enum, required) — "bug", "feature_request", or "feedback"\n• tool_name (string, optional) — the specific monday.com tool the feedback relates to (e.g. "create_item")\n\nRestriction: Use strictly for things related to monday.com — not for other tools (Google Drive, Slack, GitHub, etc.) that may be in the conversation context. ${RA}`}getInputSchema(){return CA}async executeInternal(e){return this.sessionContext.metadata??={},this.sessionContext.metadata.kind=e.kind,this.sessionContext.metadata.title=e.title,this.sessionContext.metadata.description=e.description,e.tool_name&&(this.sessionContext.metadata.tool_name=e.tool_name),{content:{message:"Feedback submitted successfully. Thank you for helping improve the monday.com MCP server."}}}},class extends ce{constructor(){super(...arguments),this.name="get_monday_knowledge",this.type=f.READ,this.annotations=le({title:"Get Monday Knowledge",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Ask a question about monday.com and get an AI-generated answer from the official knowledge base.\n\nUse kind="general" for questions about using monday.com — features, automations, UI, help center, and settings. Returns cited source articles with links.\nUse kind="developer_docs" for questions about the monday.com API — GraphQL queries and mutations, authentication, rate limits, webhooks, schema, API best practices, and building apps.\n\nImportant: do not include PII data in the questions.'}getInputSchema(){return $A}async executeInternal(e){return this.sessionContext.metadata??={},this.sessionContext.metadata.kind=e.kind,e.kind===UA?this.queryDeveloperDocs(e.query):this.queryGeneralKnowledge(e.query)}async queryGeneralKnowledge(e){const t={query:e},a=(await this.mondayApi.request(kA,t)).knowledge_base_search;a?.answer||Uc(new Error("No answer found in the knowledge base. Try rephrasing your question."),"get_monday_knowledge"),this.sessionContext.metadata??={},this.sessionContext.metadata.query=e,this.sessionContext.metadata.answer=a.answer;const n=(a.raw_snippets??[]).filter((e=>e.url&&e.title)).map((e=>({title:e.title,url:e.url,snippet:e.text??""})));return{content:{answer:a.answer,sources:n,kind:PA}}}async queryDeveloperDocs(e){const t={query:e,retrieval_only:!0},a=(await this.mondayApi.request(LA,t)).ask_developer_docs;return a?.answer||Uc(new Error("No answer found in developer docs. Try rephrasing your question."),"get_monday_knowledge"),this.sessionContext.metadata??={},this.sessionContext.metadata.query=e,this.sessionContext.metadata.answer=a.answer,{content:{answer:a.answer,sources:[],kind:UA}}}}];var _S;!function(e){e.API="api",e.APPS="apps",e.ATP="atp"}(_S||(_S={}));const fS=(e,t)=>{let a=[];t?.mode===_S.APPS?a=[...pe]:t?.mode!==_S.API&&t?.mode||(a=[...hS,...uS]);const n=a.map((t=>((e,t)=>e.prototype instanceof ce?new e(t.apiClient,t.apiToken,t.context):e.prototype instanceof B?new e(t.apiToken):new e)(t,e)));return n.filter((e=>{if(!t)return e.type!==f.ALL_API;if(t.mode===_S.API&&"only"===t.enableDynamicApiTools)return e.type===f.ALL_API;let a=!1;return t.mode===_S.API&&!1===t.enableDynamicApiTools&&(a=a||e.type===f.ALL_API),t.readOnlyMode&&(a=a||e.type!==f.READ),t.include?a=a||!t.include?.includes(e.name):t.exclude&&(a=a||t.exclude?.includes(e.name)),!a}))},gS=e=>"object"==typeof e?JSON.stringify(e):e;exports.MondayAgentToolkit=class{constructor(e){this.mondayApiToken=e.mondayApiToken,this.context={...e.context,apiVersion:e.mondayApiVersion??V},this.tools=this.initializeTools(e)}initializeTools(t){const a={apiClient:"function"==typeof t.mondayApiToken?()=>new e.ApiClient({token:t.mondayApiToken(),apiVersion:t.mondayApiVersion??V,endpoint:t.mondayApiEndpoint,requestConfig:t.mondayApiRequestConfig}):new e.ApiClient({token:t.mondayApiToken,apiVersion:t.mondayApiVersion??V,endpoint:t.mondayApiEndpoint,requestConfig:t.mondayApiRequestConfig}),apiToken:this.mondayApiToken,context:this.context};return fS(a,t.toolsConfiguration)}getTools(){return this.tools.map((e=>{const t=e.getInputSchema();return{type:"function",function:{name:e.name,description:e.getDescription(),parameters:t?h.zodToJsonSchema(n.z.object(t)):void 0}}}))}async handleToolCall(e){const{name:t,arguments:a}=e.function,i=JSON.parse(a),o=this.tools.find((e=>e.name===t));if(!o)throw new Error(`Unknown tool: ${t}`);const r=o.getInputSchema();if(r){const t=n.z.object(r).safeParse(i);if(!t.success)throw new Error(`Invalid arguments: ${t.error.message}`);const a=await o.execute(t.data);return{role:"tool",tool_call_id:e.id,content:gS(a.content)}}{const t=await o.execute();return{role:"tool",tool_call_id:e.id,content:gS(t.content)}}}};
|
|
3032
3032
|
//# sourceMappingURL=index.js.map
|