@mondaydotcomorg/agent-toolkit 4.2.1 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1157,7 +1157,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1157
1157
  query GetColumnTypeSchema($type: ColumnType!) {
1158
1158
  get_column_type_schema(type: $type)
1159
1159
  }
1160
- `,iE="https://developer.monday.com/api-reference",nE={columnType:y.nativeEnum(aT).describe('The column type to retrieve information for (e.g., "text", "status", "date", "numbers")')};const oE={random_string:y.string().describe("Dummy parameter for no-parameter tools").optional(),operationType:y.enum(["read","write"]).describe('Type of operation: "read" for queries, "write" for mutations').optional()};const rE={typeName:y.string().describe("The name of the GraphQL type to get details for")};function sE(e){return e?"NON_NULL"===e.kind?`${sE(e.ofType)}!`:"LIST"===e.kind?`[${sE(e.ofType)}]`:e.name||"unknown":"unknown"}const pE=sw`
1160
+ `,iE="https://developer.monday.com/api-reference",nE={columnType:y.nativeEnum(aT).describe('The column type to retrieve information for (e.g., "text", "status", "date", "numbers")')};const oE={random_string:y.string().describe("Dummy parameter for no-parameter tools").optional(),operationType:y.enum(["read","write"]).describe('Type of operation: "read" for queries, "write" for mutations').optional()};const rE={typeName:y.string().describe("The name of the GraphQL type to get details for")};const sE=sw`
1161
1161
  fragment UserDetails on User {
1162
1162
  # Basic User Information
1163
1163
  id
@@ -1189,31 +1189,31 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1189
1189
  time_zone_identifier
1190
1190
  utc_hours_diff
1191
1191
  }
1192
- `,dE=sw`
1192
+ `,pE=sw`
1193
1193
  fragment UserTeamMembership on Team {
1194
1194
  id
1195
1195
  name
1196
1196
  is_guest
1197
1197
  picture_url
1198
1198
  }
1199
- `,cE=sw`
1199
+ `,dE=sw`
1200
1200
  fragment TeamBasicInfo on Team {
1201
1201
  id
1202
1202
  name
1203
1203
  }
1204
- `,lE=sw`
1204
+ `,cE=sw`
1205
1205
  fragment TeamExtendedInfo on Team {
1206
1206
  ...TeamBasicInfo
1207
1207
  is_guest
1208
1208
  picture_url
1209
1209
  }
1210
- `,mE=sw`
1210
+ `,lE=sw`
1211
1211
  fragment TeamOwner on User {
1212
1212
  id
1213
1213
  name
1214
1214
  email
1215
1215
  }
1216
- `,uE=sw`
1216
+ `,mE=sw`
1217
1217
  fragment TeamMember on User {
1218
1218
  id
1219
1219
  name
@@ -1233,7 +1233,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1233
1233
  time_zone_identifier
1234
1234
  utc_hours_diff
1235
1235
  }
1236
- `,fE=sw`
1236
+ `,uE=sw`
1237
1237
  fragment TeamMemberSimplified on User {
1238
1238
  id
1239
1239
  name
@@ -1242,15 +1242,15 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1242
1242
  is_admin
1243
1243
  is_guest
1244
1244
  }
1245
- `,hE=sw`
1245
+ `,fE=sw`
1246
1246
  fragment UserTeamMembershipSimplified on Team {
1247
1247
  id
1248
1248
  name
1249
1249
  is_guest
1250
1250
  }
1251
- `,vE=sw`
1251
+ `,hE=sw`
1252
+ ${sE}
1252
1253
  ${pE}
1253
- ${dE}
1254
1254
 
1255
1255
  query listUsersWithTeams($userIds: [ID!], $limit: Int = 1000) {
1256
1256
  users(ids: $userIds, limit: $limit) {
@@ -1262,21 +1262,21 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1262
1262
  }
1263
1263
  }
1264
1264
  }
1265
- `,bE=sw`
1266
- ${pE}
1265
+ `,vE=sw`
1266
+ ${sE}
1267
1267
 
1268
1268
  query listUsersOnly($userIds: [ID!], $limit: Int = 1000) {
1269
1269
  users(ids: $userIds, limit: $limit) {
1270
1270
  ...UserDetails
1271
1271
  }
1272
1272
  }
1273
- `,gE=sw`
1274
- ${pE}
1275
- ${hE}
1276
- ${lE}
1277
- ${cE}
1278
- ${mE}
1273
+ `,bE=sw`
1274
+ ${sE}
1279
1275
  ${fE}
1276
+ ${cE}
1277
+ ${dE}
1278
+ ${lE}
1279
+ ${uE}
1280
1280
 
1281
1281
  query listUsersAndTeams($userIds: [ID!], $teamIds: [ID!], $limit: Int = 1000) {
1282
1282
  users(ids: $userIds, limit: $limit) {
@@ -1302,19 +1302,19 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1302
1302
  }
1303
1303
  }
1304
1304
  }
1305
- `,yE=sw`
1306
- ${cE}
1305
+ `,gE=sw`
1306
+ ${dE}
1307
1307
 
1308
1308
  query listTeamsOnly($teamIds: [ID!]) {
1309
1309
  teams(ids: $teamIds) {
1310
1310
  ...TeamBasicInfo
1311
1311
  }
1312
1312
  }
1313
- `,_E=sw`
1314
- ${lE}
1313
+ `,yE=sw`
1315
1314
  ${cE}
1315
+ ${dE}
1316
+ ${lE}
1316
1317
  ${mE}
1317
- ${uE}
1318
1318
 
1319
1319
  query listTeamsWithMembers($teamIds: [ID!]) {
1320
1320
  teams(ids: $teamIds) {
@@ -1331,9 +1331,9 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1331
1331
  }
1332
1332
  }
1333
1333
  }
1334
- `,wE=sw`
1334
+ `,_E=sw`
1335
+ ${sE}
1335
1336
  ${pE}
1336
- ${dE}
1337
1337
 
1338
1338
  query getUserByName($name: String) {
1339
1339
  users(name: $name) {
@@ -1345,7 +1345,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1345
1345
  }
1346
1346
  }
1347
1347
  }
1348
- `,xE=sw`
1348
+ `,wE=sw`
1349
1349
  query getCurrentUser {
1350
1350
  me {
1351
1351
  id
@@ -1357,7 +1357,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1357
1357
  photo_thumb
1358
1358
  }
1359
1359
  }
1360
- `;const TE=[["is_pending","Pending"],["is_verified","Verified"],["is_view_only","View Only"],["join_date","Join Date"],["last_activity","Last Activity"],["location","Location"],["mobile_phone","Mobile Phone"],["phone","Phone"],["photo_thumb","Photo Thumb"],["time_zone_identifier","Timezone"],["utc_hours_diff","UTC Hours Diff"]];function EE(e,t=""){return TE.filter((([t])=>{const a=e[t];return null!=a})).map((([a,i])=>`${t}${i}: ${e[a]}`))}const IE=e=>{const t=[];return"users"in e&&e.users&&e.users.length>0&&(t.push("Users:"),e.users.forEach((e=>{e&&(t.push(` ID: ${e.id}`),t.push(` Name: ${e.name}`),t.push(` Email: ${e.email}`),t.push(` Title: ${e.title||"N/A"}`),t.push(` Enabled: ${e.enabled}`),t.push(` Admin: ${e.is_admin||!1}`),t.push(` Guest: ${e.is_guest||!1}`),t.push(...EE(e," ")),e.teams&&e.teams.length>0&&(t.push(" Teams:"),e.teams.forEach((e=>{e&&t.push(` - ID: ${e.id}, Name: ${e.name}, Guest Team: ${e.is_guest||!1}, Picture URL: ${e.picture_url||"N/A"}`)}))),t.push(""))}))),"teams"in e&&e.teams&&e.teams.length>0&&(t.push("Teams:"),e.teams.forEach((e=>{e&&(t.push(` ID: ${e.id}`),t.push(` Name: ${e.name}`),function(e){return"owners"in e}(e)&&(t.push(` Guest Team: ${e.is_guest||!1}`),t.push(` Picture URL: ${e.picture_url||"N/A"}`),e.owners&&e.owners.length>0&&(t.push(" Owners:"),e.owners.forEach((e=>{t.push(` - ID: ${e.id}, Name: ${e.name}, Email: ${e.email}`)}))),e.users&&e.users.length>0&&(t.push(" Members:"),e.users.forEach((e=>{if(e){const a=[`ID: ${e.id}`,`Name: ${e.name}`,`Email: ${e.email}`,`Title: ${e.title||"N/A"}`,`Admin: ${e.is_admin||!1}`,`Guest: ${e.is_guest||!1}`,...EE(e)];t.push(` - ${a.join(", ")}`)}})))),t.push(""))}))),0===t.length?"No users or teams found with the specified filters.":t.join("\n").trim()},SE=500,NE=500,AE=1e3,DE=sw`
1360
+ `;const xE=[["is_pending","Pending"],["is_verified","Verified"],["is_view_only","View Only"],["join_date","Join Date"],["last_activity","Last Activity"],["location","Location"],["mobile_phone","Mobile Phone"],["phone","Phone"],["photo_thumb","Photo Thumb"],["time_zone_identifier","Timezone"],["utc_hours_diff","UTC Hours Diff"]];function TE(e,t=""){return xE.filter((([t])=>{const a=e[t];return null!=a})).map((([a,i])=>`${t}${i}: ${e[a]}`))}const EE=e=>{const t=[];return"users"in e&&e.users&&e.users.length>0&&(t.push("Users:"),e.users.forEach((e=>{e&&(t.push(` ID: ${e.id}`),t.push(` Name: ${e.name}`),t.push(` Email: ${e.email}`),t.push(` Title: ${e.title||"N/A"}`),t.push(` Enabled: ${e.enabled}`),t.push(` Admin: ${e.is_admin||!1}`),t.push(` Guest: ${e.is_guest||!1}`),t.push(...TE(e," ")),e.teams&&e.teams.length>0&&(t.push(" Teams:"),e.teams.forEach((e=>{e&&t.push(` - ID: ${e.id}, Name: ${e.name}, Guest Team: ${e.is_guest||!1}, Picture URL: ${e.picture_url||"N/A"}`)}))),t.push(""))}))),"teams"in e&&e.teams&&e.teams.length>0&&(t.push("Teams:"),e.teams.forEach((e=>{e&&(t.push(` ID: ${e.id}`),t.push(` Name: ${e.name}`),function(e){return"owners"in e}(e)&&(t.push(` Guest Team: ${e.is_guest||!1}`),t.push(` Picture URL: ${e.picture_url||"N/A"}`),e.owners&&e.owners.length>0&&(t.push(" Owners:"),e.owners.forEach((e=>{t.push(` - ID: ${e.id}, Name: ${e.name}, Email: ${e.email}`)}))),e.users&&e.users.length>0&&(t.push(" Members:"),e.users.forEach((e=>{if(e){const a=[`ID: ${e.id}`,`Name: ${e.name}`,`Email: ${e.email}`,`Title: ${e.title||"N/A"}`,`Admin: ${e.is_admin||!1}`,`Guest: ${e.is_guest||!1}`,...TE(e)];t.push(` - ${a.join(", ")}`)}})))),t.push(""))}))),0===t.length?"No users or teams found with the specified filters.":t.join("\n").trim()},IE=500,SE=500,NE=1e3,AE=sw`
1361
1361
  query getAccountSlug {
1362
1362
  me {
1363
1363
  account {
@@ -1365,7 +1365,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1365
1365
  }
1366
1366
  }
1367
1367
  }
1368
- `;async function kE(e){const t=await e.request(DE);return t.me?.account?.slug??null}function OE(e,t){return`https://${e}.monday.com/workspaces/${t}`}const RE={userIds:y.array(y.string()).max(SE).optional().describe("Specific user IDs to fetch.[IMPORTANT] ALWAYS use when you have user IDs in context. PREFER over general search. RETURNS: user profiles including team memberships"),teamIds:y.array(y.string()).max(NE).optional().describe("Specific team IDs to fetch.[IMPORTANT] ALWAYS use when you have team IDs in context, NEVER fetch all teams if specific IDs are available.\n RETURNS: Team details with owners and optional member data."),name:y.string().optional().describe("Name-based USER search ONLY. STANDALONE parameter - cannot be combined with others. PREFERRED method for finding users when you know names. Performs fuzzy matching.\n CRITICAL: This parameter searches for USERS ONLY, NOT teams. To search for teams, use teamIds parameter instead."),getMe:y.boolean().optional().describe('[TOP PRIORITY] Use ALWAYS when requesting current user information. Examples of when it should be used: ["get my user" or "get my teams"].\n This parameter CONFLICTS with all others. '),includeTeams:y.boolean().optional().describe("[AVOID] This fetches all teams in the account. To fetch a specific user's teams just fetch that user by id and you will get their team memberships."),teamsOnly:y.boolean().optional().describe("Fetch only teams, no users returned. Combine with includeTeamMembers for member details."),includeTeamMembers:y.boolean().optional().describe("Set to true only when you need additional member details for teams other than names and ids.")};const CE={itemId:y.number().describe("The id of the item to which the update will be added"),groupId:y.string().describe("The id of the group to which the item will be moved")};const $E=y.enum(["ids","object_ids","workspace_ids"]),LE={mode:y.enum(["content","version_history"]).optional().default("content").describe('The operation mode. "content" (default) fetches documents with their markdown content. "version_history" fetches the edit history of a single document.'),type:$E.optional().describe('Query type for content mode: "ids", "object_ids", or "workspace_ids". Required when mode is "content".'),ids:y.array(y.string()).optional().describe('Array of ID values. In content mode: matches the query type (ids/object_ids/workspace_ids). In version_history mode: provide the single document object_id here (e.g., ids: ["5001466606"]).'),limit:y.number().optional().describe("Number of docs per page (default: 25). Only used in content mode."),order_by:y.nativeEnum(bg).optional().describe("Order in which to retrieve docs. Only used in content mode."),page:y.number().optional().describe("Page number to return (starts at 1). Only used in content mode."),include_blocks:y.boolean().optional().default(!1).describe("If true, includes the blocks array (block IDs, types, positions, content) in the response. Required when you plan to call update_doc. Defaults to false to reduce response size. Only used in content mode."),include_comments:y.boolean().optional().default(!1).describe("If true, fetches all comments and replies on the document. Comments are stored at the item level within the doc backing board. Defaults to false. Only used in content mode."),comments_limit:y.number().optional().default(50).describe("Maximum number of comments (updates) to fetch per item when include_comments is true. Defaults to 50. Only used in content mode."),version_history_limit:y.number().optional().describe('Maximum number of restoring points to return. Use this when the user asks for "last N changes". Only used in version_history mode.'),since:y.string().optional().describe('ISO 8601 date string to filter version history from (e.g., "2026-03-15T00:00:00Z"). If omitted, returns the full history. Only used in version_history mode.'),until:y.string().optional().describe('ISO 8601 date string to filter version history until (e.g., "2026-03-16T23:59:59Z"). Defaults to now. Only used in version_history mode.'),include_diff:y.boolean().optional().default(!1).describe("If true, fetches content diffs between consecutive restoring points. May be slower due to additional API calls. Only used in version_history mode.")};const FE={workspace_id:y.number().describe("The ID of the workspace to get information for")};const PE=sw`
1368
+ `;async function DE(e){const t=await e.request(AE);return t.me?.account?.slug??null}function kE(e,t){return`https://${e}.monday.com/workspaces/${t}`}const OE={userIds:y.array(y.string()).max(IE).optional().describe("Specific user IDs to fetch.[IMPORTANT] ALWAYS use when you have user IDs in context. PREFER over general search. RETURNS: user profiles including team memberships"),teamIds:y.array(y.string()).max(SE).optional().describe("Specific team IDs to fetch.[IMPORTANT] ALWAYS use when you have team IDs in context, NEVER fetch all teams if specific IDs are available.\n RETURNS: Team details with owners and optional member data."),name:y.string().optional().describe("Name-based USER search ONLY. STANDALONE parameter - cannot be combined with others. PREFERRED method for finding users when you know names. Performs fuzzy matching.\n CRITICAL: This parameter searches for USERS ONLY, NOT teams. To search for teams, use teamIds parameter instead."),getMe:y.boolean().optional().describe('[TOP PRIORITY] Use ALWAYS when requesting current user information. Examples of when it should be used: ["get my user" or "get my teams"].\n This parameter CONFLICTS with all others. '),includeTeams:y.boolean().optional().describe("[AVOID] This fetches all teams in the account. To fetch a specific user's teams just fetch that user by id and you will get their team memberships."),teamsOnly:y.boolean().optional().describe("Fetch only teams, no users returned. Combine with includeTeamMembers for member details."),includeTeamMembers:y.boolean().optional().describe("Set to true only when you need additional member details for teams other than names and ids.")};const RE={itemId:y.number().describe("The id of the item to which the update will be added"),groupId:y.string().describe("The id of the group to which the item will be moved")};const CE=y.enum(["ids","object_ids","workspace_ids"]),$E={mode:y.enum(["content","version_history"]).optional().default("content").describe('The operation mode. "content" (default) fetches documents with their markdown content. "version_history" fetches the edit history of a single document.'),type:CE.optional().describe('Query type for content mode: "ids", "object_ids", or "workspace_ids". Required when mode is "content".'),ids:y.array(y.string()).optional().describe('Array of ID values. In content mode: matches the query type (ids/object_ids/workspace_ids). In version_history mode: provide the single document object_id here (e.g., ids: ["5001466606"]).'),limit:y.number().optional().describe("Number of docs per page (default: 25). Only used in content mode."),order_by:y.nativeEnum(bg).optional().describe("Order in which to retrieve docs. Only used in content mode."),page:y.number().optional().describe("Page number to return (starts at 1). Only used in content mode."),include_blocks:y.boolean().optional().default(!1).describe("If true, includes the blocks array (block IDs, types, positions, content) in the response. Required when you plan to call update_doc. Defaults to false to reduce response size. Only used in content mode."),include_comments:y.boolean().optional().default(!1).describe("If true, fetches all comments and replies on the document. Comments are stored at the item level within the doc backing board. Defaults to false. Only used in content mode."),comments_limit:y.number().optional().default(50).describe("Maximum number of comments (updates) to fetch per item when include_comments is true. Defaults to 50. Only used in content mode."),version_history_limit:y.number().optional().describe('Maximum number of restoring points to return. Use this when the user asks for "last N changes". Only used in version_history mode.'),since:y.string().optional().describe('ISO 8601 date string to filter version history from (e.g., "2026-03-15T00:00:00Z"). If omitted, returns the full history. Only used in version_history mode.'),until:y.string().optional().describe('ISO 8601 date string to filter version history until (e.g., "2026-03-16T23:59:59Z"). Defaults to now. Only used in version_history mode.'),include_diff:y.boolean().optional().default(!1).describe("If true, fetches content diffs between consecutive restoring points. May be slower due to additional API calls. Only used in version_history mode.")};const LE={workspace_id:y.number().describe("The ID of the workspace to get information for")};const FE=sw`
1369
1369
  query listWorkspaces($limit: Int!, $page: Int!, $membershipKind: WorkspaceMembershipKind!) {
1370
1370
  workspaces(limit: $limit, page: $page, membership_kind: $membershipKind) {
1371
1371
  id
@@ -1373,7 +1373,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1373
1373
  description
1374
1374
  }
1375
1375
  }
1376
- `,jE=100,UE=e=>e.toLocaleLowerCase().replace(/[^\p{L}\d]/gu,"");function VE(e){const t=e.workspaces?.filter((e=>null!==e));return t||[]}function BE(e){return Array.isArray(e)&&e.length>0}const ME={searchTerm:y.string().optional().describe("Optional search term used to filter workspaces. [IMPORTANT] Only alphanumeric characters are supported."),limit:y.number().min(1).max(jE).default(jE).describe("Number of workspaces to return. Default is (100), lower for a smaller response size"),page:y.number().min(1).default(1).describe("Page number to return. Default is 1.")};const qE=sw`
1376
+ `,PE=100,jE=e=>e.toLocaleLowerCase().replace(/[^\p{L}\d]/gu,"");function UE(e){const t=e.workspaces?.filter((e=>null!==e));return t||[]}function VE(e){return Array.isArray(e)&&e.length>0}const BE={searchTerm:y.string().optional().describe("Optional search term used to filter workspaces. [IMPORTANT] Only alphanumeric characters are supported."),limit:y.number().min(1).max(PE).default(PE).describe("Number of workspaces to return. Default is (100), lower for a smaller response size"),page:y.number().min(1).default(1).describe("Page number to return. Default is 1.")};const ME=sw`
1377
1377
  query getItemBoard($itemId: ID!) {
1378
1378
  items(ids: [$itemId]) {
1379
1379
  id
@@ -1386,7 +1386,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1386
1386
  }
1387
1387
  }
1388
1388
  }
1389
- `,HE=sw`
1389
+ `,qE=sw`
1390
1390
  mutation createDoc($location: CreateDocInput!) {
1391
1391
  create_doc(location: $location) {
1392
1392
  id
@@ -1395,7 +1395,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1395
1395
  name
1396
1396
  }
1397
1397
  }
1398
- `,GE=sw`
1398
+ `,HE=sw`
1399
1399
  mutation addContentToDocFromMarkdown($docId: ID!, $markdown: String!, $afterBlockId: String) {
1400
1400
  add_content_to_doc_from_markdown(docId: $docId, markdown: $markdown, afterBlockId: $afterBlockId) {
1401
1401
  success
@@ -1403,11 +1403,11 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1403
1403
  error
1404
1404
  }
1405
1405
  }
1406
- `,zE=sw`
1406
+ `,GE=sw`
1407
1407
  mutation updateDocName($docId: ID!, $name: String!) {
1408
1408
  update_doc_name(docId: $docId, name: $name)
1409
1409
  }
1410
- `,WE=y.enum(["workspace","item"]),YE=y.discriminatedUnion("type",[y.object({type:y.literal(WE.enum.workspace).describe("Create document in workspace"),workspace_id:y.number().describe("Workspace ID under which to create the new document"),doc_kind:y.nativeEnum(Gb).optional().describe("Document kind (public/private/share). Defaults to public."),folder_id:y.number().optional().describe("Optional folder ID to place the document inside a specific folder")}),y.object({type:y.literal(WE.enum.item).describe("Create document attached to item"),item_id:y.number().describe("Item ID to attach the new document to"),column_id:y.string().optional().describe("ID of an existing 'doc' column on the board which contains the item. If not provided, the tool will create a new doc column automatically when creating a doc on an item.")})]),KE={doc_name:y.string().describe("Name for the new document."),markdown:y.string().describe("Markdown content that will be imported into the newly created document as blocks."),location:y.enum(["workspace","item"]).describe("Location where the document should be created - either in a workspace or attached to an item"),workspace_id:y.number().optional().describe('[REQUIRED - use only when location="workspace"] Workspace ID under which to create the new document'),doc_kind:y.nativeEnum(Gb).optional().describe('[OPTIONAL - use only when location="workspace"] Document kind (public/private/share). Defaults to public.'),folder_id:y.number().optional().describe('[OPTIONAL - use only when location="workspace"] Optional folder ID to place the document inside a specific folder'),item_id:y.number().optional().describe('[REQUIRED - use only when location="item"] Item ID to attach the new document to'),column_id:y.string().optional().describe('[OPTIONAL - use only when location="item"] ID of an existing "doc" column on the board which contains the item. If not provided, the tool will create a new doc column automatically when creating a doc on an item.')};const QE=sw`
1410
+ `,zE=y.enum(["workspace","item"]),WE=y.discriminatedUnion("type",[y.object({type:y.literal(zE.enum.workspace).describe("Create document in workspace"),workspace_id:y.number().describe("Workspace ID under which to create the new document"),doc_kind:y.nativeEnum(Gb).optional().describe("Document kind (public/private/share). Defaults to public."),folder_id:y.number().optional().describe("Optional folder ID to place the document inside a specific folder")}),y.object({type:y.literal(zE.enum.item).describe("Create document attached to item"),item_id:y.number().describe("Item ID to attach the new document to"),column_id:y.string().optional().describe("ID of an existing 'doc' column on the board which contains the item. If not provided, the tool will create a new doc column automatically when creating a doc on an item.")})]),YE={doc_name:y.string().describe("Name for the new document."),markdown:y.string().describe("Markdown content that will be imported into the newly created document as blocks."),location:y.enum(["workspace","item"]).describe("Location where the document should be created - either in a workspace or attached to an item"),workspace_id:y.number().optional().describe('[REQUIRED - use only when location="workspace"] Workspace ID under which to create the new document'),doc_kind:y.nativeEnum(Gb).optional().describe('[OPTIONAL - use only when location="workspace"] Document kind (public/private/share). Defaults to public.'),folder_id:y.number().optional().describe('[OPTIONAL - use only when location="workspace"] Optional folder ID to place the document inside a specific folder'),item_id:y.number().optional().describe('[REQUIRED - use only when location="item"] Item ID to attach the new document to'),column_id:y.string().optional().describe('[OPTIONAL - use only when location="item"] ID of an existing "doc" column on the board which contains the item. If not provided, the tool will create a new doc column automatically when creating a doc on an item.')};const KE=sw`
1411
1411
  mutation addContentToDocFromMarkdown($docId: ID!, $markdown: String!, $afterBlockId: String) {
1412
1412
  add_content_to_doc_from_markdown(docId: $docId, markdown: $markdown, afterBlockId: $afterBlockId) {
1413
1413
  success
@@ -1415,7 +1415,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1415
1415
  error
1416
1416
  }
1417
1417
  }
1418
- `,JE=sw`
1418
+ `,QE=sw`
1419
1419
  query getDocByObjectId($objectId: [ID!]) {
1420
1420
  docs(object_ids: $objectId) {
1421
1421
  id
@@ -1423,7 +1423,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1423
1423
  url
1424
1424
  }
1425
1425
  }
1426
- `,XE=sw`
1426
+ `,JE=sw`
1427
1427
  query getDocById($docId: [ID!]) {
1428
1428
  docs(ids: $docId) {
1429
1429
  id
@@ -1431,11 +1431,11 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1431
1431
  url
1432
1432
  }
1433
1433
  }
1434
- `,ZE={doc_id:y.string().min(1).optional().describe("The document ID (the id field returned by read_docs). Provide this OR object_id. Takes priority if both are provided."),object_id:y.string().min(1).optional().describe("The document object ID (the object_id field from read_docs, also visible in the document URL). Will be resolved to a doc_id. Provide this OR doc_id."),markdown:y.string().describe("Markdown content to add to the document."),after_block_id:y.string().optional().describe("Block ID after which to insert the new content. If omitted, content is appended at the end. To insert at the beginning, pass the first block ID from read_docs. Block IDs can be obtained from read_docs or from a previous add_content_to_doc response.")};const eI=sw`
1434
+ `,XE={doc_id:y.string().min(1).optional().describe("The document ID (the id field returned by read_docs). Provide this OR object_id. Takes priority if both are provided."),object_id:y.string().min(1).optional().describe("The document object ID (the object_id field from read_docs, also visible in the document URL). Will be resolved to a doc_id. Provide this OR doc_id."),markdown:y.string().describe("Markdown content to add to the document."),after_block_id:y.string().optional().describe("Block ID after which to insert the new content. If omitted, content is appended at the end. To insert at the beginning, pass the first block ID from read_docs. Block IDs can be obtained from read_docs or from a previous add_content_to_doc response.")};const ZE=sw`
1435
1435
  mutation updateDocName($docId: ID!, $name: String!) {
1436
1436
  update_doc_name(docId: $docId, name: $name)
1437
1437
  }
1438
- `,tI=sw`
1438
+ `,eI=sw`
1439
1439
  mutation addContentToDocFromMarkdown($docId: ID!, $markdown: String!, $afterBlockId: String) {
1440
1440
  add_content_to_doc_from_markdown(docId: $docId, markdown: $markdown, afterBlockId: $afterBlockId) {
1441
1441
  success
@@ -1443,13 +1443,13 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1443
1443
  error
1444
1444
  }
1445
1445
  }
1446
- `,aI=sw`
1446
+ `,tI=sw`
1447
1447
  query getDocByObjectId($objectId: [ID!]) {
1448
1448
  docs(object_ids: $objectId) {
1449
1449
  id
1450
1450
  }
1451
1451
  }
1452
- `,iI=sw`
1452
+ `,aI=sw`
1453
1453
  mutation updateDocBlock($blockId: String!, $content: JSON!) {
1454
1454
  update_doc_block(block_id: $blockId, content: $content) {
1455
1455
  id
@@ -1457,20 +1457,20 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1457
1457
  created_at
1458
1458
  }
1459
1459
  }
1460
- `,nI=sw`
1460
+ `,iI=sw`
1461
1461
  mutation deleteDocBlock($blockId: String!) {
1462
1462
  delete_doc_block(block_id: $blockId) {
1463
1463
  id
1464
1464
  }
1465
1465
  }
1466
- `,oI=sw`
1466
+ `,nI=sw`
1467
1467
  query getDocObjectIdByDocId($docId: [ID!]) {
1468
1468
  docs(ids: $docId) {
1469
1469
  id
1470
1470
  object_id
1471
1471
  }
1472
1472
  }
1473
- `,rI=sw`
1473
+ `,oI=sw`
1474
1474
  query getDocBoardItem($boardId: ID!) {
1475
1475
  boards(ids: [$boardId]) {
1476
1476
  items_page(limit: 1) {
@@ -1480,7 +1480,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1480
1480
  }
1481
1481
  }
1482
1482
  }
1483
- `,sI=sw`
1483
+ `,rI=sw`
1484
1484
  mutation createDocComment($itemId: ID!, $body: String!, $parentId: ID, $mentionsList: [UpdateMention]) {
1485
1485
  create_update(body: $body, item_id: $itemId, parent_id: $parentId, mentions_list: $mentionsList) {
1486
1486
  id
@@ -1488,7 +1488,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1488
1488
  created_at
1489
1489
  }
1490
1490
  }
1491
- `,pI=sw`
1491
+ `,sI=sw`
1492
1492
  mutation createDocBlocks($docId: ID!, $afterBlockId: String, $blocksInput: [CreateBlockInput!]!) {
1493
1493
  create_doc_blocks(docId: $docId, afterBlockId: $afterBlockId, blocksInput: $blocksInput) {
1494
1494
  id
@@ -1556,7 +1556,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1556
1556
  }
1557
1557
  }
1558
1558
  }
1559
- `;function dI(e){if(e)return e}function cI(e){if(e)return e}function lI(e){if(e)return{bold:e.bold,italic:e.italic,underline:e.underline,strike:e.strike,code:e.code,link:e.link,color:e.color,background:e.background}}function mI(e){return e.map((e=>{if("mention"in e.insert){const t=Number(e.insert.mention.id);if(Number.isNaN(t))throw new Error(`Invalid mention id: "${e.insert.mention.id}" is not a valid numeric ID`);return{insert:{blot:{mention:{id:String(t),type:e.insert.mention.type}}}}}return"column_value"in e.insert?{insert:{blot:{column_value:{item_id:String(e.insert.column_value.item_id),column_id:e.insert.column_value.column_id}}}}:{insert:{text:e.insert.text},attributes:lI(e.attributes)}}))}function uI(e){return e.map((e=>{if("mention"in e.insert){const t=Number(e.insert.mention.id);if(Number.isNaN(t))throw new Error(`Invalid mention id: "${e.insert.mention.id}" is not a valid numeric ID`);return{insert:{mention:{id:t,type:e.insert.mention.type}}}}return"column_value"in e.insert?{insert:{macro:{type:"COLUMN_VALUE",macroId:m(),macroData:{itemId:Number(e.insert.column_value.item_id),columnId:e.insert.column_value.column_id}}}}:{insert:e.insert.text,attributes:lI(e.attributes)}}))}const fI=y.object({bold:y.boolean().optional(),italic:y.boolean().optional(),underline:y.boolean().optional(),strike:y.boolean().optional(),code:y.boolean().optional(),link:y.string().optional(),color:y.string().optional(),background:y.string().optional()}).optional(),hI=y.object({mention:y.object({id:y.union([y.string(),y.number()]).describe("User, doc, or board ID. Get user IDs from list_users_and_teams."),type:y.enum(["USER","DOC","BOARD"]).default("USER").describe("Mention type. USER is most common.")}).describe("Mention blot — tags a user, doc, or board inline. Do not set attributes on mention ops.")}),vI=y.object({column_value:y.object({item_id:y.union([y.string(),y.number()]).describe("The board item ID."),column_id:y.string().describe('The column ID (e.g. "status", "date4"). Get column IDs from get_board_schema.')}).describe("Column value blot — embeds a live board column value inline in the doc.")}),bI=y.object({insert:y.union([y.object({text:y.string()}),hI,vI]).describe('Content to insert. Use {text: "..."} for plain text, {mention: {id, type}} to tag a user/doc/board, or {column_value: {item_id, column_id}} to embed a live column value. The last operation in the array must be {text: "\\n"}.'),attributes:fI.describe("Optional formatting: bold, italic, underline, strike, code, link, color, background. Not applicable to mention or column_value ops.")}),gI=y.object({block_content_type:y.literal("text"),delta_format:y.array(bI).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),alignment:y.enum(["LEFT","RIGHT","CENTER"]).optional(),direction:y.enum(["LTR","RTL"]).optional()}),yI=y.object({block_content_type:y.literal("code"),delta_format:y.array(bI).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),language:y.string().optional().describe('Programming language (e.g. "javascript", "python").')}),_I=y.object({block_content_type:y.literal("list_item"),delta_format:y.array(bI).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),checked:y.boolean().optional().describe("Check state for CHECK_LIST items."),indentation:y.number().int().min(0).optional().describe("Nesting level (0 = no indent).")}),wI=y.discriminatedUnion("block_content_type",[gI,yI,_I]),xI=y.object({block_type:y.literal("text"),text_block_type:y.enum(["NORMAL_TEXT","LARGE_TITLE","MEDIUM_TITLE","SMALL_TITLE","QUOTE"]).optional().describe("Block subtype. LARGE_TITLE=H1, MEDIUM_TITLE=H2, SMALL_TITLE=H3."),delta_format:y.array(bI).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),alignment:y.enum(["LEFT","RIGHT","CENTER"]).optional(),direction:y.enum(["LTR","RTL"]).optional()}),TI=y.object({block_type:y.literal("list_item"),list_block_type:y.enum(["BULLETED_LIST","NUMBERED_LIST","CHECK_LIST"]).optional().describe("List type. Defaults to BULLETED_LIST."),delta_format:y.array(bI).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),indentation:y.number().int().min(0).optional().describe("Nesting level (0 = no indent).")}),EI=y.object({block_type:y.literal("code"),delta_format:y.array(bI).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),language:y.string().optional().describe('Programming language (e.g. "javascript", "python").')}),II=y.object({block_type:y.literal("divider")}),SI=y.object({block_type:y.literal("page_break")}),NI=y.object({block_type:y.literal("image"),public_url:y.string().url().optional().describe("Publicly accessible image URL. Provide either public_url or asset_id."),asset_id:y.union([y.number().int(),y.string().regex(/^\d+$/).transform(Number)]).optional().describe("monday.com asset ID for the image. The image block will reference the asset directly. Provide either public_url or asset_id."),width:y.number().int().min(1).optional().describe("Width in pixels.")}),AI=y.object({block_type:y.literal("video"),raw_url:y.string().url().describe("Video URL (YouTube, Vimeo, or direct video URL)."),width:y.number().int().min(1).optional().describe("Width in pixels.")}),DI=y.object({block_type:y.literal("notice_box"),theme:y.enum(["INFO","TIPS","WARNING","GENERAL"]).describe("Visual style of the notice box.")}),kI=y.object({block_type:y.literal("table"),row_count:y.number().int().min(1).max(25).describe("Number of rows (1–25)."),column_count:y.number().int().min(1).max(10).describe("Number of columns (1–10)."),width:y.number().int().optional().describe("Table width in pixels."),column_style:y.array(y.object({width:y.number().int()})).optional().describe("Column widths. Array length must match column_count; widths must sum to 100.")}),OI=y.object({block_type:y.literal("layout"),column_count:y.number().int().min(2).max(6).describe("Number of columns (2–6)."),column_style:y.array(y.object({width:y.number().int()})).optional().describe("Column widths. Array length must match column_count; widths must sum to 100.")}),RI=y.discriminatedUnion("block_type",[xI,TI,EI,II,SI,NI,AI,DI,kI,OI]),CI=y.object({operation_type:y.literal("set_name"),name:y.string().min(1).describe("New document name.")}),$I=y.object({operation_type:y.literal("add_markdown_content"),markdown:y.string().describe("Markdown content to convert and append (or insert) as blocks."),after_block_id:y.string().optional().describe("Insert after this block ID. Omit to append at end. Block IDs come from read_docs.")}),LI=y.object({operation_type:y.literal("update_block"),block_id:y.string().describe("ID of the block to update. Get block IDs from read_docs."),content:wI.describe("New content for the block. Use block_content_type to select: text (updates text/heading/quote content), code (updates code content), list_item (updates bullets/numbered/todo content). Cannot change block subtype — use replace_block for that.")}),FI=y.object({operation_type:y.literal("create_block"),after_block_id:y.string().optional().describe("Insert after this block ID. Omit to append at end. Block IDs come from read_docs."),parent_block_id:y.string().optional().describe("Parent block ID for nested blocks. Only works for notice_box containers — use the notice_box block ID directly. Table/layout cell nesting is NOT supported by the API. IMPORTANT: A notice_box created in the same call cannot be referenced — use a separate call first to create it, then a second call to nest content inside it."),block:RI.describe("The block to create. Use block_type to select the block type.")}),PI=y.object({operation_type:y.literal("delete_block"),block_id:y.string().describe("ID of the block to permanently delete. Works for all block types including BOARD, WIDGET, DOC embed, GIPHY.")}),jI=y.object({operation_type:y.literal("replace_block"),block_id:y.string().describe("ID of the block to delete."),after_block_id:y.string().optional().describe("Insert replacement after this block ID. Provide the ID of the block that precedes the deleted block."),parent_block_id:y.string().optional().describe("Parent block ID for the replacement block."),block:RI.describe("The new block to create in place of the deleted one.")}),UI=y.object({operation_type:y.literal("add_comment"),body:y.string().min(1).describe("The comment text. Use HTML tags for formatting (not markdown). Do not use @ to mention users — use mentions_list instead."),parent_update_id:y.number().optional().describe("The ID of an existing comment (update) to reply to. Omit to create a new top-level comment. Get comment IDs from read_docs with include_comments: true."),mentions_list:y.string().optional().describe('Optional JSON array of mentions: [{"id": "123", "type": "User"}, {"id": "456", "type": "Team"}]. Valid types: User, Team, Board, Project.')}),VI=y.discriminatedUnion("operation_type",[CI,$I,LI,FI,PI,jI,UI]),BI={doc_id:y.string().min(1).optional().describe("The document ID (the id field from read_docs). Takes priority over object_id if both are provided."),object_id:y.string().min(1).optional().describe("The document object ID (the object_id field from read_docs, visible in the document URL). Resolved to doc_id."),operations:y.array(VI).min(1).max(25).describe('Ordered list of operations to perform. Executed sequentially; stops at first failure.\n\nOperation types:\n- set_name: Rename the document.\n- add_markdown_content: Append markdown as blocks (simplest for text/lists/tables).\n- update_block: Change content of an existing text/code/list/divider block.\n- create_block: Create a new block at a specific position (supports text, list_item, code, divider, page_break, image, video, notice_box, table, layout).\n- delete_block: Permanently remove a block. Works for ALL block types including BOARD, WIDGET, DOC embed, GIPHY.\n- replace_block: Delete a block and create a new one in its place. Use for: changing image/video source, table restructure, notice_box theme change.\n- add_comment: Create a new comment or reply on the document. Use parent_update_id to reply to an existing comment. Format text with HTML. Uses the doc\'s backing board item.\n\nWHEN TO USE WHICH:\n- Adding new text sections → add_markdown_content\n- Adding asset-based images → create_block with block_type "image" and asset_id (add_markdown_content does NOT support asset images)\n- Mixed content with asset images → alternate add_markdown_content (for text) and create_block (for each image) in sequence\n- Editing existing text block → update_block\n- Changing an image URL → replace_block (image URL is immutable after creation)\n- Changing video URL → replace_block\n- Restructuring a table → replace_block\n- BOARD/WIDGET/DOC/GIPHY blocks → delete_block only (no public API to create these)\n\nNESTING CONTENT IN CONTAINERS:\n- notice_box: Fully supported. Create the notice_box first, then in a separate call create child blocks with parent_block_id set to the notice_box ID. You cannot reference a block ID created in the same call.\n- table: Cell-level API nesting is NOT supported. To create a table with content, use add_markdown_content with a markdown table (e.g. "| H1 | H2 |\\n| --- | --- |\\n| A | B |"). This creates a pre-populated table in one shot. Empty tables created via create_block cannot have their cells populated through the API.\n- layout: Cell-level API nesting is NOT supported and there is no markdown equivalent. Layouts can only be created empty via create_block. No workaround exists to populate layout columns through the API.\nDeleting a container does NOT delete its children — delete children first for clean removal.\n\nBlock IDs are available in the blocks array returned by read_docs.')};const MI=sw`
1559
+ `;function pI(e){if(e)return e}function dI(e){if(e)return e}function cI(e){if(e)return{bold:e.bold,italic:e.italic,underline:e.underline,strike:e.strike,code:e.code,link:e.link,color:e.color,background:e.background}}function lI(e){return e.map((e=>{if("mention"in e.insert){const t=Number(e.insert.mention.id);if(Number.isNaN(t))throw new Error(`Invalid mention id: "${e.insert.mention.id}" is not a valid numeric ID`);return{insert:{blot:{mention:{id:String(t),type:e.insert.mention.type}}}}}return"column_value"in e.insert?{insert:{blot:{column_value:{item_id:String(e.insert.column_value.item_id),column_id:e.insert.column_value.column_id}}}}:{insert:{text:e.insert.text},attributes:cI(e.attributes)}}))}function mI(e){return e.map((e=>{if("mention"in e.insert){const t=Number(e.insert.mention.id);if(Number.isNaN(t))throw new Error(`Invalid mention id: "${e.insert.mention.id}" is not a valid numeric ID`);return{insert:{mention:{id:t,type:e.insert.mention.type}}}}return"column_value"in e.insert?{insert:{macro:{type:"COLUMN_VALUE",macroId:m(),macroData:{itemId:Number(e.insert.column_value.item_id),columnId:e.insert.column_value.column_id}}}}:{insert:e.insert.text,attributes:cI(e.attributes)}}))}const uI=y.object({bold:y.boolean().optional(),italic:y.boolean().optional(),underline:y.boolean().optional(),strike:y.boolean().optional(),code:y.boolean().optional(),link:y.string().optional(),color:y.string().optional(),background:y.string().optional()}).optional(),fI=y.object({mention:y.object({id:y.union([y.string(),y.number()]).describe("User, doc, or board ID. Get user IDs from list_users_and_teams."),type:y.enum(["USER","DOC","BOARD"]).default("USER").describe("Mention type. USER is most common.")}).describe("Mention blot — tags a user, doc, or board inline. Do not set attributes on mention ops.")}),hI=y.object({column_value:y.object({item_id:y.union([y.string(),y.number()]).describe("The board item ID."),column_id:y.string().describe('The column ID (e.g. "status", "date4"). Get column IDs from get_board_schema.')}).describe("Column value blot — embeds a live board column value inline in the doc.")}),vI=y.object({insert:y.union([y.object({text:y.string()}),fI,hI]).describe('Content to insert. Use {text: "..."} for plain text, {mention: {id, type}} to tag a user/doc/board, or {column_value: {item_id, column_id}} to embed a live column value. The last operation in the array must be {text: "\\n"}.'),attributes:uI.describe("Optional formatting: bold, italic, underline, strike, code, link, color, background. Not applicable to mention or column_value ops.")}),bI=y.object({block_content_type:y.literal("text"),delta_format:y.array(vI).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),alignment:y.enum(["LEFT","RIGHT","CENTER"]).optional(),direction:y.enum(["LTR","RTL"]).optional()}),gI=y.object({block_content_type:y.literal("code"),delta_format:y.array(vI).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),language:y.string().optional().describe('Programming language (e.g. "javascript", "python").')}),yI=y.object({block_content_type:y.literal("list_item"),delta_format:y.array(vI).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),checked:y.boolean().optional().describe("Check state for CHECK_LIST items."),indentation:y.number().int().min(0).optional().describe("Nesting level (0 = no indent).")}),_I=y.discriminatedUnion("block_content_type",[bI,gI,yI]),wI=y.object({block_type:y.literal("text"),text_block_type:y.enum(["NORMAL_TEXT","LARGE_TITLE","MEDIUM_TITLE","SMALL_TITLE","QUOTE"]).optional().describe("Block subtype. LARGE_TITLE=H1, MEDIUM_TITLE=H2, SMALL_TITLE=H3."),delta_format:y.array(vI).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),alignment:y.enum(["LEFT","RIGHT","CENTER"]).optional(),direction:y.enum(["LTR","RTL"]).optional()}),xI=y.object({block_type:y.literal("list_item"),list_block_type:y.enum(["BULLETED_LIST","NUMBERED_LIST","CHECK_LIST"]).optional().describe("List type. Defaults to BULLETED_LIST."),delta_format:y.array(vI).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),indentation:y.number().int().min(0).optional().describe("Nesting level (0 = no indent).")}),TI=y.object({block_type:y.literal("code"),delta_format:y.array(vI).min(1).describe('Array of delta operations. Last op must be {insert: {text: "\\n"}}.'),language:y.string().optional().describe('Programming language (e.g. "javascript", "python").')}),EI=y.object({block_type:y.literal("divider")}),II=y.object({block_type:y.literal("page_break")}),SI=y.object({block_type:y.literal("image"),public_url:y.string().url().optional().describe("Publicly accessible image URL. Provide either public_url or asset_id."),asset_id:y.union([y.number().int(),y.string().regex(/^\d+$/).transform(Number)]).optional().describe("monday.com asset ID for the image. The image block will reference the asset directly. Provide either public_url or asset_id."),width:y.number().int().min(1).optional().describe("Width in pixels.")}),NI=y.object({block_type:y.literal("video"),raw_url:y.string().url().describe("Video URL (YouTube, Vimeo, or direct video URL)."),width:y.number().int().min(1).optional().describe("Width in pixels.")}),AI=y.object({block_type:y.literal("notice_box"),theme:y.enum(["INFO","TIPS","WARNING","GENERAL"]).describe("Visual style of the notice box.")}),DI=y.object({block_type:y.literal("table"),row_count:y.number().int().min(1).max(25).describe("Number of rows (1–25)."),column_count:y.number().int().min(1).max(10).describe("Number of columns (1–10)."),width:y.number().int().optional().describe("Table width in pixels."),column_style:y.array(y.object({width:y.number().int()})).optional().describe("Column widths. Array length must match column_count; widths must sum to 100.")}),kI=y.object({block_type:y.literal("layout"),column_count:y.number().int().min(2).max(6).describe("Number of columns (2–6)."),column_style:y.array(y.object({width:y.number().int()})).optional().describe("Column widths. Array length must match column_count; widths must sum to 100.")}),OI=y.discriminatedUnion("block_type",[wI,xI,TI,EI,II,SI,NI,AI,DI,kI]),RI=y.object({operation_type:y.literal("set_name"),name:y.string().min(1).describe("New document name.")}),CI=y.object({operation_type:y.literal("add_markdown_content"),markdown:y.string().describe("Markdown content to convert and append (or insert) as blocks."),after_block_id:y.string().optional().describe("Insert after this block ID. Omit to append at end. Block IDs come from read_docs.")}),$I=y.object({operation_type:y.literal("update_block"),block_id:y.string().describe("ID of the block to update. Get block IDs from read_docs."),content:_I.describe("New content for the block. Use block_content_type to select: text (updates text/heading/quote content), code (updates code content), list_item (updates bullets/numbered/todo content). Cannot change block subtype — use replace_block for that.")}),LI=y.object({operation_type:y.literal("create_block"),after_block_id:y.string().optional().describe("Insert after this block ID. Omit to append at end. Block IDs come from read_docs."),parent_block_id:y.string().optional().describe("Parent block ID for nested blocks. Only works for notice_box containers — use the notice_box block ID directly. Table/layout cell nesting is NOT supported by the API. IMPORTANT: A notice_box created in the same call cannot be referenced — use a separate call first to create it, then a second call to nest content inside it."),block:OI.describe("The block to create. Use block_type to select the block type.")}),FI=y.object({operation_type:y.literal("delete_block"),block_id:y.string().describe("ID of the block to permanently delete. Works for all block types including BOARD, WIDGET, DOC embed, GIPHY.")}),PI=y.object({operation_type:y.literal("replace_block"),block_id:y.string().describe("ID of the block to delete."),after_block_id:y.string().optional().describe("Insert replacement after this block ID. Provide the ID of the block that precedes the deleted block."),parent_block_id:y.string().optional().describe("Parent block ID for the replacement block."),block:OI.describe("The new block to create in place of the deleted one.")}),jI=y.object({operation_type:y.literal("add_comment"),body:y.string().min(1).describe("The comment text. Use HTML tags for formatting (not markdown). Do not use @ to mention users — use mentions_list instead."),parent_update_id:y.number().optional().describe("The ID of an existing comment (update) to reply to. Omit to create a new top-level comment. Get comment IDs from read_docs with include_comments: true."),mentions_list:y.string().optional().describe('Optional JSON array of mentions: [{"id": "123", "type": "User"}, {"id": "456", "type": "Team"}]. Valid types: User, Team, Board, Project.')}),UI=y.discriminatedUnion("operation_type",[RI,CI,$I,LI,FI,PI,jI]),VI={doc_id:y.string().min(1).optional().describe("The document ID (the id field from read_docs). Takes priority over object_id if both are provided."),object_id:y.string().min(1).optional().describe("The document object ID (the object_id field from read_docs, visible in the document URL). Resolved to doc_id."),operations:y.array(UI).min(1).max(25).describe('Ordered list of operations to perform. Executed sequentially; stops at first failure.\n\nOperation types:\n- set_name: Rename the document.\n- add_markdown_content: Append markdown as blocks (simplest for text/lists/tables).\n- update_block: Change content of an existing text/code/list/divider block.\n- create_block: Create a new block at a specific position (supports text, list_item, code, divider, page_break, image, video, notice_box, table, layout).\n- delete_block: Permanently remove a block. Works for ALL block types including BOARD, WIDGET, DOC embed, GIPHY.\n- replace_block: Delete a block and create a new one in its place. Use for: changing image/video source, table restructure, notice_box theme change.\n- add_comment: Create a new comment or reply on the document. Use parent_update_id to reply to an existing comment. Format text with HTML. Uses the doc\'s backing board item.\n\nWHEN TO USE WHICH:\n- Adding new text sections → add_markdown_content\n- Adding asset-based images → create_block with block_type "image" and asset_id (add_markdown_content does NOT support asset images)\n- Mixed content with asset images → alternate add_markdown_content (for text) and create_block (for each image) in sequence\n- Editing existing text block → update_block\n- Changing an image URL → replace_block (image URL is immutable after creation)\n- Changing video URL → replace_block\n- Restructuring a table → replace_block\n- BOARD/WIDGET/DOC/GIPHY blocks → delete_block only (no public API to create these)\n\nNESTING CONTENT IN CONTAINERS:\n- notice_box: Fully supported. Create the notice_box first, then in a separate call create child blocks with parent_block_id set to the notice_box ID. You cannot reference a block ID created in the same call.\n- table: Cell-level API nesting is NOT supported. To create a table with content, use add_markdown_content with a markdown table (e.g. "| H1 | H2 |\\n| --- | --- |\\n| A | B |"). This creates a pre-populated table in one shot. Empty tables created via create_block cannot have their cells populated through the API.\n- layout: Cell-level API nesting is NOT supported and there is no markdown equivalent. Layouts can only be created empty via create_block. No workaround exists to populate layout columns through the API.\nDeleting a container does NOT delete its children — delete children first for clean removal.\n\nBlock IDs are available in the blocks array returned by read_docs.')};const BI=sw`
1560
1560
  mutation CreateDashboard(
1561
1561
  $name: String!
1562
1562
  $workspace_id: ID!
@@ -1578,14 +1578,14 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1578
1578
  board_folder_id
1579
1579
  }
1580
1580
  }
1581
- `,qI=sw`
1581
+ `,MI=sw`
1582
1582
  query GetAllWidgetsSchema {
1583
1583
  all_widgets_schema {
1584
1584
  widget_type
1585
1585
  schema
1586
1586
  }
1587
1587
  }
1588
- `,HI=sw`
1588
+ `,qI=sw`
1589
1589
  mutation CreateWidget($parent: WidgetParentInput!, $kind: ExternalWidget!, $name: String!, $settings: JSON!) {
1590
1590
  create_widget(parent: $parent, kind: $kind, name: $name, settings: $settings) {
1591
1591
  id
@@ -1597,14 +1597,14 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1597
1597
  }
1598
1598
  }
1599
1599
  }
1600
- `,GI={name:y.string().min(1,"Dashboard name is required").describe("Human-readable dashboard title (UTF-8 chars)"),workspace_id:y.string().describe("ID of the workspace that will own the dashboard"),board_ids:y.array(y.string()).min(1,"At least one board ID is required").max(50,"A maximum of 50 board IDs are allowed").describe("List of board IDs as strings (min 1 element)"),kind:y.nativeEnum(dg).default(dg.Public).describe("Visibility level: PUBLIC or PRIVATE"),board_folder_id:y.string().optional().describe("Optional folder ID within workspace to place this dashboard (if not provided, dashboard will be placed in workspace root)")};const zI={parent_container_id:y.string().describe("ID of the parent container (dashboard ID or board view ID)"),parent_container_type:y.nativeEnum(Py).describe("Type of parent container: DASHBOARD or BOARD_VIEW"),widget_kind:y.nativeEnum(_g).describe("Type of widget to create: i.e CHART, NUMBER, BATTERY"),widget_name:y.string().min(1,"Widget name is required").max(255,"Widget name must be 255 characters or less").describe("Widget display name (1-255 UTF-8 chars)"),settings:y.record(y.unknown()).optional().describe("Widget-specific settings as JSON object conforming to widget schema. Use all_widgets_schema tool to get the required schema for each widget type.")};const WI=sw`
1600
+ `,HI={name:y.string().min(1,"Dashboard name is required").describe("Human-readable dashboard title (UTF-8 chars)"),workspace_id:y.string().describe("ID of the workspace that will own the dashboard"),board_ids:y.array(y.string()).min(1,"At least one board ID is required").max(50,"A maximum of 50 board IDs are allowed").describe("List of board IDs as strings (min 1 element)"),kind:y.nativeEnum(dg).default(dg.Public).describe("Visibility level: PUBLIC or PRIVATE"),board_folder_id:y.string().optional().describe("Optional folder ID within workspace to place this dashboard (if not provided, dashboard will be placed in workspace root)")};const GI={parent_container_id:y.string().describe("ID of the parent container (dashboard ID or board view ID)"),parent_container_type:y.nativeEnum(Py).describe("Type of parent container: DASHBOARD or BOARD_VIEW"),widget_kind:y.nativeEnum(_g).describe("Type of widget to create: i.e CHART, NUMBER, BATTERY"),widget_name:y.string().min(1,"Widget name is required").max(255,"Widget name must be 255 characters or less").describe("Widget display name (1-255 UTF-8 chars)"),settings:y.record(y.unknown()).optional().describe("Widget-specific settings as JSON object conforming to widget schema. Use all_widgets_schema tool to get the required schema for each widget type.")};const zI=sw`
1601
1601
  mutation updateWorkspace($id: ID!, $attributes: UpdateWorkspaceAttributesInput!) {
1602
1602
  update_workspace(id: $id, attributes: $attributes) {
1603
1603
  id
1604
1604
  name
1605
1605
  }
1606
1606
  }
1607
- `,YI={id:y.string().describe("The ID of the workspace to update"),attributeAccountProductId:y.number().optional().describe("The target account product's ID to move the workspace to"),attributeDescription:y.string().optional().describe("The description of the workspace to update"),attributeKind:y.nativeEnum(jy).optional().describe("The kind of the workspace to update (open / closed / template)"),attributeName:y.string().optional().describe("The name of the workspace to update")};const KI=sw`
1607
+ `,WI={id:y.string().describe("The ID of the workspace to update"),attributeAccountProductId:y.number().optional().describe("The target account product's ID to move the workspace to"),attributeDescription:y.string().optional().describe("The description of the workspace to update"),attributeKind:y.nativeEnum(jy).optional().describe("The kind of the workspace to update (open / closed / template)"),attributeName:y.string().optional().describe("The name of the workspace to update")};const YI=sw`
1608
1608
  mutation updateFolder(
1609
1609
  $folderId: ID!
1610
1610
  $name: String
@@ -1631,7 +1631,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1631
1631
  name
1632
1632
  }
1633
1633
  }
1634
- `,QI={folderId:y.string().describe("The ID of the folder to update"),name:y.string().optional().describe("The new name of the folder"),color:y.nativeEnum(Eg).optional().describe("The new color of the folder"),fontWeight:y.nativeEnum(Sg).optional().describe("The new font weight of the folder"),customIcon:y.nativeEnum(Ig).optional().describe("The new custom icon of the folder"),parentFolderId:y.string().optional().describe("The ID of the new parent folder"),workspaceId:y.string().optional().describe("The ID of the workspace containing the folder"),accountProductId:y.string().optional().describe("The account product ID associated with the folder"),position_object_id:y.string().optional().describe("The ID of the object to position the folder relative to. If this parameter is provided, position_object_type must be also provided."),position_object_type:y.nativeEnum(ty).optional().describe("The type of object to position the folder relative to. If this parameter is provided, position_object_id must be also provided."),position_is_after:y.boolean().optional().describe("Whether to position the folder after the object")};const JI=sw`
1634
+ `,KI={folderId:y.string().describe("The ID of the folder to update"),name:y.string().optional().describe("The new name of the folder"),color:y.nativeEnum(Eg).optional().describe("The new color of the folder"),fontWeight:y.nativeEnum(Sg).optional().describe("The new font weight of the folder"),customIcon:y.nativeEnum(Ig).optional().describe("The new custom icon of the folder"),parentFolderId:y.string().optional().describe("The ID of the new parent folder"),workspaceId:y.string().optional().describe("The ID of the workspace containing the folder"),accountProductId:y.string().optional().describe("The account product ID associated with the folder"),position_object_id:y.string().optional().describe("The ID of the object to position the folder relative to. If this parameter is provided, position_object_type must be also provided."),position_object_type:y.nativeEnum(ty).optional().describe("The type of object to position the folder relative to. If this parameter is provided, position_object_id must be also provided."),position_is_after:y.boolean().optional().describe("Whether to position the folder after the object")};const QI=sw`
1635
1635
  mutation createWorkspace(
1636
1636
  $name: String!
1637
1637
  $workspaceKind: WorkspaceKind!
@@ -1648,7 +1648,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1648
1648
  name
1649
1649
  }
1650
1650
  }
1651
- `,XI={name:y.string().describe("The name of the new workspace to be created"),workspaceKind:y.nativeEnum(jy).describe("The kind of workspace to create"),description:y.string().optional().describe("The description of the new workspace"),accountProductId:y.string().optional().describe("The account product ID associated with the workspace")};const ZI=sw`
1651
+ `,JI={name:y.string().describe("The name of the new workspace to be created"),workspaceKind:y.nativeEnum(jy).describe("The kind of workspace to create"),description:y.string().optional().describe("The description of the new workspace"),accountProductId:y.string().optional().describe("The account product ID associated with the workspace")};const XI=sw`
1652
1652
  mutation createFolder(
1653
1653
  $workspaceId: ID!
1654
1654
  $name: String!
@@ -1669,7 +1669,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1669
1669
  name
1670
1670
  }
1671
1671
  }
1672
- `,eS={workspaceId:y.string().describe("The ID of the workspace where the folder will be created"),name:y.string().describe("The name of the folder to be created"),color:y.nativeEnum(Eg).optional().describe("The color of the folder"),fontWeight:y.nativeEnum(Sg).optional().describe("The font weight of the folder"),customIcon:y.nativeEnum(Ig).optional().describe("The custom icon of the folder"),parentFolderId:y.string().optional().describe("The ID of the parent folder")};const tS=sw`
1672
+ `,ZI={workspaceId:y.string().describe("The ID of the workspace where the folder will be created"),name:y.string().describe("The name of the folder to be created"),color:y.nativeEnum(Eg).optional().describe("The color of the folder"),fontWeight:y.nativeEnum(Sg).optional().describe("The font weight of the folder"),customIcon:y.nativeEnum(Ig).optional().describe("The custom icon of the folder"),parentFolderId:y.string().optional().describe("The ID of the parent folder")};const eS=sw`
1673
1673
  mutation updateBoardHierarchy($boardId: ID!, $attributes: UpdateBoardHierarchyAttributesInput!) {
1674
1674
  update_board_hierarchy(board_id: $boardId, attributes: $attributes) {
1675
1675
  success
@@ -1679,7 +1679,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1679
1679
  }
1680
1680
  }
1681
1681
  }
1682
- `,aS=sw`
1682
+ `,tS=sw`
1683
1683
  mutation updateOverviewHierarchy($overviewId: ID!, $attributes: UpdateOverviewHierarchyAttributesInput!) {
1684
1684
  update_overview_hierarchy(overview_id: $overviewId, attributes: $attributes) {
1685
1685
  success
@@ -1689,7 +1689,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1689
1689
  }
1690
1690
  }
1691
1691
  }
1692
- `,iS={objectType:y.nativeEnum(ty).describe("The type of object to move"),id:y.string().describe("The ID of the object to move"),position_object_id:y.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:y.nativeEnum(ty).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:y.boolean().optional().describe("Whether to position the object after the object"),parentFolderId:y.string().optional().describe("The ID of the new parent folder. Required if moving to a different folder."),workspaceId:y.string().optional().describe("The ID of the workspace containing the object. Required if moving to a different workspace."),accountProductId:y.string().optional().describe("The ID of the account product containing the object. Required if moving to a different account product.")};const nS=sw`
1692
+ `,aS={objectType:y.nativeEnum(ty).describe("The type of object to move"),id:y.string().describe("The ID of the object to move"),position_object_id:y.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:y.nativeEnum(ty).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:y.boolean().optional().describe("Whether to position the object after the object"),parentFolderId:y.string().optional().describe("The ID of the new parent folder. Required if moving to a different folder."),workspaceId:y.string().optional().describe("The ID of the workspace containing the object. Required if moving to a different workspace."),accountProductId:y.string().optional().describe("The ID of the account product containing the object. Required if moving to a different account product.")};const iS=sw`
1693
1693
  query aggregateBoardInsights($query: AggregateQueryInput!, $boardId: ID!) {
1694
1694
  boards(ids: [$boardId]) {
1695
1695
  name
@@ -1711,7 +1711,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1711
1711
  }
1712
1712
  }
1713
1713
  }
1714
- `,oS=new Set([Db.Case,Db.Between,Db.Left,Db.Raw,Db.None,Db.CountKeys]),rS=Object.values(Db).filter((e=>!oS.has(e))),sS=new Set([Db.Left,Db.Trim,Db.Upper,Db.Lower,Db.DateTruncDay,Db.DateTruncWeek,Db.DateTruncMonth,Db.DateTruncQuarter,Db.DateTruncYear,Db.Color,Db.Label,Db.EndDate,Db.StartDate,Db.Hour,Db.PhoneCountryShortName,Db.Person,Db.Upper,Db.Lower,Db.Order,Db.Length,Db.Flatten,Db.IsDone]);function pS(e){return{column_id:e}}new Set([Db.Count,Db.CountDistinct,Db.CountSubitems,Db.CountItems,Db.First,Db.Sum,Db.Average,Db.Median,Db.Min,Db.Max,Db.MinMax]);const dS={boardId:y.number().describe("The id of the board to get insights for"),aggregations:y.array(y.object({function:y.enum(rS).describe("The function of the aggregation. For simple column value leave undefined").optional(),columnId:y.string().describe("The id of the column to aggregate")})).describe('The aggregations to get. Before sending the aggregations, use get_board_info tool to check "aggregationGuidelines" key for information. Transformative functions and plain columns (no function) must be in group by.').optional(),groupBy:y.array(y.string()).describe("The columns to group by. All columns in the group by must be in the aggregations as well without a function.").optional(),limit:y.number().describe("The limit of the results").max(1e3).optional().default(1e3),filters:PT,filtersOperator:jT,orderBy:y.array(y.object({columnId:y.string().describe("The id of the column to order by"),direction:y.nativeEnum(Bg).optional().default(Bg.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 cS=sw`
1714
+ `,nS=new Set([Db.Case,Db.Between,Db.Left,Db.Raw,Db.None,Db.CountKeys]),oS=Object.values(Db).filter((e=>!nS.has(e))),rS=new Set([Db.Left,Db.Trim,Db.Upper,Db.Lower,Db.DateTruncDay,Db.DateTruncWeek,Db.DateTruncMonth,Db.DateTruncQuarter,Db.DateTruncYear,Db.Color,Db.Label,Db.EndDate,Db.StartDate,Db.Hour,Db.PhoneCountryShortName,Db.Person,Db.Upper,Db.Lower,Db.Order,Db.Length,Db.Flatten,Db.IsDone]);function sS(e){return{column_id:e}}new Set([Db.Count,Db.CountDistinct,Db.CountSubitems,Db.CountItems,Db.First,Db.Sum,Db.Average,Db.Median,Db.Min,Db.Max,Db.MinMax]);const pS={boardId:y.number().describe("The id of the board to get insights for"),aggregations:y.array(y.object({function:y.enum(oS).describe("The function of the aggregation. For simple column value leave undefined").optional(),columnId:y.string().describe("The id of the column to aggregate")})).describe('The aggregations to get. Before sending the aggregations, use get_board_info tool to check "aggregationGuidelines" key for information. Transformative functions and plain columns (no function) must be in group by.').optional(),groupBy:y.array(y.string()).describe("The columns to group by. All columns in the group by must be in the aggregations as well without a function.").optional(),limit:y.number().describe("The limit of the results").max(1e3).optional().default(1e3),filters:PT,filtersOperator:jT,orderBy:y.array(y.object({columnId:y.string().describe("The id of the column to order by"),direction:y.nativeEnum(Bg).optional().default(Bg.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 dS=sw`
1715
1715
  query GetBoards($page: Int!, $limit: Int!, $workspace_ids: [ID]) {
1716
1716
  boards(page: $page, limit: $limit, workspace_ids: $workspace_ids) {
1717
1717
  id
@@ -1719,7 +1719,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1719
1719
  url
1720
1720
  }
1721
1721
  }
1722
- `,lS=sw`
1722
+ `,cS=sw`
1723
1723
  query GetDocs($page: Int!, $limit: Int!, $workspace_ids: [ID]) {
1724
1724
  docs(page: $page, limit: $limit, workspace_ids: $workspace_ids) {
1725
1725
  id
@@ -1727,14 +1727,14 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1727
1727
  url
1728
1728
  }
1729
1729
  }
1730
- `,mS=sw`
1730
+ `,lS=sw`
1731
1731
  query GetFolders($page: Int!, $limit: Int!, $workspace_ids: [ID]) {
1732
1732
  folders(page: $page, limit: $limit, workspace_ids: $workspace_ids) {
1733
1733
  id
1734
1734
  name
1735
1735
  }
1736
1736
  }
1737
- `,uS=sw`
1737
+ `,mS=sw`
1738
1738
  query SearchDev($query: String!, $limit: Int!, $filters: SearchFiltersInput!) {
1739
1739
  search(query: $query, limit: $limit, filters: $filters) {
1740
1740
  __typename
@@ -1755,14 +1755,14 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1755
1755
  }
1756
1756
  }
1757
1757
  }
1758
- `,fS=100,hS={searchTerm:y.string().optional().describe("The search term to use for the search."),searchType:y.nativeEnum(ZT).describe("The type of search to perform."),limit:y.number().max(fS).optional().default(fS).describe("The number of items to get. The max and default value is 100."),page:y.number().optional().default(1).describe("The page number to get. The default value is 1."),workspaceIds:y.array(y.number()).optional().describe("The ids of the workspaces to search in. [IMPORTANT] Only pass this param if user explicitly asked to search within specific workspaces.")};const vS=y.object({id:y.string().describe("The ID of the entity to mention"),type:y.nativeEnum(Qg).describe("The type of mention: User, Team, Board, or Project")}),bS=y.array(vS),gS={itemId:y.number().describe("The id of the item to which the update will be added"),body:y.string().describe("The update text to be created. Do not use @ to mention users, use the mentionsList field instead."),mentionsList:y.string().optional().describe('Optional JSON array of mentions in the format: [{"id": "123", "type": "User"}, {"id": "456", "type": "Team"}]. Valid types are: User, Team, Board, Project')};const yS=sw`
1758
+ `,uS=100,fS={searchTerm:y.string().optional().describe("The search term to use for the search."),searchType:y.nativeEnum(ZT).describe("The type of search to perform."),limit:y.number().max(uS).optional().default(uS).describe("The number of items to get. The max and default value is 100."),page:y.number().optional().default(1).describe("The page number to get. The default value is 1."),workspaceIds:y.array(y.number()).optional().describe("The ids of the workspaces to search in. [IMPORTANT] Only pass this param if user explicitly asked to search within specific workspaces.")};const hS=y.object({id:y.string().describe("The ID of the entity to mention"),type:y.nativeEnum(Qg).describe("The type of mention: User, Team, Board, or Project")}),vS=y.array(hS),bS={itemId:y.number().describe("The id of the item to which the update will be added"),body:y.string().describe("The update text to be created. Do not use @ to mention users, use the mentionsList field instead."),mentionsList:y.string().optional().describe('Optional JSON array of mentions in the format: [{"id": "123", "type": "User"}, {"id": "456", "type": "Team"}]. Valid types are: User, Team, Board, Project')};const gS=sw`
1759
1759
  mutation updateAssetsOnItem($boardId: ID!, $itemId: ID!, $columnId: String!, $files: [FileInput!]!) {
1760
1760
  update_assets_on_item(board_id: $boardId, item_id: $itemId, column_id: $columnId, files: $files) {
1761
1761
  id
1762
1762
  name
1763
1763
  }
1764
1764
  }
1765
- `,_S=y.object({fileType:y.enum(["google_drive","dropbox","box","onedrive","link","asset","doc"]).describe('The type of file: "asset" for uploaded files (requires assetId), "doc" for monday docs (requires objectId), "link" for generic links, "google_drive", "dropbox", "box", "onedrive" for cloud storage links (all link types require linkToFile)'),name:y.string().describe("File display name"),linkToFile:y.string().optional().describe("File link URL. Required for link, google_drive, dropbox, box, and onedrive file types"),assetId:y.number().optional().describe("The asset's ID. Required when fileType is 'asset'"),objectId:y.number().optional().describe("The doc's ID. Required when fileType is 'doc'")}),wS={boardId:y.string().describe("The board's unique identifier"),itemId:y.string().describe("The item's unique identifier"),columnId:y.string().describe("The file or doc column's unique identifier"),files:y.array(_S).describe("Array of file values to set on the column")};const xS=sw`
1765
+ `,yS=y.object({fileType:y.enum(["google_drive","dropbox","box","onedrive","link","asset","doc"]).describe('The type of file: "asset" for uploaded files (requires assetId), "doc" for monday docs (requires objectId), "link" for generic links, "google_drive", "dropbox", "box", "onedrive" for cloud storage links (all link types require linkToFile)'),name:y.string().describe("File display name"),linkToFile:y.string().optional().describe("File link URL. Required for link, google_drive, dropbox, box, and onedrive file types"),assetId:y.number().optional().describe("The asset's ID. Required when fileType is 'asset'"),objectId:y.number().optional().describe("The doc's ID. Required when fileType is 'doc'")}),_S={boardId:y.string().describe("The board's unique identifier"),itemId:y.string().describe("The item's unique identifier"),columnId:y.string().describe("The file or doc column's unique identifier"),files:y.array(yS).describe("Array of file values to set on the column")};const wS=sw`
1766
1766
  query getUserContext {
1767
1767
  me {
1768
1768
  id
@@ -1790,7 +1790,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1790
1790
  }
1791
1791
  }
1792
1792
  }
1793
- `,TS=sw`
1793
+ `,xS=sw`
1794
1794
  query getFavoriteDetails(
1795
1795
  $boardIds: [ID!]
1796
1796
  $folderIds: [ID!]
@@ -1814,7 +1814,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1814
1814
  name
1815
1815
  }
1816
1816
  }
1817
- `,ES={[jg.Board]:"boardIds",[jg.Folder]:"folderIds",[jg.Workspace]:"workspaceIds",[jg.Dashboard]:"dashboardIds"},IS={[jg.Board]:"boards",[jg.Folder]:"folders",[jg.Workspace]:"workspaces",[jg.Dashboard]:"dashboards"};const SS=sw`
1817
+ `,TS={[jg.Board]:"boardIds",[jg.Folder]:"folderIds",[jg.Workspace]:"workspaceIds",[jg.Dashboard]:"dashboardIds"},ES={[jg.Board]:"boards",[jg.Folder]:"folders",[jg.Workspace]:"workspaces",[jg.Dashboard]:"dashboards"};const IS=sw`
1818
1818
  query GetNotetakerMeetings(
1819
1819
  $limit: Int
1820
1820
  $cursor: String
@@ -1867,13 +1867,13 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1867
1867
  }
1868
1868
  }
1869
1869
  }
1870
- `,NS={ids:y.array(y.string()).optional().describe("Filter by specific meeting IDs. Use this to fetch one or more specific meetings in a single call."),access:y.enum(["OWN","SHARED_WITH_ME","SHARED_WITH_ACCOUNT","ALL"]).optional().default("OWN").describe("Filter meetings by access level. OWN: meetings the user participated in or invited the bot to. SHARED_WITH_ME: meetings shared with the user or their team. SHARED_WITH_ACCOUNT: meetings shared with the entire account. ALL: all meetings the user has access to."),limit:y.number().min(1).max(100).optional().default(25).describe("Maximum number of notetaker meetings to return per page (1-100)."),cursor:y.string().optional().describe("Cursor for pagination. Use cursor from the previous page_info to fetch the next page."),search:y.string().optional().describe("Search notetaker meetings by title, participant name, or email."),include_summary:y.boolean().optional().default(!1).describe("Whether to include the AI-generated summary for each meeting."),include_topics:y.boolean().optional().default(!1).describe("Whether to include discussion topics and talking points for each meeting."),include_action_items:y.boolean().optional().default(!1).describe("Whether to include action items for each meeting."),include_transcript:y.boolean().optional().default(!1).describe("Whether to include the full transcript for each meeting. Transcripts can be very large.")};const AS=sw`
1870
+ `,SS={ids:y.array(y.string()).optional().describe("Filter by specific meeting IDs. Use this to fetch one or more specific meetings in a single call."),access:y.enum(["OWN","SHARED_WITH_ME","SHARED_WITH_ACCOUNT","ALL"]).optional().default("OWN").describe("Filter meetings by access level. OWN: meetings the user participated in or invited the bot to. SHARED_WITH_ME: meetings shared with the user or their team. SHARED_WITH_ACCOUNT: meetings shared with the entire account. ALL: all meetings the user has access to."),limit:y.number().min(1).max(100).optional().default(25).describe("Maximum number of notetaker meetings to return per page (1-100)."),cursor:y.string().optional().describe("Cursor for pagination. Use cursor from the previous page_info to fetch the next page."),search:y.string().optional().describe("Search notetaker meetings by title, participant name, or email."),include_summary:y.boolean().optional().default(!1).describe("Whether to include the AI-generated summary for each meeting."),include_topics:y.boolean().optional().default(!1).describe("Whether to include discussion topics and talking points for each meeting."),include_action_items:y.boolean().optional().default(!1).describe("Whether to include action items for each meeting."),include_transcript:y.boolean().optional().default(!1).describe("Whether to include the full transcript for each meeting. Transcripts can be very large.")};const NS=sw`
1871
1871
  mutation BatchUndo($boardId: ID!, $undoRecordId: ID!) {
1872
1872
  batch_undo(board_id: $boardId, undo_record_id: $undoRecordId) {
1873
1873
  success
1874
1874
  }
1875
1875
  }
1876
- `,DS={boardId:y.number().describe("The id of the board where the action was performed"),undoRecordId:y.string().describe("The undo record ID (action_record_uuid) from the activity log data field. Use get_board_activity with includeData=true to find this value.")};y.enum(["enable","disable","status","list","detailed","reset"]).describe('Action to perform: "list" or "detailed" to discover available tools, "status" to check current states, "enable" to activate needed tools, "disable" to deactivate tools, "reset" to restore defaults'),y.string().optional().describe("Name of the tool to manage (required for enable/disable/status/reset)");const kS=sw`
1876
+ `,AS={boardId:y.number().describe("The id of the board where the action was performed"),undoRecordId:y.string().describe("The undo record ID (action_record_uuid) from the activity log data field. Use get_board_activity with includeData=true to find this value.")};y.enum(["enable","disable","status","list","detailed","reset"]).describe('Action to perform: "list" or "detailed" to discover available tools, "status" to check current states, "enable" to activate needed tools, "disable" to deactivate tools, "reset" to restore defaults'),y.string().optional().describe("Name of the tool to manage (required for enable/disable/status/reset)");const DS=sw`
1877
1877
  query getSprintsByIds($ids: [ID!]) {
1878
1878
  items(ids: $ids) {
1879
1879
  id
@@ -1908,7 +1908,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1908
1908
  }
1909
1909
  }
1910
1910
  }
1911
- `,OS={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"},RS={...OS,SPRINT_SUMMARY:"sprint_summary",SPRINT_CAPACITY:"sprint_capacity"},CS="BOARD_NOT_FOUND:",$S="SPRINT_NOT_FOUND:",LS="DOCUMENT_NOT_FOUND:",FS="DOCUMENT_INVALID:",PS="DOCUMENT_EMPTY:",jS="EXPORT_FAILED:",US="INTERNAL_ERROR:",VS="VALIDATION_ERROR:",BS="task_sprint",MS={[RS.SPRINT_TASKS]:"Sprint Tasks",[RS.SPRINT_TIMELINE]:"Sprint Timeline",[RS.SPRINT_COMPLETION]:"Sprint Completion",[RS.SPRINT_START_DATE]:"Sprint Start Date",[RS.SPRINT_END_DATE]:"Sprint End Date",[RS.SPRINT_ACTIVATION]:"Sprint Activation",[RS.SPRINT_SUMMARY]:"Sprint Summary",[RS.SPRINT_CAPACITY]:"Sprint Capacity"},qS=hy,HS={TASK_SPRINT:"task_sprint",TASK_STATUS:"task_status"},GS=(e,t)=>e.column_values?.find((e=>e.id===t)),zS=(e,t)=>{const a=GS(e,t);return"CheckboxValue"===a?.__typename?a.checked??!1:null},WS=(e,t)=>{const a=GS(e,t);return"DateValue"===a?.__typename?a.date??null:null},YS=(e,t)=>{const a=GS(e,t);return"DocValue"===a?.__typename&&a.file?.doc?.object_id?a.file.doc.object_id:null},KS=(e,t)=>{const a=t.filter((t=>!e.has(t)));return{isValid:0===a.length,missingColumns:a}},QS=(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)))},JS=e=>QS(e,Object.values(OS)),XS=e=>QS(e,Object.values(HS)),ZS=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},eN=(e,t)=>e.columns&&e.columns.filter((e=>null!==e)).find((e=>e.id===t&&e.type===aT.BoardRelation))||null,tN={sprintId:y.number().describe('The ID of the sprint to get the summary for (e.g., "9123456789")')};const aN=sw`
1911
+ `,kS={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"},OS={...kS,SPRINT_SUMMARY:"sprint_summary",SPRINT_CAPACITY:"sprint_capacity"},RS="BOARD_NOT_FOUND:",CS="SPRINT_NOT_FOUND:",$S="DOCUMENT_NOT_FOUND:",LS="DOCUMENT_INVALID:",FS="DOCUMENT_EMPTY:",PS="EXPORT_FAILED:",jS="INTERNAL_ERROR:",US="VALIDATION_ERROR:",VS="task_sprint",BS={[OS.SPRINT_TASKS]:"Sprint Tasks",[OS.SPRINT_TIMELINE]:"Sprint Timeline",[OS.SPRINT_COMPLETION]:"Sprint Completion",[OS.SPRINT_START_DATE]:"Sprint Start Date",[OS.SPRINT_END_DATE]:"Sprint End Date",[OS.SPRINT_ACTIVATION]:"Sprint Activation",[OS.SPRINT_SUMMARY]:"Sprint Summary",[OS.SPRINT_CAPACITY]:"Sprint Capacity"},MS=hy,qS={TASK_SPRINT:"task_sprint",TASK_STATUS:"task_status"},HS=(e,t)=>e.column_values?.find((e=>e.id===t)),GS=(e,t)=>{const a=HS(e,t);return"CheckboxValue"===a?.__typename?a.checked??!1:null},zS=(e,t)=>{const a=HS(e,t);return"DateValue"===a?.__typename?a.date??null:null},WS=(e,t)=>{const a=HS(e,t);return"DocValue"===a?.__typename&&a.file?.doc?.object_id?a.file.doc.object_id:null},YS=(e,t)=>{const a=t.filter((t=>!e.has(t)));return{isValid:0===a.length,missingColumns:a}},KS=(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)))},QS=e=>KS(e,Object.values(kS)),JS=e=>KS(e,Object.values(qS)),XS=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},ZS=(e,t)=>e.columns&&e.columns.filter((e=>null!==e)).find((e=>e.id===t&&e.type===aT.BoardRelation))||null,eN={sprintId:y.number().describe('The ID of the sprint to get the summary for (e.g., "9123456789")')};const tN=sw`
1912
1912
  query GetSprintsBoardItemsWithColumns($boardId: ID!, $limit: Int) {
1913
1913
  boards(ids: [$boardId]) {
1914
1914
  items_page(limit: $limit) {
@@ -1944,7 +1944,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1944
1944
  }
1945
1945
  }
1946
1946
  }
1947
- `,iN={sprintsBoardId:y.number().describe("The ID of the monday-dev board containing the sprints"),limit:y.number().min(1).max(100).optional().default(25).describe("The number of sprints to retrieve (default: 25, max: 100)")};const nN=sw`
1947
+ `,aN={sprintsBoardId:y.number().describe("The ID of the monday-dev board containing the sprints"),limit:y.number().min(1).max(100).optional().default(25).describe("The number of sprints to retrieve (default: 25, max: 100)")};const iN=sw`
1948
1948
  query GetRecentBoards($limit: Int) {
1949
1949
  boards(limit: $limit, order_by: used_at, state: active) {
1950
1950
  id
@@ -1960,7 +1960,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
1960
1960
  }
1961
1961
  }
1962
1962
  }
1963
- `,oN={};const rN=[class extends wu{constructor(){super(...arguments),this.name="get_monday_dev_sprints_boards",this.type=x.READ,this.annotations=_u({title:"monday-dev: Get Sprints Boards",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Discover monday-dev sprints boards and their associated tasks boards in your account.\n\n## Purpose:\nIdentifies and returns monday-dev sprints board IDs and tasks board IDs that you need to use with other monday-dev tools. \nThis tool scans your recently used boards (up to 100) to find valid monday-dev sprint management boards.\n\n## What it Returns:\n- Pairs of sprints boards and their corresponding tasks boards\n- Board IDs, names, and workspace information for each pair\n- The bidirectional relationship between each sprints board and its tasks board\n\n## Note:\nSearches recently used boards (up to 100). If none found, ask user to provide board IDs manually."}getInputSchema(){return oN}async executeInternal(e){try{const e={limit:100},t=((await this.mondayApi.request(nN,e)).boards||[]).filter((e=>null!==e));if(0===t.length)return{content:`${CS} No boards found in your account. Please verify you have access to monday.com boards.`};const a=this.extractBoardPairs(t);if(0===a.length)return{content:this.generateNotFoundMessage(t.length)};return{content:this.generateReport(a)}}catch(e){return{content:`${US} Error retrieving sprints boards: ${e instanceof Error?e.message:"Unknown error"}`}}}generateMultiplePairsWarning(e){return`## ⚠️ Multiple SprintsBoard Detected\n**${e}** different board pairs found. Each pair is isolated and workspace-specific.\n**AI Agent - REQUIRED:** Before ANY operation, confirm with user which pair and workspace to use.\n---\n`}generatePairDetails(e,t){return`### Pair ${t+1}\n**Sprints Board:**\n- ID: \`${e.sprintsBoard.id}\`\n- Name: ${e.sprintsBoard.name}\n- Workspace: ${e.sprintsBoard.workspaceName} (ID: ${e.sprintsBoard.workspaceId})\n\n**Tasks Board:**\n- ID: \`${e.tasksBoard.id}\`\n- Name: ${e.tasksBoard.name}\n- Workspace: ${e.tasksBoard.workspaceName} (ID: ${e.tasksBoard.workspaceId})\n---\n\n`}generateTechnicalReference(){return"## 📋 Technical Reference\n\n**Sprint Operations** (all require correct board pair):\n• Add to Sprint: Update `task_sprint` column with sprint item ID\n• Remove from Sprint: Clear `task_sprint` column (set to null)\n• Search in Sprint: Filter where `task_sprint` equals sprint item ID\n• Move Between Sprints: Update `task_sprint` with new sprint item ID\n• Backlog Tasks: `task_sprint` is empty/null\n\n**Critical:** `task_sprint` column references ONLY its paired sprints board. Cross-pair operations WILL FAIL."}generateReport(e){const t=e.length>1?this.generateMultiplePairsWarning(e.length):"",a=e.map(((e,t)=>this.generatePairDetails(e,t))).join(""),i=this.generateTechnicalReference();return`# Monday-Dev Sprints Boards Discovery\n\n${t}## Boards\n\nFound **${e.length}** matched pair(s):\n\n${a}${i}`}generateNotFoundMessage(e){return`## No Monday-Dev Sprints Board Pairs Found\n\n**Boards Checked:** ${e} (recently used)\n\nNo board pairs with sprint relationships found in your recent boards.\n\n### Possible Reasons:\n1. Boards exist but not accessed recently by your account\n2. Missing access permissions to sprint/task boards\n3. Monday-dev product was not set up in account\n\n### Next Steps:\n1. Ask user to access monday-dev boards in UI to refresh recent boards list\n2. Ask user to verify permissions to view sprint and task boards\n3. Ask user to provide board IDs manually if known`}createBoardInfo(e,t,a){return{id:e,name:t?.name||a,workspaceId:t?.workspace?.id||"unknown",workspaceName:t?.workspace?.name||"Unknown"}}processSprintsBoard(e,t,a){const i=eN(e,OS.SPRINT_TASKS);if(!i)return;const n=ZS(i);if(!n)return;const o=`${e.id}:${n}`;if(a.has(o))return;const r=t.get(n);a.set(o,{sprintsBoard:this.createBoardInfo(e.id,e,`Sprints Board ${e.id}`),tasksBoard:this.createBoardInfo(n,r,`Tasks Board ${n}`)})}processTasksBoard(e,t,a){const i=eN(e,BS);if(!i)return;const n=ZS(i);if(!n)return;const o=`${n}:${e.id}`;if(a.has(o))return;const r=t.get(n);a.set(o,{sprintsBoard:this.createBoardInfo(n,r,`Sprints Board ${n}`),tasksBoard:this.createBoardInfo(e.id,e,`Tasks Board ${e.id}`)})}extractBoardPairs(e){const t=new Map,a=new Map(e.map((e=>[e.id,e])));for(const i of e)i.columns&&(JS(i)&&this.processSprintsBoard(i,a,t),XS(i)&&this.processTasksBoard(i,a,t));return Array.from(t.values())}},class extends wu{constructor(){super(...arguments),this.name="get_sprints_metadata",this.type=x.READ,this.annotations=_u({title:"monday-dev: Get Sprints Metadata",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get comprehensive sprint metadata from a monday-dev sprints board including:\n\n## Data Retrieved:\nA table of sprints with the following information:\n- Sprint ID\n- Sprint Name\n- Sprint timeline (planned from/to dates)\n- Sprint completion status (completed/in-progress/planned)\n- Sprint start date (actual)\n- Sprint end date (actual)\n- Sprint activation status\n- Sprint summary document object ID\n\n## Parameters:\n- **limit**: Number of sprints to retrieve (default: 25, max: 100)\n\nRequires the Main Sprints board ID of the monday-dev containing your sprints."}getInputSchema(){return iN}async executeInternal(e){try{const t=await this.validateBoardSchema(e.sprintsBoardId.toString());if(!t.success)return{content:t.error||"Board schema validation failed"};const a={boardId:e.sprintsBoardId.toString(),limit:e.limit},i=await this.mondayApi.request(aN,a),n=i.boards?.[0],o=n?.items_page?.items||[];return{content:this.generateSprintsMetadataReport(o)}}catch(e){return{content:`${US} Error retrieving sprints metadata: ${e instanceof Error?e.message:"Unknown error"}`}}}async validateBoardSchema(e){try{const t={boardId:e.toString()},a=await this.mondayApi.request(fw,t),i=a.boards?.[0];if(!i)return{success:!1,error:`${CS} Board with ID ${e} not found. Please verify the board ID is correct and you have access to it.`};const n=i.columns||[],o=this.validateSprintsBoardSchemaFromColumns(n);return o.isValid?{success:!0}:{success:!1,error:`${VS} ${o.errorMessage}`}}catch(e){return{success:!1,error:`${US} Error validating board schema: ${e instanceof Error?e.message:"Unknown error"}`}}}validateSprintsBoardSchemaFromColumns(e){const t=new Set(e.filter((e=>null!==e)).map((e=>e.id))),a=Object.values(OS),i=KS(t,a);if(!i.isValid){let e="BoardID provided is not a valid sprints board. Missing required columns:\n\n";return i.missingColumns.forEach((t=>{const a=(e=>MS[e]||e)(t);e+=`- ${a}\n`})),{isValid:!1,errorMessage:e}}return{isValid:!0,errorMessage:""}}generateSprintsMetadataReport(e){let t="# Sprints Metadata Report\n\n";return t+=`**Total Sprints:** ${e.length}\n\n`,t+="| Sprint Name | Sprint ID | Status | Timeline (Planned) | Start Date (Actual) | End Date (Actual) | Completion | Summary Document ObjectID |\n",t+="|-------------|-----------|--------|--------------------|---------------------|-------------------|------------|---------------------------|\n",e.forEach((e=>{const a=e.name||"Unknown",i=e.id,n=zS(e,RS.SPRINT_ACTIVATION),o=zS(e,RS.SPRINT_COMPLETION),r=WS(e,RS.SPRINT_START_DATE),s=WS(e,RS.SPRINT_END_DATE),p=((e,t)=>{const a=GS(e,t);if("TimelineValue"===a?.__typename&&a.from&&a.to)return{from:a.from.split("T")[0],to:a.to.split("T")[0]};return null})(e,RS.SPRINT_TIMELINE),d=YS(e,RS.SPRINT_SUMMARY);let c=qS.Planned;o?c=qS.Completed:(n||r)&&(c=qS.Active);const l=p?`${p.from} to ${p.to}`:"Not set";t+=`| ${a} | ${i} | ${c} | ${l} | ${r||"Not started"} | ${s||"Not ended"} | ${o?"Yes":"No"} | ${d||"No document"} |\n`})),t+="\n## Status Definitions:\n",t+=`- **${qS.Planned}**: Sprint not yet started (no activation, no start date)\n`,t+=`- **${qS.Active}**: Sprint is active (activated but not completed)\n`,t+=`- **${qS.Completed}**: Sprint is finished\n\n`,t}},class extends wu{constructor(){super(...arguments),this.name="get_sprint_summary",this.type=x.READ,this.annotations=_u({title:"monday-dev: Get Sprint Summary",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Get the complete summary and analysis of a sprint.\n\n## Purpose:\nUnlock deep insights into completed sprint performance. \n\nThe sprint summary content including:\n- **Scope Management**: Analysis of planned vs. unplanned tasks, scope creep\n- **Velocity & Performance**: Individual velocity, task completion rates, workload distribution per team member\n- **Task Distribution**: Breakdown of completed tasks by type (Feature, Bug, Tech Debt, Infrastructure, etc.)\n- **AI Recommendations**: Action items, process improvements, retrospective focus areas\n\n## Requirements:\n- Sprint must be completed and must be created after 1/1/2025 \n\n## Important Note:\nWhen viewing the section "Completed by Assignee", you\'ll see user IDs in the format "@user-12345678". the 8 digits after the @is the user ID. To retrieve the actual owner names, use the list_users_and_teams tool with the user ID and set includeTeams=false for optimal performance.\n\n'}getInputSchema(){return tN}async executeInternal(e){try{const t=await this.getSprintMetadata(e.sprintId);if(!t.success)return{content:t.error||`${US} Unknown error occurred while getting sprint metadata`};const a=await this.readSprintSummaryDocument(t.documentObjectId);return a.success?{content:a.content}:{content:a.error||`${US} Unknown error occurred while reading document content`}}catch(e){return{content:`${US} Error retrieving sprint summary: ${e instanceof Error?e.message:"Unknown error"}`}}}async getSprintMetadata(e){try{const t={ids:[String(e)]},a=(await this.mondayApi.request(kS,t)).items||[];if(0===a.length)return{success:!1,error:`${$S} Sprint with ID ${e} not found. Please verify the sprint ID is correct.`};const i=a[0];if(!i)return{success:!1,error:`${$S} Sprint with ID ${e} not found.`};const n=((e,t=[])=>{const a=new Set((e.column_values||[]).map((e=>e.id))),i=[...Object.values(OS),...t];return KS(a,i)})(i,[RS.SPRINT_SUMMARY]);if(!n.isValid)return{success:!1,error:`${VS} Sprint item is missing required columns: ${n.missingColumns.join(", ")}. This may not be a valid sprint board item.`};const o=YS(i,RS.SPRINT_SUMMARY);return o?{success:!0,documentObjectId:o,sprintName:i.name}:{success:!1,error:`${LS} No sprint summary document found for sprint "${i.name}" (ID: ${e}). Sprint summary is only available for completed sprints that have analysis documents.`}}catch(e){return{success:!1,error:`${US} Error getting sprint item: ${e instanceof Error?e.message:"Unknown error"}`}}}async readSprintSummaryDocument(e){try{const t={object_ids:[e],limit:1},a=(await this.mondayApi.request(pw,t)).docs||[];if(0===a.length)return{success:!1,error:`${LS} Document with object ID ${e} not found or not accessible.`};const i=a[0];if(!i||!i.id)return{success:!1,error:`${FS} Document data is invalid for object ID ${e}.`};const n={docId:i.id,blockIds:[]},o=await this.mondayApi.request(Iw,n);if(!o.export_markdown_from_doc?.success)return{success:!1,error:`${jS} Failed to export markdown from document: ${o.export_markdown_from_doc?.error||"Unknown error"}`};const r=o.export_markdown_from_doc.markdown;return r?{success:!0,content:r}:{success:!1,error:`${PS} Document content is empty or could not be retrieved.`}}catch(e){return{success:!1,error:`${US} Error reading document: ${e instanceof Error?e.message:"Unknown error"}`}}}}],sN=[class extends wu{constructor(){super(...arguments),this.name="delete_item",this.type=x.WRITE,this.annotations=_u({title:"Delete Item",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an item"}getInputSchema(){return CT}async executeInternal(e){const t={id:e.itemId.toString()},a=await this.mondayApi.request(mw,t);return{content:`Item ${a.delete_item?.id} successfully deleted`}}},class extends wu{constructor(){super(...arguments),this.name="get_board_items_page",this.type=x.READ,this.annotations=_u({title:"Get Board Items Page",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get all items from a monday.com board with pagination support and optional column values and item descriptions. Returns structured JSON with item details, creation/update timestamps, and pagination info. Use the 'nextCursor' parameter from the response to get the next page of results when 'has_more' is true. To retrieve an item's description (the rich-text body/details of a monday.com item), set 'includeItemDescription' to true — the response will include the item description's document blocks with their content, type, and id. Use this whenever the user asks about an item's description, body, details, or notes. [REQUIRED PRECONDITION]: Before using this tool, if new columns were added to the board or if you are not familiar with the board's structure (column IDs, column types, status labels, etc.), first use get_board_info to understand the board metadata. This is essential for constructing proper filters and knowing which columns are available. VIEW-BASED FILTERING: If the user refers to a board view by name (e.g. \"show me items in the 'Overdue' view\"), first call get_board_info to get the board's views, find the matching view by name, then extract its filter field and pass it as the filters argument here."}getInputSchema(){return eE}async executeInternal(e){const t=!e.cursor;if(t&&e.searchTerm)try{if(e.itemIds=await this.getItemIdsFromSmartSearchAsync(e),0===e.itemIds.length)return{content:"No items found matching the specified searchTerm"}}catch(t){gT(t),e.filters=this.rebuildFiltersWithManualSearch(e.searchTerm,e.filters)}const a={boardId:e.boardId.toString(),limit:e.limit,cursor:e.cursor||void 0,includeColumns:e.includeColumns,columnIds:e.columnIds,includeSubItems:e.includeSubItems,includeDescription:e.includeItemDescription};t&&(e.itemIds||e.filters||e.orderBy)&&(a.queryParams={ids:e.itemIds?.map((e=>e.toString())),operator:e.filtersOperator,rules:e.filters?.map((e=>({column_id:e.columnId.toString(),compare_value:e.compareValue,operator:e.operator,compare_attribute:e.compareAttribute}))),order_by:e.orderBy?.map((e=>({column_id:e.columnId,direction:e.direction})))});const i=await this.mondayApi.request(QT,a);return{content:this.mapResult(i,e)}}rebuildFiltersWithManualSearch(e,t){return(t=(t=t??[]).filter((e=>"name"!==e.columnId))).push({columnId:"name",operator:qg.ContainsText,compareValue:e}),t}mapResult(e,t){const a=e.boards?.[0],i=a?.items_page,n=i?.items||[];return{board:{id:a?.id,name:a?.name},items:n.map((e=>this.mapItem(e,t))),pagination:{has_more:!!i?.cursor,nextCursor:i?.cursor||null,count:n.length}}}mapItem(e,t){const a={id:e.id,name:e.name,url:e.url,created_at:e.created_at,updated_at:e.updated_at};if(t.includeColumns&&e.column_values){a.column_values={};for(const t of e.column_values)a.column_values[t.id]=this.getColumnValueData(t)}if(t.includeItemDescription&&"description"in e&&e.description){const t=(e.description.blocks??[]).filter((e=>!!e)).map((e=>({id:e.id,type:e.type,content:e.content})));a.item_description={id:e.description.id,blocks:t}}return t.includeSubItems&&"subitems"in e&&e.subitems&&(a.subitems=e.subitems.slice(0,t.subItemLimit).map((e=>this.mapItem(e,t)))),a}getColumnValueData(e){switch(e.type){case aT.BoardRelation:return e.linked_items;case aT.Formula:return e.display_value;case aT.Mirror:return"Column value type is not supported"}if(e.text)return e.text;try{return JSON.parse(e.value)}catch{return e.value||null}}async getItemIdsFromSmartSearchAsync(e){const t={query:e.searchTerm,limit:100,filters:{entities:[{items:{board_ids:[e.boardId.toString()]}}]}},a=await this.mondayApi.request(JT,t,{versionOverride:"dev",timeout:vT}),i=a.search?.filter((e=>"ItemSearchResult"===e.__typename))?.map((e=>Number(e.data.id)))??[];if(0===i.length)throw new Error("No items found for search term or new search is not enabled for this account");const n=e.itemIds??[];if(0===n.length)return i;const o=new Set(n);return i.filter((e=>o.has(e)))}},class extends wu{constructor(){super(...arguments),this.name="create_item",this.type=x.WRITE,this.annotations=_u({title:"Create Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new item with provided values, create a subitem under a parent item, or duplicate an existing item and update it with new values. Use parentItemId when creating a subitem under an existing item. Use duplicateFromItemId when copying an existing item with modifications.[REQUIRED PRECONDITION]: Before using this tool, if new columns were added to the board or if you are not familiar with the board's structure (column IDs, column types, status labels, etc.), first use get_board_info to understand the board metadata. This is essential for constructing proper column values and knowing which columns are available."}getInputSchema(){return this.context?.boardId?yT:_T}async executeInternal(e){const t=this.context?.boardId??e.boardId;if(e.duplicateFromItemId&&e.parentItemId)throw new Error("Cannot specify both parentItemId and duplicateFromItemId. Please provide only one of these parameters.");return e.duplicateFromItemId?await this.duplicateAndUpdateItem(e,t):e.parentItemId?await this.createSubitem(e):await this.createNewItem(e,t)}async duplicateAndUpdateItem(e,t){try{const a={boardId:t.toString(),itemId:e.duplicateFromItemId.toString()},i=await this.mondayApi.request(lT,a);if(!i.duplicate_item?.id)throw new Error("Failed to duplicate item: no item duplicated");let n;try{n=JSON.parse(e.columnValues)}catch(e){throw new Error("Invalid JSON in columnValues")}const o={...n,name:e.name},r=new Ow(this.mondayApi,this.apiToken,{boardId:t});return await r.execute({itemId:parseInt(i.duplicate_item.id),columnValues:JSON.stringify(o)}),{content:{message:`Item ${i.duplicate_item.id} duplicated from ${e.duplicateFromItemId}`,item_id:i.duplicate_item.id,item_name:i.duplicate_item.name,item_url:i.duplicate_item.url,board_id:t}}}catch(e){bT(e,"duplicate item")}}async createSubitem(e){const t={parentItemId:e.parentItemId.toString(),itemName:e.name,columnValues:e.columnValues};try{const a=await this.mondayApi.request(mT,t);if(!a.create_subitem?.id)throw new Error("Failed to create subitem: no subitem created");return{content:{message:`Subitem ${a.create_subitem.id} created under ${e.parentItemId}`,item_id:a.create_subitem.id,item_name:a.create_subitem.name,item_url:a.create_subitem.url}}}catch(e){bT(e,"create subitem")}}async createNewItem(e,t){try{const a={boardId:t.toString(),itemName:e.name,groupId:e.groupId,columnValues:e.columnValues},i=await this.mondayApi.request(uw,a);return{content:{message:`Item ${i.create_item?.id} successfully created`,item_id:i.create_item?.id,item_name:i.create_item?.name,item_url:i.create_item?.url,board_id:t}}}catch(e){bT(e,"create item")}}},class extends wu{constructor(){super(...arguments),this.name="create_update",this.type=x.WRITE,this.annotations=_u({title:"Create Update",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new update (comment/post) on a monday.com item. Updates can be used to add comments, notes, or discussions to items. You can optionally mention users, teams, or boards in the update. You can also reply to an existing update by using the parentId parameter."}getInputSchema(){return IT}async executeInternal(e){let t;if(e.mentionsList)try{const a=JSON.parse(e.mentionsList),i=ET.safeParse(a);if(!i.success)throw new Error(`Invalid mentionsList format: ${i.error.message}`);t=i.data}catch(e){throw new Error(`Invalid mentionsList JSON format: ${e.message}`)}try{const a={itemId:e.itemId.toString(),body:e.body,mentionsList:t,parentId:e.parentId?.toString()},i=await this.mondayApi.request(xT,a);if(!i.create_update?.id)throw new Error("Failed to create update: no update created");return{content:{message:`Update ${i.create_update.id} created on item ${e.itemId}`,update_id:i.create_update.id,item_id:e.itemId,item_name:i.create_update.item?.name,item_url:i.create_update.item?.url}}}catch(e){bT(e,"create update")}}},class extends wu{constructor(){super(...arguments),this.name="get_updates",this.type=x.READ,this.annotations=_u({title:"Get Updates",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get updates (comments/posts) from a monday.com item or board. Specify objectId and objectType (Item or Board) to retrieve updates. For Board queries, you can filter by date range using fromDate and toDate (both required together, ISO8601 format). By default, Board queries return only board discussion; set includeItemUpdates to true to also include updates on individual items. Returns update text, creator info, timestamps, and optionally replies and assets."}getInputSchema(){return DT}async executeInternal(e){try{const t=void 0!==e.fromDate,a=void 0!==e.toDate;if(t!==a)throw new Error("Both fromDate and toDate must be provided together for date range filtering");if((t||a)&&e.objectType===AT.Item)throw new Error("Date range filtering (fromDate/toDate) is only supported for Board objectType");const i={limit:e.limit??25,page:e.page??1,includeReplies:e.includeReplies??!1,includeAssets:e.includeAssets??!1};let n;n=e.objectType===AT.Item?await this.mondayApi.request(ST,{...i,itemId:e.objectId}):await this.mondayApi.request(NT,{...i,boardId:e.objectId,boardUpdatesOnly:!e.includeItemUpdates,...e.fromDate&&e.toDate?{fromDate:kT(e.fromDate),toDate:kT(e.toDate)}:{}});const o=e.objectType===AT.Item?n.items?.[0]?.updates:n.boards?.[0]?.updates;if(!o||0===o.length)return{content:`No updates found for ${e.objectType.toLowerCase()} with id ${e.objectId}`};const r=o.map((t=>{const a={id:t.id,text_body:t.text_body,created_at:t.created_at,updated_at:t.updated_at,creator:t.creator?{id:t.creator.id,name:t.creator.name}:null,item_id:t.item_id};return e.includeReplies&&t.replies&&(a.replies=t.replies.map((e=>({id:e.id,text_body:e.text_body,created_at:e.created_at,updated_at:e.updated_at,creator:e.creator?{id:e.creator.id,name:e.creator.name}:null})))),e.includeAssets&&t.assets&&(a.assets=t.assets.filter((e=>!!e)).map((e=>({id:e.id,name:e.name,url:e.url,file_extension:e.file_extension,file_size:e.file_size,created_at:e.created_at})))),a})),s=e.objectType===AT.Item?n.items?.[0]?.url:n.boards?.[0]?.url;return{content:{message:"Updates retrieved",[`${e.objectType.toLowerCase()}_id`]:e.objectId,url:s,updates:r,pagination:{page:e.page??1,limit:e.limit??25,count:r.length}}}}catch(e){bT(e,"get updates")}}},class extends wu{constructor(){super(...arguments),this.name="create_update_in_monday",this.type=x.WRITE,this.annotations=_u({title:"Create Update in Monday, after calling this tool you should",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new update (comment/post) on a monday.com item. Updates can be used to add comments, notes, or discussions to items. You can optionally mention users, teams, or boards in the update. After calling this tool you should call the full board data tool to get data, and immediately after that call the show table tool to show the data from that tool. IMPORTANT: You MUST use the COMPLETE data from the full board data tool - do NOT cut, truncate, or omit any data. Pass the entire dataset to the show table tool."}getInputSchema(){return gS}async executeInternal(e){let t;if(e.mentionsList)try{const a=JSON.parse(e.mentionsList),i=bS.safeParse(a);if(!i.success)throw new Error(`Invalid mentionsList format: ${i.error.message}`);t=i.data}catch(e){throw new Error(`Invalid mentionsList JSON format: ${e.message}`)}try{const a={itemId:e.itemId.toString(),body:e.body,mentionsList:t},i=await this.mondayApi.request(xT,a);if(!i.create_update?.id)throw new Error("Failed to create update: no update created");return{content:`Update ${i.create_update.id} successfully created on item ${e.itemId}. Now we want to show the updated data, so call the full board data tool to get data, and then immediately after that call the show table tool to show the data from that tool. CRITICAL: You MUST pass the COMPLETE and FULL data from the full board data tool to the show table tool - do NOT cut, summarize, truncate, or omit ANY data. Use the entire dataset exactly as received.`}}catch(e){bT(e,"create update")}}},class extends wu{constructor(){super(...arguments),this.name="get_board_schema",this.type=x.READ,this.annotations=_u({title:"Get Board Schema",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get board schema (columns and groups) by board id"}getInputSchema(){if(!this.context?.boardId)return tE}async executeInternal(e){const t=this.context?.boardId??e.boardId,a={boardId:t.toString()},i=await this.mondayApi.request(fw,a);return{content:`The current schema of the board ${t} is: \n \n\nColumns:\n ${i.boards?.[0]?.columns?.map((e=>`Id - ${e?.id}\n Title - ${e?.title}\n Type - ${e?.type}`)).join("\n")}\n \n\nGroups:\n ${i.boards?.[0]?.groups?.map((e=>`Id - ${e?.id}\n Title - ${e?.title}`)).join("\n")}`}}},class extends wu{constructor(){super(...arguments),this.name="get_board_activity",this.type=x.READ,this.annotations=_u({title:"Get Board Activity",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0}),this.defaultLimit=1e3}getDescription(){return"Get board activity logs for a specified time range (defaults to last 30 days)"}getInputSchema(){return BT}async executeInternal(e){const t=new Date,a=new Date(t.getTime()-hT.MONTH30Days),i=e?.fromDate||a.toISOString(),n=e?.toDate||t.toISOString(),o={boardId:e.boardId.toString(),fromDate:i,toDate:n,limit:this.defaultLimit,page:1,includeData:e.includeData??!1},r=await this.mondayApi.request(VT,o),s=r.boards?.[0]?.activity_logs;if(!s||0===s.length)return{content:`No activity found for board ${e.boardId} in the specified time range (${i} to ${n}).`};const p=r.boards?.[0],d=e.includeData??!1;return{content:{message:"Board activity retrieved",board_id:e.boardId,board_name:p?.name,board_url:p?.url,data:s.filter((e=>null!=e)).map((e=>({created_at:e.created_at,event:e.event,entity:e.entity,user_id:e.user_id,...d&&e.data?{data:e.data}:{}})))}}}},class extends wu{constructor(){super(...arguments),this.name="get_board_info",this.type=x.READ,this.annotations=_u({title:"Get Board Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get comprehensive board information including metadata, structure, owners, and configuration. Also returns the board's views (e.g. table views, filter views) — each view includes its id, name, type, and a structured `filter` object. "}getInputSchema(){return KT}async executeInternal(e){const t={boardId:e.boardId.toString()},a=await this.mondayApi.request(MT,t),i=a.boards?.[0];if(!i)return{content:`Board with id ${e.boardId} not found or you don't have access to it.`};const n=await this.getSubItemsBoardAsync(i);return{content:HT(i,n)}}async getSubItemsBoardAsync(e){const t=e.columns?.find((e=>e?.type===aT.Subtasks));if(!t)return null;const a=t.settings.boardIds[0],i=await this.mondayApi.request(qT,{boardId:a});return i.boards?.[0]??null}},class extends wu{constructor(){super(...arguments),this.name="get_full_board_data",this.type=x.READ,this.annotations=_u({title:"Get Full Board Data",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"INTERNAL USE ONLY - DO NOT CALL THIS TOOL DIRECTLY. This tool is exclusively triggered by UI components and should never be invoked directly by the agent."}getInputSchema(){return UT}async executeInternal(e){try{const t={boardId:e.boardId,itemsLimit:7};e.filters&&(t.queryParams={operator:e.filtersOperator,rules:e.filters.map((e=>({column_id:e.columnId.toString(),compare_value:e.compareValue,operator:e.operator,compare_attribute:e.compareAttribute})))});const a=await this.mondayApi.request(LT,t);if(!a.boards||0===a.boards.length||!a.boards[0])throw new Error(`Board with ID ${e.boardId} not found`);const i=a.boards[0],n=new Set;i.items_page.items.forEach((e=>{e.updates?.forEach((e=>{e.creator_id&&n.add(e.creator_id),e.replies?.forEach((e=>{e.creator_id&&n.add(e.creator_id)}))})),e.column_values.forEach((e=>{if("persons_and_teams"in e){const t=e;t.persons_and_teams?.forEach((e=>{"person"===e.kind&&e.id&&n.add(e.id)}))}}))}));const o=Array.from(n).filter((e=>!(Number(e)<0)));let r=[];if(o.length>0){const e={userIds:o},t=await this.mondayApi.request(FT,e);r=t.users?.filter((e=>null!==e))||[]}const s=new Map(r.map((e=>[e.id,e])));return{content:{board:{id:i.id,name:i.name,columns:i.columns,items:i.items_page.items.map((e=>({id:e.id,name:e.name,column_values:e.column_values,updates:e.updates?.map((e=>({id:e.id,creator_id:e.creator_id||"",creator:e.creator_id&&s.get(e.creator_id)||null,text_body:e.text_body,created_at:e.created_at,replies:e.replies?.map((e=>({id:e.id,creator_id:e.creator_id||"",creator:e.creator_id&&s.get(e.creator_id)||null,text_body:e.text_body,created_at:e.created_at})))||[]})))||[]})))},users:r,stats:{total_items:i.items_page.items.length,total_updates:i.items_page.items.reduce(((e,t)=>e+(t.updates?.length||0)),0),total_unique_creators:r.length}}}}catch(e){bT(e,"get full board data")}}},class extends wu{constructor(){super(...arguments),this.name="list_users_and_teams",this.type=x.READ,this.annotations=_u({title:"List Users and Teams",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Tool to fetch users and/or teams data. \n\n MANDATORY BEST PRACTICES:\n 1. ALWAYS use specific IDs or names when available\n 2. If no ids available, use name search if possible (USERS ONLY)\n 3. Use 'getMe: true' to get current user information\n 4. AVOID broad queries (no parameters) - use only as last resort\n\n REQUIRED PARAMETER PRIORITY (use in this order):\n 1. getMe - STANDALONE\n 2. userIds\n 3. name - STANDALONE (USERS ONLY, NOT for teams)\n 4. teamIds + teamsOnly\n 5. No parameters - LAST RESORT\n\n CRITICAL USAGE RULES:\n • userIds + teamIds requires explicit includeTeams: true flag\n • includeTeams: true fetches both users and teams, do not use this to fetch a specific user's teams rather fetch that user by id and you will get their team memberships.\n • name parameter is for USER search ONLY - it cannot be used to search for teams. Use teamIds to fetch specific teams."}getInputSchema(){return RE}async executeInternal(e){const t=e.userIds&&e.userIds.length>0,a=e.teamIds&&e.teamIds.length>0,i=e.includeTeams||!1,n=e.teamsOnly||!1,o=e.includeTeamMembers||!1,r=!!e.name;if(e.getMe||!1){if(t||a||i||n||o||r)return{content:"PARAMETER_CONFLICT: getMe is STANDALONE only. Remove all other parameters when using getMe: true for current user lookup."};const e=await this.mondayApi.request(xE);if(!e.me)return{content:"AUTHENTICATION_ERROR: Current user fetch failed. Verify API token and user permissions."};const s={users:[e.me]},p=IE(s),d=await kE(this.mondayApi);return{content:{data:p,action_name:"Users and teams",url:d?`https://${d}.monday.com/teams/all`:void 0}}}if(r){if(t||a||i||n||o)return{content:"PARAMETER_CONFLICT: name is STANDALONE only. Remove userIds, teamIds, includeTeams, teamsOnly, and includeTeamMembers when using name search."};const r={name:e.name},s=await this.mondayApi.request(wE,r);if(!s.users||0===s.users.length)return{content:`NAME_SEARCH_EMPTY: No users found matching "${e.name}". Try broader search terms or verify user exists in account.`};const p=s.users.filter((e=>null!==e)).map((e=>`• **${e.name}** (ID: ${e.id})${e.title?` - ${e.title}`:""}`)).join("\n"),d=`Found ${s.users.length} user(s) matching "${e.name}":\n\n${p}`,c=await kE(this.mondayApi);return{content:{data:d,action_name:"Users and teams",url:c?`https://${c}.monday.com/teams/all`:void 0}}}if(n&&i)return{content:"PARAMETER_CONFLICT: Cannot use teamsOnly: true with includeTeams: true. Use teamsOnly for teams-only queries or includeTeams for combined data."};if(t&&e.userIds&&e.userIds.length>SE)return{content:`LIMIT_EXCEEDED: userIds array too large (${e.userIds.length}/500). Split into batches of max 500 IDs and make multiple calls.`};if(a&&e.teamIds&&e.teamIds.length>NE)return{content:`LIMIT_EXCEEDED: teamIds array too large (${e.teamIds.length}/500). Split into batches of max 500 IDs and make multiple calls.`};let s;if(n||!t&&a&&!i)if(o){const t={teamIds:e.teamIds};s=await this.mondayApi.request(_E,t)}else{const t={teamIds:e.teamIds};s=await this.mondayApi.request(yE,t)}else if(i){const t={userIds:e.userIds,teamIds:e.teamIds,limit:AE};s=await this.mondayApi.request(gE,t)}else if(t){const t={userIds:e.userIds,limit:AE};s=await this.mondayApi.request(vE,t)}else{const e={userIds:void 0,limit:AE};s=await this.mondayApi.request(bE,e)}const p=IE(s),d=await kE(this.mondayApi);return{content:{data:p,action_name:"Users and teams",url:d?`https://${d}.monday.com/teams/all`:void 0}}}},Ow,class extends wu{constructor(){super(...arguments),this.name="move_item_to_group",this.type=x.WRITE,this.annotations=_u({title:"Move Item to Group",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Move an item to a group in a monday.com board"}getInputSchema(){return CE}async executeInternal(e){const t={itemId:e.itemId.toString(),groupId:e.groupId},a=await this.mondayApi.request(vw,t);return{content:`Item ${a.move_item_to_group?.id} successfully moved to group ${e.groupId}`}}},class extends wu{constructor(){super(...arguments),this.name="create_board",this.type=x.WRITE,this.annotations=_u({title:"Create Board",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com board"}getInputSchema(){return Rw}async executeInternal(e){const t={boardName:e.boardName,boardKind:e.boardKind,boardDescription:e.boardDescription,workspaceId:e.workspaceId},a=await this.mondayApi.request(bw,t);return{content:{message:`Board ${a.create_board?.id} successfully created`,board_id:a.create_board?.id,board_name:a.create_board?.name,board_url:a.create_board?.url}}}},class extends wu{constructor(){super(...arguments),this.name="create_form",this.type=x.WRITE,this.annotations=_u({title:"Create Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com form. This will create a new form as well as a new board for which the form’s responses will be stored. The returned board_id is the ID of the board that was created while the returned formToken can be used for all future queries and mutations to continue editing the form."}getInputSchema(){return lx}async executeInternal(e){const t={destination_workspace_id:e.destination_workspace_id,destination_folder_id:e.destination_folder_id,destination_folder_name:e.destination_folder_name,board_kind:e.board_kind,destination_name:e.destination_name,board_owner_ids:e.board_owner_ids,board_owner_team_ids:e.board_owner_team_ids,board_subscriber_ids:e.board_subscriber_ids,board_subscriber_teams_ids:e.board_subscriber_teams_ids},a=await this.mondayApi.request(qw,t);return{content:{message:"Form created successfully",board_id:a.create_form?.boardId,form_token:a.create_form?.token}}}},class extends wu{constructor(){super(...arguments),this.name="update_form",this.type=x.WRITE,this.annotations=_u({title:"Update Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0}),this.helpers=new eT(this.mondayApi),this.actionHandlers=new Map([[Ox.setFormPassword,this.helpers.setFormPassword.bind(this.helpers)],[Ox.shortenFormUrl,this.helpers.shortenFormUrl.bind(this.helpers)],[Ox.deactivate,this.helpers.deactivateForm.bind(this.helpers)],[Ox.activate,this.helpers.activateForm.bind(this.helpers)],[Ox.createTag,this.helpers.createTag.bind(this.helpers)],[Ox.deleteTag,this.helpers.deleteTag.bind(this.helpers)],[Ox.updateTag,this.helpers.updateTag.bind(this.helpers)],[Ox.updateAppearance,this.helpers.updateAppearance.bind(this.helpers)],[Ox.updateAccessibility,this.helpers.updateAccessibility.bind(this.helpers)],[Ox.updateFeatures,this.helpers.updateFeatures.bind(this.helpers)],[Ox.updateQuestionOrder,this.helpers.updateQuestionOrder.bind(this.helpers)],[Ox.updateFormHeader,this.helpers.updateFormHeader.bind(this.helpers)]])}getDescription(){return'Update a monday.com form. Handles the following form update actions that can only be done one at a time using the correct "action" input: \n - update form\'s feature settings with the action "updateFeatures",\n - update form\'s appearance settings with the action "updateAppearance",\n - update form\'s accessibility settings with the action "updateAccessibility",\n - update form\'s title with the action "updateFormHeader",\n - update form\'s description with the action "updateFormHeader",\n - update form\'s question order with the action "updateQuestionOrder",\n - create a new form tag with the action "createTag",\n - delete a form tag with the action "deleteTag",\n - update a form tag with the action "updateTag",\n - set or update the form\'s password with the action "setFormPassword"\n - shorten form\'s url with the action "shortenFormUrl"\n - deactivate form with the action "deactivateForm"\n - reactivate form with the action "activateForm"'}getInputSchema(){return Zx}async executeInternal(e){const t=this.actionHandlers.get(e.action);return t?await t(e):{content:"Received an invalid action for the update form tool."}}},class extends wu{constructor(){super(...arguments),this.name="get_form",this.type=x.READ,this.annotations=_u({title:"Get Form",readOnlyHint:!0,destructiveHint:!1})}getDescription(){return"Get a monday.com form by its form token. Form tokens can be extracted from the form’s url. Given a form url, such as https://forms.monday.com/forms/abc123def456ghi789?r=use1, the token is the alphanumeric string that appears right after /forms/ and before the ?. In the example, the token is abc123def456ghi789."}getInputSchema(){return tT}async executeInternal(e){const t={formToken:e.formToken},a=await this.mondayApi.request(Hw,t);return a.form?{content:{message:"Form retrieved",form_token:e.formToken,data:a.form}}:{content:`Form with token ${e.formToken} not found or you don't have access to it.`}}},class extends wu{constructor(){super(...arguments),this.name="form_questions_editor",this.type=x.WRITE,this.annotations=_u({title:"Form Questions Editor",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1}),this.helpers=new kx(this.mondayApi),this.actionHandlers=new Map([[Nx.Delete,this.helpers.deleteQuestion.bind(this.helpers)],[Nx.Update,this.helpers.updateQuestion.bind(this.helpers)],[Nx.Create,this.helpers.createQuestion.bind(this.helpers)]])}getDescription(){return"Create, update, or delete a question in a monday.com form"}getInputSchema(){return Dx}async executeInternal(e){const t=this.actionHandlers.get(e.action);return t?await t(e):{content:`Unknown action: ${e.action}`}}},class extends wu{constructor(){super(...arguments),this.name="create_column",this.type=x.WRITE,this.annotations=_u({title:"Create Column",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new column in a monday.com board"}getInputSchema(){return this.context?.boardId?iT:nT}async executeInternal(e){const t=this.context?.boardId??e.boardId,a={boardId:t?.toString()??"",columnType:e.columnType,columnTitle:e.columnTitle,columnDescription:e.columnDescription,columnSettings:"string"==typeof e.columnSettings?JSON.parse(e.columnSettings):e.columnSettings},i=await this.mondayApi.request(gw,a);return{content:{message:"Column successfully created",column_id:i.create_column?.id,column_title:i.create_column?.title}}}},class extends wu{constructor(){super(...arguments),this.name="create_group",this.type=x.WRITE,this.annotations=_u({title:"Create Group",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new group in a monday.com board. Groups are sections that organize related items. Use when users want to add structure, categorize items, or create workflow phases. Groups can be positioned relative to existing groups and assigned predefined colors. Items will always be created in the top group and so the top group should be the most relevant one for new item creation"}getInputSchema(){return cT}async executeInternal(e){const t={boardId:e.boardId,groupName:e.groupName,groupColor:e.groupColor,relativeTo:e.relativeTo,positionRelativeMethod:e.positionRelativeMethod},a=await this.mondayApi.request(pT,t);return{content:{message:"Group created successfully",group_id:a.create_group?.id,group_title:a.create_group?.title,board_id:e.boardId,group_name:e.groupName}}}},class extends wu{constructor(){super(...arguments),this.name="delete_column",this.type=x.WRITE,this.annotations=_u({title:"Delete Column",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete a column from a monday.com board"}getInputSchema(){return this.context?.boardId?OT:RT}async executeInternal(e){const t={boardId:(this.context?.boardId??e.boardId).toString(),columnId:e.columnId},a=await this.mondayApi.request(yw,t);return{content:`Column ${a.delete_column?.id} successfully deleted`}}},Aw,class extends wu{constructor(){super(...arguments),this.name="get_graphql_schema",this.type=x.ALL_API,this.annotations=_u({title:"Get GraphQL Schema",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Fetch the monday.com GraphQL schema structure including query and mutation definitions. This tool returns available query fields, mutation fields, and a list of GraphQL types in the schema. You can filter results by operation type (read/write) to focus on either queries or mutations."}getInputSchema(){return oE}async executeInternal(e){try{const t=await this.mondayApi.request(_w),a=e?.operationType,i=t.queryType?.fields?.map((e=>`- ${e.name}${e.description?`: ${e.description}`:""}`)).join("\n")||"No query fields found",n=t.mutationType?.fields?.map((e=>`- ${e.name}${e.description?`: ${e.description}`:""}`)).join("\n")||"No mutation fields found",o=t.__schema,r=o?.types?.filter((e=>e.name&&!e.name.startsWith("__"))).map((e=>`- ${e.name} (${e.kind||"unknown"})`)).join("\n")||"No types found";let s="## GraphQL Schema\n";return a&&"read"!==a||(s+=`- Query Type: ${t.__schema?.queryType?.name}\n\n`,s+=`## Query Fields\n${i}\n\n`),a&&"write"!==a||(s+=`- Mutation Type: ${t.__schema?.mutationType?.name}\n\n`,s+=`## Mutation Fields\n${n}\n\n`),s+=`## Available Types\n${r}\n\n`,s+='To get detailed information about a specific type, use the get_type_details tool with the type name.\nFor example: get_type_details(typeName: "Board") to see Board type details.',{content:s}}catch(e){return{content:`Error fetching GraphQL schema: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends wu{constructor(){super(...arguments),this.name="get_column_type_info",this.type=x.READ,this.annotations=_u({title:"Get Column Type Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Retrieves comprehensive information about a specific column type, including JSON schema definition and other metadata. Use this before creating columns with the create_column tool to understand the structure, validation rules, and available properties for column settings."}getInputSchema(){return nE}async executeInternal(e){const t={type:e.columnType},a=await this.mondayApi.request(aE,t);if(!a?.get_column_type_schema)return{content:`Information for column type "${e.columnType}" not found or not available.`};const i={schema:a.get_column_type_schema};return{content:{message:`Column type info for ${e.columnType}`,data:i,url:iE}}}},class extends wu{constructor(){super(...arguments),this.name="get_type_details",this.type=x.ALL_API,this.annotations=_u({title:"Get Type Details",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get detailed information about a specific GraphQL type from the monday.com API schema"}getInputSchema(){return rE}async executeInternal(e){try{if(!e.typeName)return{content:"Error: typeName is required. Please provide a valid GraphQL type name."};const a=(t=e.typeName,sw`
1963
+ `,nN={};const oN=[class extends wu{constructor(){super(...arguments),this.name="get_monday_dev_sprints_boards",this.type=x.READ,this.annotations=_u({title:"monday-dev: Get Sprints Boards",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Discover monday-dev sprints boards and their associated tasks boards in your account.\n\n## Purpose:\nIdentifies and returns monday-dev sprints board IDs and tasks board IDs that you need to use with other monday-dev tools. \nThis tool scans your recently used boards (up to 100) to find valid monday-dev sprint management boards.\n\n## What it Returns:\n- Pairs of sprints boards and their corresponding tasks boards\n- Board IDs, names, and workspace information for each pair\n- The bidirectional relationship between each sprints board and its tasks board\n\n## Note:\nSearches recently used boards (up to 100). If none found, ask user to provide board IDs manually."}getInputSchema(){return nN}async executeInternal(e){try{const e={limit:100},t=((await this.mondayApi.request(iN,e)).boards||[]).filter((e=>null!==e));if(0===t.length)return{content:`${RS} No boards found in your account. Please verify you have access to monday.com boards.`};const a=this.extractBoardPairs(t);return 0===a.length?{content:{message:"No monday-dev sprints board pairs found. ### Possible Reasons:\n1. Boards exist but not accessed recently by your account\n2. Missing access permissions to sprint/task boards\n3. Monday-dev product was not set up in account\n### Next Steps:\n1. Ask user to access monday-dev boards in UI to refresh recent boards list\n2. Ask user to verify permissions to view sprint and task boards\n3. Ask user to provide board IDs manually if known`;",boards_checked:t.length,pairs:[]}}:{content:{message:`Found ${a.length} matched pair(s)`,...a.length>1?{warning:"Multiple board pairs detected. Confirm with user which pair and workspace to use before any operation."}:{},pairs:a.map((e=>({sprints_board:{id:e.sprintsBoard.id,name:e.sprintsBoard.name,workspace_id:e.sprintsBoard.workspaceId,workspace_name:e.sprintsBoard.workspaceName},tasks_board:{id:e.tasksBoard.id,name:e.tasksBoard.name,workspace_id:e.tasksBoard.workspaceId,workspace_name:e.tasksBoard.workspaceName}}))),technical_reference:"Sprint Operations (all require correct board pair): Add to Sprint: Update `task_sprint` column with sprint item ID. Remove from Sprint: Clear `task_sprint` column (set to null). Search in Sprint: Filter where `task_sprint` equals sprint item ID. Move Between Sprints: Update `task_sprint` with new sprint item ID. Backlog Tasks: `task_sprint` is empty/null. Critical: `task_sprint` column references ONLY its paired sprints board. Cross-pair operations WILL FAIL."}}}catch(e){return{content:`${jS} Error retrieving sprints boards: ${e instanceof Error?e.message:"Unknown error"}`}}}createBoardInfo(e,t,a){return{id:e,name:t?.name||a,workspaceId:t?.workspace?.id||"unknown",workspaceName:t?.workspace?.name||"Unknown"}}processSprintsBoard(e,t,a){const i=ZS(e,kS.SPRINT_TASKS);if(!i)return;const n=XS(i);if(!n)return;const o=`${e.id}:${n}`;if(a.has(o))return;const r=t.get(n);a.set(o,{sprintsBoard:this.createBoardInfo(e.id,e,`Sprints Board ${e.id}`),tasksBoard:this.createBoardInfo(n,r,`Tasks Board ${n}`)})}processTasksBoard(e,t,a){const i=ZS(e,VS);if(!i)return;const n=XS(i);if(!n)return;const o=`${n}:${e.id}`;if(a.has(o))return;const r=t.get(n);a.set(o,{sprintsBoard:this.createBoardInfo(n,r,`Sprints Board ${n}`),tasksBoard:this.createBoardInfo(e.id,e,`Tasks Board ${e.id}`)})}extractBoardPairs(e){const t=new Map,a=new Map(e.map((e=>[e.id,e])));for(const i of e)i.columns&&(QS(i)&&this.processSprintsBoard(i,a,t),JS(i)&&this.processTasksBoard(i,a,t));return Array.from(t.values())}},class extends wu{constructor(){super(...arguments),this.name="get_sprints_metadata",this.type=x.READ,this.annotations=_u({title:"monday-dev: Get Sprints Metadata",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get comprehensive sprint metadata from a monday-dev sprints board including:\n\n## Data Retrieved:\nA table of sprints with the following information:\n- Sprint ID\n- Sprint Name\n- Sprint timeline (planned from/to dates)\n- Sprint completion status (completed/in-progress/planned)\n- Sprint start date (actual)\n- Sprint end date (actual)\n- Sprint activation status\n- Sprint summary document object ID\n\n## Parameters:\n- **limit**: Number of sprints to retrieve (default: 25, max: 100)\n\nRequires the Main Sprints board ID of the monday-dev containing your sprints."}getInputSchema(){return aN}async executeInternal(e){try{const t=await this.validateBoardSchema(e.sprintsBoardId.toString());if(!t.success)return{content:t.error||"Board schema validation failed"};const a={boardId:e.sprintsBoardId.toString(),limit:e.limit},i=await this.mondayApi.request(tN,a),n=i.boards?.[0],o=n?.items_page?.items||[],r=this.buildSprintsMetadata(o);return{content:{message:"Sprints metadata retrieved",board_id:e.sprintsBoardId,total:o.length,data:r}}}catch(e){return{content:`${jS} Error retrieving sprints metadata: ${e instanceof Error?e.message:"Unknown error"}`}}}async validateBoardSchema(e){try{const t={boardId:e.toString()},a=await this.mondayApi.request(fw,t),i=a.boards?.[0];if(!i)return{success:!1,error:`${RS} Board with ID ${e} not found. Please verify the board ID is correct and you have access to it.`};const n=i.columns||[],o=this.validateSprintsBoardSchemaFromColumns(n);return o.isValid?{success:!0}:{success:!1,error:`${US} ${o.errorMessage}`}}catch(e){return{success:!1,error:`${jS} Error validating board schema: ${e instanceof Error?e.message:"Unknown error"}`}}}validateSprintsBoardSchemaFromColumns(e){const t=new Set(e.filter((e=>null!==e)).map((e=>e.id))),a=Object.values(kS),i=YS(t,a);if(!i.isValid){let e="BoardID provided is not a valid sprints board. Missing required columns:\n\n";return i.missingColumns.forEach((t=>{const a=(e=>BS[e]||e)(t);e+=`- ${a}\n`})),{isValid:!1,errorMessage:e}}return{isValid:!0,errorMessage:""}}buildSprintsMetadata(e){return e.map((e=>{const t=GS(e,OS.SPRINT_ACTIVATION),a=GS(e,OS.SPRINT_COMPLETION),i=zS(e,OS.SPRINT_START_DATE),n=zS(e,OS.SPRINT_END_DATE),o=((e,t)=>{const a=HS(e,t);if("TimelineValue"===a?.__typename&&a.from&&a.to)return{from:a.from.split("T")[0],to:a.to.split("T")[0]};return null})(e,OS.SPRINT_TIMELINE),r=WS(e,OS.SPRINT_SUMMARY);let s=MS.Planned;return a?s=MS.Completed:(t||i)&&(s=MS.Active),{id:e.id,name:e.name||"Unknown",status:s,timeline:o?{from:o.from,to:o.to}:null,start_date:i||null,end_date:n||null,is_completed:a,document_object_id:r||null}}))}},class extends wu{constructor(){super(...arguments),this.name="get_sprint_summary",this.type=x.READ,this.annotations=_u({title:"monday-dev: Get Sprint Summary",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return'Get the complete summary and analysis of a sprint.\n\n## Purpose:\nUnlock deep insights into completed sprint performance. \n\nThe sprint summary content including:\n- **Scope Management**: Analysis of planned vs. unplanned tasks, scope creep\n- **Velocity & Performance**: Individual velocity, task completion rates, workload distribution per team member\n- **Task Distribution**: Breakdown of completed tasks by type (Feature, Bug, Tech Debt, Infrastructure, etc.)\n- **AI Recommendations**: Action items, process improvements, retrospective focus areas\n\n## Requirements:\n- Sprint must be completed and must be created after 1/1/2025 \n\n## Important Note:\nWhen viewing the section "Completed by Assignee", you\'ll see user IDs in the format "@user-12345678". the 8 digits after the @is the user ID. To retrieve the actual owner names, use the list_users_and_teams tool with the user ID and set includeTeams=false for optimal performance.\n\n'}getInputSchema(){return eN}async executeInternal(e){try{const t=await this.getSprintMetadata(e.sprintId);if(!t.success)return{content:t.error||`${jS} Unknown error occurred while getting sprint metadata`};const a=await this.readSprintSummaryDocument(t.documentObjectId);return a.success?{content:{message:"Sprint summary retrieved",sprint_id:e.sprintId,sprint_name:t.sprintName,markdown:a.content}}:{content:a.error||`${jS} Unknown error occurred while reading document content`}}catch(e){return{content:`${jS} Error retrieving sprint summary: ${e instanceof Error?e.message:"Unknown error"}`}}}async getSprintMetadata(e){try{const t={ids:[String(e)]},a=(await this.mondayApi.request(DS,t)).items||[];if(0===a.length)return{success:!1,error:`${CS} Sprint with ID ${e} not found. Please verify the sprint ID is correct.`};const i=a[0];if(!i)return{success:!1,error:`${CS} Sprint with ID ${e} not found.`};const n=((e,t=[])=>{const a=new Set((e.column_values||[]).map((e=>e.id))),i=[...Object.values(kS),...t];return YS(a,i)})(i,[OS.SPRINT_SUMMARY]);if(!n.isValid)return{success:!1,error:`${US} Sprint item is missing required columns: ${n.missingColumns.join(", ")}. This may not be a valid sprint board item.`};const o=WS(i,OS.SPRINT_SUMMARY);return o?{success:!0,documentObjectId:o,sprintName:i.name}:{success:!1,error:`${$S} No sprint summary document found for sprint "${i.name}" (ID: ${e}). Sprint summary is only available for completed sprints that have analysis documents.`}}catch(e){return{success:!1,error:`${jS} Error getting sprint item: ${e instanceof Error?e.message:"Unknown error"}`}}}async readSprintSummaryDocument(e){try{const t={object_ids:[e],limit:1},a=(await this.mondayApi.request(pw,t)).docs||[];if(0===a.length)return{success:!1,error:`${$S} Document with object ID ${e} not found or not accessible.`};const i=a[0];if(!i||!i.id)return{success:!1,error:`${LS} Document data is invalid for object ID ${e}.`};const n={docId:i.id,blockIds:[]},o=await this.mondayApi.request(Iw,n);if(!o.export_markdown_from_doc?.success)return{success:!1,error:`${PS} Failed to export markdown from document: ${o.export_markdown_from_doc?.error||"Unknown error"}`};const r=o.export_markdown_from_doc.markdown;return r?{success:!0,content:r}:{success:!1,error:`${FS} Document content is empty or could not be retrieved.`}}catch(e){return{success:!1,error:`${jS} Error reading document: ${e instanceof Error?e.message:"Unknown error"}`}}}}],rN=[class extends wu{constructor(){super(...arguments),this.name="delete_item",this.type=x.WRITE,this.annotations=_u({title:"Delete Item",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete an item"}getInputSchema(){return CT}async executeInternal(e){const t={id:e.itemId.toString()},a=await this.mondayApi.request(mw,t);return{content:{message:`Item ${a.delete_item?.id} successfully deleted`,item_id:a.delete_item?.id}}}},class extends wu{constructor(){super(...arguments),this.name="get_board_items_page",this.type=x.READ,this.annotations=_u({title:"Get Board Items Page",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get all items from a monday.com board with pagination support and optional column values and item descriptions. Returns structured JSON with item details, creation/update timestamps, and pagination info. Use the 'nextCursor' parameter from the response to get the next page of results when 'has_more' is true. To retrieve an item's description (the rich-text body/details of a monday.com item), set 'includeItemDescription' to true — the response will include the item description's document blocks with their content, type, and id. Use this whenever the user asks about an item's description, body, details, or notes. [REQUIRED PRECONDITION]: Before using this tool, if new columns were added to the board or if you are not familiar with the board's structure (column IDs, column types, status labels, etc.), first use get_board_info to understand the board metadata. This is essential for constructing proper filters and knowing which columns are available. VIEW-BASED FILTERING: If the user refers to a board view by name (e.g. \"show me items in the 'Overdue' view\"), first call get_board_info to get the board's views, find the matching view by name, then extract its filter field and pass it as the filters argument here."}getInputSchema(){return eE}async executeInternal(e){const t=!e.cursor;if(t&&e.searchTerm)try{if(e.itemIds=await this.getItemIdsFromSmartSearchAsync(e),0===e.itemIds.length)return{content:"No items found matching the specified searchTerm"}}catch(t){gT(t),e.filters=this.rebuildFiltersWithManualSearch(e.searchTerm,e.filters)}const a={boardId:e.boardId.toString(),limit:e.limit,cursor:e.cursor||void 0,includeColumns:e.includeColumns,columnIds:e.columnIds,includeSubItems:e.includeSubItems,includeDescription:e.includeItemDescription};t&&(e.itemIds||e.filters||e.orderBy)&&(a.queryParams={ids:e.itemIds?.map((e=>e.toString())),operator:e.filtersOperator,rules:e.filters?.map((e=>({column_id:e.columnId.toString(),compare_value:e.compareValue,operator:e.operator,compare_attribute:e.compareAttribute}))),order_by:e.orderBy?.map((e=>({column_id:e.columnId,direction:e.direction})))});const i=await this.mondayApi.request(QT,a);return{content:this.mapResult(i,e)}}rebuildFiltersWithManualSearch(e,t){return(t=(t=t??[]).filter((e=>"name"!==e.columnId))).push({columnId:"name",operator:qg.ContainsText,compareValue:e}),t}mapResult(e,t){const a=e.boards?.[0],i=a?.items_page,n=i?.items||[];return{board:{id:a?.id,name:a?.name},items:n.map((e=>this.mapItem(e,t))),pagination:{has_more:!!i?.cursor,nextCursor:i?.cursor||null,count:n.length}}}mapItem(e,t){const a={id:e.id,name:e.name,url:e.url,created_at:e.created_at,updated_at:e.updated_at};if(t.includeColumns&&e.column_values){a.column_values={};for(const t of e.column_values)a.column_values[t.id]=this.getColumnValueData(t)}if(t.includeItemDescription&&"description"in e&&e.description){const t=(e.description.blocks??[]).filter((e=>!!e)).map((e=>({id:e.id,type:e.type,content:e.content})));a.item_description={id:e.description.id,blocks:t}}return t.includeSubItems&&"subitems"in e&&e.subitems&&(a.subitems=e.subitems.slice(0,t.subItemLimit).map((e=>this.mapItem(e,t)))),a}getColumnValueData(e){switch(e.type){case aT.BoardRelation:return e.linked_items;case aT.Formula:return e.display_value;case aT.Mirror:return"Column value type is not supported"}if(e.text)return e.text;try{return JSON.parse(e.value)}catch{return e.value||null}}async getItemIdsFromSmartSearchAsync(e){const t={query:e.searchTerm,limit:100,filters:{entities:[{items:{board_ids:[e.boardId.toString()]}}]}},a=await this.mondayApi.request(JT,t,{versionOverride:"dev",timeout:vT}),i=a.search?.filter((e=>"ItemSearchResult"===e.__typename))?.map((e=>Number(e.data.id)))??[];if(0===i.length)throw new Error("No items found for search term or new search is not enabled for this account");const n=e.itemIds??[];if(0===n.length)return i;const o=new Set(n);return i.filter((e=>o.has(e)))}},class extends wu{constructor(){super(...arguments),this.name="create_item",this.type=x.WRITE,this.annotations=_u({title:"Create Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new item with provided values, create a subitem under a parent item, or duplicate an existing item and update it with new values. Use parentItemId when creating a subitem under an existing item. Use duplicateFromItemId when copying an existing item with modifications.[REQUIRED PRECONDITION]: Before using this tool, if new columns were added to the board or if you are not familiar with the board's structure (column IDs, column types, status labels, etc.), first use get_board_info to understand the board metadata. This is essential for constructing proper column values and knowing which columns are available."}getInputSchema(){return this.context?.boardId?yT:_T}async executeInternal(e){const t=this.context?.boardId??e.boardId;if(e.duplicateFromItemId&&e.parentItemId)throw new Error("Cannot specify both parentItemId and duplicateFromItemId. Please provide only one of these parameters.");return e.duplicateFromItemId?await this.duplicateAndUpdateItem(e,t):e.parentItemId?await this.createSubitem(e):await this.createNewItem(e,t)}async duplicateAndUpdateItem(e,t){try{const a={boardId:t.toString(),itemId:e.duplicateFromItemId.toString()},i=await this.mondayApi.request(lT,a);if(!i.duplicate_item?.id)throw new Error("Failed to duplicate item: no item duplicated");let n;try{n=JSON.parse(e.columnValues)}catch(e){throw new Error("Invalid JSON in columnValues")}const o={...n,name:e.name},r=new Ow(this.mondayApi,this.apiToken,{boardId:t});return await r.execute({itemId:parseInt(i.duplicate_item.id),columnValues:JSON.stringify(o)}),{content:{message:`Item ${i.duplicate_item.id} duplicated from ${e.duplicateFromItemId}`,item_id:i.duplicate_item.id,item_name:i.duplicate_item.name,item_url:i.duplicate_item.url,board_id:t}}}catch(e){bT(e,"duplicate item")}}async createSubitem(e){const t={parentItemId:e.parentItemId.toString(),itemName:e.name,columnValues:e.columnValues};try{const a=await this.mondayApi.request(mT,t);if(!a.create_subitem?.id)throw new Error("Failed to create subitem: no subitem created");return{content:{message:`Subitem ${a.create_subitem.id} created under ${e.parentItemId}`,item_id:a.create_subitem.id,item_name:a.create_subitem.name,item_url:a.create_subitem.url}}}catch(e){bT(e,"create subitem")}}async createNewItem(e,t){try{const a={boardId:t.toString(),itemName:e.name,groupId:e.groupId,columnValues:e.columnValues},i=await this.mondayApi.request(uw,a);return{content:{message:`Item ${i.create_item?.id} successfully created`,item_id:i.create_item?.id,item_name:i.create_item?.name,item_url:i.create_item?.url,board_id:t}}}catch(e){bT(e,"create item")}}},class extends wu{constructor(){super(...arguments),this.name="create_update",this.type=x.WRITE,this.annotations=_u({title:"Create Update",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new update (comment/post) on a monday.com item. Updates can be used to add comments, notes, or discussions to items. You can optionally mention users, teams, or boards in the update. You can also reply to an existing update by using the parentId parameter."}getInputSchema(){return IT}async executeInternal(e){let t;if(e.mentionsList)try{const a=JSON.parse(e.mentionsList),i=ET.safeParse(a);if(!i.success)throw new Error(`Invalid mentionsList format: ${i.error.message}`);t=i.data}catch(e){throw new Error(`Invalid mentionsList JSON format: ${e.message}`)}try{const a={itemId:e.itemId.toString(),body:e.body,mentionsList:t,parentId:e.parentId?.toString()},i=await this.mondayApi.request(xT,a);if(!i.create_update?.id)throw new Error("Failed to create update: no update created");return{content:{message:`Update ${i.create_update.id} created on item ${e.itemId}`,update_id:i.create_update.id,item_id:e.itemId,item_name:i.create_update.item?.name,item_url:i.create_update.item?.url}}}catch(e){bT(e,"create update")}}},class extends wu{constructor(){super(...arguments),this.name="get_updates",this.type=x.READ,this.annotations=_u({title:"Get Updates",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get updates (comments/posts) from a monday.com item or board. Specify objectId and objectType (Item or Board) to retrieve updates. For Board queries, you can filter by date range using fromDate and toDate (both required together, ISO8601 format). By default, Board queries return only board discussion; set includeItemUpdates to true to also include updates on individual items. Returns update text, creator info, timestamps, and optionally replies and assets."}getInputSchema(){return DT}async executeInternal(e){try{const t=void 0!==e.fromDate,a=void 0!==e.toDate;if(t!==a)throw new Error("Both fromDate and toDate must be provided together for date range filtering");if((t||a)&&e.objectType===AT.Item)throw new Error("Date range filtering (fromDate/toDate) is only supported for Board objectType");const i={limit:e.limit??25,page:e.page??1,includeReplies:e.includeReplies??!1,includeAssets:e.includeAssets??!1};let n;n=e.objectType===AT.Item?await this.mondayApi.request(ST,{...i,itemId:e.objectId}):await this.mondayApi.request(NT,{...i,boardId:e.objectId,boardUpdatesOnly:!e.includeItemUpdates,...e.fromDate&&e.toDate?{fromDate:kT(e.fromDate),toDate:kT(e.toDate)}:{}});const o=e.objectType===AT.Item?n.items?.[0]?.updates:n.boards?.[0]?.updates;if(!o||0===o.length)return{content:`No updates found for ${e.objectType.toLowerCase()} with id ${e.objectId}`};const r=o.map((t=>{const a={id:t.id,text_body:t.text_body,created_at:t.created_at,updated_at:t.updated_at,creator:t.creator?{id:t.creator.id,name:t.creator.name}:null,item_id:t.item_id};return e.includeReplies&&t.replies&&(a.replies=t.replies.map((e=>({id:e.id,text_body:e.text_body,created_at:e.created_at,updated_at:e.updated_at,creator:e.creator?{id:e.creator.id,name:e.creator.name}:null})))),e.includeAssets&&t.assets&&(a.assets=t.assets.filter((e=>!!e)).map((e=>({id:e.id,name:e.name,url:e.url,file_extension:e.file_extension,file_size:e.file_size,created_at:e.created_at})))),a})),s=e.objectType===AT.Item?n.items?.[0]?.url:n.boards?.[0]?.url;return{content:{message:"Updates retrieved",[`${e.objectType.toLowerCase()}_id`]:e.objectId,url:s,updates:r,pagination:{page:e.page??1,limit:e.limit??25,count:r.length}}}}catch(e){bT(e,"get updates")}}},class extends wu{constructor(){super(...arguments),this.name="create_update_in_monday",this.type=x.WRITE,this.annotations=_u({title:"Create Update in Monday, after calling this tool you should",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new update (comment/post) on a monday.com item. Updates can be used to add comments, notes, or discussions to items. You can optionally mention users, teams, or boards in the update. After calling this tool you should call the full board data tool to get data, and immediately after that call the show table tool to show the data from that tool. IMPORTANT: You MUST use the COMPLETE data from the full board data tool - do NOT cut, truncate, or omit any data. Pass the entire dataset to the show table tool."}getInputSchema(){return bS}async executeInternal(e){let t;if(e.mentionsList)try{const a=JSON.parse(e.mentionsList),i=vS.safeParse(a);if(!i.success)throw new Error(`Invalid mentionsList format: ${i.error.message}`);t=i.data}catch(e){throw new Error(`Invalid mentionsList JSON format: ${e.message}`)}try{const a={itemId:e.itemId.toString(),body:e.body,mentionsList:t},i=await this.mondayApi.request(xT,a);if(!i.create_update?.id)throw new Error("Failed to create update: no update created");return{content:{message:`Update ${i.create_update.id} successfully created on item ${e.itemId}`,update_id:i.create_update.id,item_id:e.itemId,next_steps:"Now call the full board data tool to get data, then immediately call the show table tool to show that data. CRITICAL: You MUST pass the COMPLETE and FULL data from the full board data tool to the show table tool - do NOT cut, summarize, truncate, or omit ANY data. Use the entire dataset exactly as received."}}}catch(e){bT(e,"create update")}}},class extends wu{constructor(){super(...arguments),this.name="get_board_schema",this.type=x.READ,this.annotations=_u({title:"Get Board Schema",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get board schema (columns and groups) by board id"}getInputSchema(){if(!this.context?.boardId)return tE}async executeInternal(e){const t=this.context?.boardId??e.boardId,a={boardId:t.toString()},i=await this.mondayApi.request(fw,a);return{content:{message:"Board schema retrieved",board_id:t,columns:i.boards?.[0]?.columns?.map((e=>({id:e?.id,title:e?.title,type:e?.type})))??[],groups:i.boards?.[0]?.groups?.map((e=>({id:e?.id,title:e?.title})))??[]}}}},class extends wu{constructor(){super(...arguments),this.name="get_board_activity",this.type=x.READ,this.annotations=_u({title:"Get Board Activity",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0}),this.defaultLimit=1e3}getDescription(){return"Get board activity logs for a specified time range (defaults to last 30 days)"}getInputSchema(){return BT}async executeInternal(e){const t=new Date,a=new Date(t.getTime()-hT.MONTH30Days),i=e?.fromDate||a.toISOString(),n=e?.toDate||t.toISOString(),o={boardId:e.boardId.toString(),fromDate:i,toDate:n,limit:this.defaultLimit,page:1,includeData:e.includeData??!1},r=await this.mondayApi.request(VT,o),s=r.boards?.[0]?.activity_logs;if(!s||0===s.length)return{content:`No activity found for board ${e.boardId} in the specified time range (${i} to ${n}).`};const p=r.boards?.[0],d=e.includeData??!1;return{content:{message:"Board activity retrieved",board_id:e.boardId,board_name:p?.name,board_url:p?.url,data:s.filter((e=>null!=e)).map((e=>({created_at:e.created_at,event:e.event,entity:e.entity,user_id:e.user_id,...d&&e.data?{data:e.data}:{}})))}}}},class extends wu{constructor(){super(...arguments),this.name="get_board_info",this.type=x.READ,this.annotations=_u({title:"Get Board Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get comprehensive board information including metadata, structure, owners, and configuration. Also returns the board's views (e.g. table views, filter views) — each view includes its id, name, type, and a structured `filter` object. "}getInputSchema(){return KT}async executeInternal(e){const t={boardId:e.boardId.toString()},a=await this.mondayApi.request(MT,t),i=a.boards?.[0];if(!i)return{content:`Board with id ${e.boardId} not found or you don't have access to it.`};const n=await this.getSubItemsBoardAsync(i);return{content:HT(i,n)}}async getSubItemsBoardAsync(e){const t=e.columns?.find((e=>e?.type===aT.Subtasks));if(!t)return null;const a=t.settings.boardIds[0],i=await this.mondayApi.request(qT,{boardId:a});return i.boards?.[0]??null}},class extends wu{constructor(){super(...arguments),this.name="get_full_board_data",this.type=x.READ,this.annotations=_u({title:"Get Full Board Data",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"INTERNAL USE ONLY - DO NOT CALL THIS TOOL DIRECTLY. This tool is exclusively triggered by UI components and should never be invoked directly by the agent."}getInputSchema(){return UT}async executeInternal(e){try{const t={boardId:e.boardId,itemsLimit:7};e.filters&&(t.queryParams={operator:e.filtersOperator,rules:e.filters.map((e=>({column_id:e.columnId.toString(),compare_value:e.compareValue,operator:e.operator,compare_attribute:e.compareAttribute})))});const a=await this.mondayApi.request(LT,t);if(!a.boards||0===a.boards.length||!a.boards[0])throw new Error(`Board with ID ${e.boardId} not found`);const i=a.boards[0],n=new Set;i.items_page.items.forEach((e=>{e.updates?.forEach((e=>{e.creator_id&&n.add(e.creator_id),e.replies?.forEach((e=>{e.creator_id&&n.add(e.creator_id)}))})),e.column_values.forEach((e=>{if("persons_and_teams"in e){const t=e;t.persons_and_teams?.forEach((e=>{"person"===e.kind&&e.id&&n.add(e.id)}))}}))}));const o=Array.from(n).filter((e=>!(Number(e)<0)));let r=[];if(o.length>0){const e={userIds:o},t=await this.mondayApi.request(FT,e);r=t.users?.filter((e=>null!==e))||[]}const s=new Map(r.map((e=>[e.id,e])));return{content:{board:{id:i.id,name:i.name,columns:i.columns,items:i.items_page.items.map((e=>({id:e.id,name:e.name,column_values:e.column_values,updates:e.updates?.map((e=>({id:e.id,creator_id:e.creator_id||"",creator:e.creator_id&&s.get(e.creator_id)||null,text_body:e.text_body,created_at:e.created_at,replies:e.replies?.map((e=>({id:e.id,creator_id:e.creator_id||"",creator:e.creator_id&&s.get(e.creator_id)||null,text_body:e.text_body,created_at:e.created_at})))||[]})))||[]})))},users:r,stats:{total_items:i.items_page.items.length,total_updates:i.items_page.items.reduce(((e,t)=>e+(t.updates?.length||0)),0),total_unique_creators:r.length}}}}catch(e){bT(e,"get full board data")}}},class extends wu{constructor(){super(...arguments),this.name="list_users_and_teams",this.type=x.READ,this.annotations=_u({title:"List Users and Teams",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Tool to fetch users and/or teams data. \n\n MANDATORY BEST PRACTICES:\n 1. ALWAYS use specific IDs or names when available\n 2. If no ids available, use name search if possible (USERS ONLY)\n 3. Use 'getMe: true' to get current user information\n 4. AVOID broad queries (no parameters) - use only as last resort\n\n REQUIRED PARAMETER PRIORITY (use in this order):\n 1. getMe - STANDALONE\n 2. userIds\n 3. name - STANDALONE (USERS ONLY, NOT for teams)\n 4. teamIds + teamsOnly\n 5. No parameters - LAST RESORT\n\n CRITICAL USAGE RULES:\n • userIds + teamIds requires explicit includeTeams: true flag\n • includeTeams: true fetches both users and teams, do not use this to fetch a specific user's teams rather fetch that user by id and you will get their team memberships.\n • name parameter is for USER search ONLY - it cannot be used to search for teams. Use teamIds to fetch specific teams."}getInputSchema(){return OE}async executeInternal(e){const t=e.userIds&&e.userIds.length>0,a=e.teamIds&&e.teamIds.length>0,i=e.includeTeams||!1,n=e.teamsOnly||!1,o=e.includeTeamMembers||!1,r=!!e.name;if(e.getMe||!1){if(t||a||i||n||o||r)return{content:"PARAMETER_CONFLICT: getMe is STANDALONE only. Remove all other parameters when using getMe: true for current user lookup."};const e=await this.mondayApi.request(wE);if(!e.me)return{content:"AUTHENTICATION_ERROR: Current user fetch failed. Verify API token and user permissions."};const s={users:[e.me]},p=EE(s),d=await DE(this.mondayApi);return{content:{data:p,action_name:"Users and teams",url:d?`https://${d}.monday.com/teams/all`:void 0}}}if(r){if(t||a||i||n||o)return{content:"PARAMETER_CONFLICT: name is STANDALONE only. Remove userIds, teamIds, includeTeams, teamsOnly, and includeTeamMembers when using name search."};const r={name:e.name},s=await this.mondayApi.request(_E,r);if(!s.users||0===s.users.length)return{content:`NAME_SEARCH_EMPTY: No users found matching "${e.name}". Try broader search terms or verify user exists in account.`};const p=s.users.filter((e=>null!==e)).map((e=>`• **${e.name}** (ID: ${e.id})${e.title?` - ${e.title}`:""}`)).join("\n"),d=`Found ${s.users.length} user(s) matching "${e.name}":\n\n${p}`,c=await DE(this.mondayApi);return{content:{data:d,action_name:"Users and teams",url:c?`https://${c}.monday.com/teams/all`:void 0}}}if(n&&i)return{content:"PARAMETER_CONFLICT: Cannot use teamsOnly: true with includeTeams: true. Use teamsOnly for teams-only queries or includeTeams for combined data."};if(t&&e.userIds&&e.userIds.length>IE)return{content:`LIMIT_EXCEEDED: userIds array too large (${e.userIds.length}/500). Split into batches of max 500 IDs and make multiple calls.`};if(a&&e.teamIds&&e.teamIds.length>SE)return{content:`LIMIT_EXCEEDED: teamIds array too large (${e.teamIds.length}/500). Split into batches of max 500 IDs and make multiple calls.`};let s;if(n||!t&&a&&!i)if(o){const t={teamIds:e.teamIds};s=await this.mondayApi.request(yE,t)}else{const t={teamIds:e.teamIds};s=await this.mondayApi.request(gE,t)}else if(i){const t={userIds:e.userIds,teamIds:e.teamIds,limit:NE};s=await this.mondayApi.request(bE,t)}else if(t){const t={userIds:e.userIds,limit:NE};s=await this.mondayApi.request(hE,t)}else{const e={userIds:void 0,limit:NE};s=await this.mondayApi.request(vE,e)}const p=EE(s),d=await DE(this.mondayApi);return{content:{data:p,action_name:"Users and teams",url:d?`https://${d}.monday.com/teams/all`:void 0}}}},Ow,class extends wu{constructor(){super(...arguments),this.name="move_item_to_group",this.type=x.WRITE,this.annotations=_u({title:"Move Item to Group",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Move an item to a group in a monday.com board"}getInputSchema(){return RE}async executeInternal(e){const t={itemId:e.itemId.toString(),groupId:e.groupId},a=await this.mondayApi.request(vw,t);return{content:`Item ${a.move_item_to_group?.id} successfully moved to group ${e.groupId}`}}},class extends wu{constructor(){super(...arguments),this.name="create_board",this.type=x.WRITE,this.annotations=_u({title:"Create Board",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com board"}getInputSchema(){return Rw}async executeInternal(e){const t={boardName:e.boardName,boardKind:e.boardKind,boardDescription:e.boardDescription,workspaceId:e.workspaceId},a=await this.mondayApi.request(bw,t);return{content:{message:`Board ${a.create_board?.id} successfully created`,board_id:a.create_board?.id,board_name:a.create_board?.name,board_url:a.create_board?.url}}}},class extends wu{constructor(){super(...arguments),this.name="create_form",this.type=x.WRITE,this.annotations=_u({title:"Create Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a monday.com form. This will create a new form as well as a new board for which the form’s responses will be stored. The returned board_id is the ID of the board that was created while the returned formToken can be used for all future queries and mutations to continue editing the form."}getInputSchema(){return lx}async executeInternal(e){const t={destination_workspace_id:e.destination_workspace_id,destination_folder_id:e.destination_folder_id,destination_folder_name:e.destination_folder_name,board_kind:e.board_kind,destination_name:e.destination_name,board_owner_ids:e.board_owner_ids,board_owner_team_ids:e.board_owner_team_ids,board_subscriber_ids:e.board_subscriber_ids,board_subscriber_teams_ids:e.board_subscriber_teams_ids},a=await this.mondayApi.request(qw,t);return{content:{message:"Form created successfully",board_id:a.create_form?.boardId,form_token:a.create_form?.token}}}},class extends wu{constructor(){super(...arguments),this.name="update_form",this.type=x.WRITE,this.annotations=_u({title:"Update Form",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0}),this.helpers=new eT(this.mondayApi),this.actionHandlers=new Map([[Ox.setFormPassword,this.helpers.setFormPassword.bind(this.helpers)],[Ox.shortenFormUrl,this.helpers.shortenFormUrl.bind(this.helpers)],[Ox.deactivate,this.helpers.deactivateForm.bind(this.helpers)],[Ox.activate,this.helpers.activateForm.bind(this.helpers)],[Ox.createTag,this.helpers.createTag.bind(this.helpers)],[Ox.deleteTag,this.helpers.deleteTag.bind(this.helpers)],[Ox.updateTag,this.helpers.updateTag.bind(this.helpers)],[Ox.updateAppearance,this.helpers.updateAppearance.bind(this.helpers)],[Ox.updateAccessibility,this.helpers.updateAccessibility.bind(this.helpers)],[Ox.updateFeatures,this.helpers.updateFeatures.bind(this.helpers)],[Ox.updateQuestionOrder,this.helpers.updateQuestionOrder.bind(this.helpers)],[Ox.updateFormHeader,this.helpers.updateFormHeader.bind(this.helpers)]])}getDescription(){return'Update a monday.com form. Handles the following form update actions that can only be done one at a time using the correct "action" input: \n - update form\'s feature settings with the action "updateFeatures",\n - update form\'s appearance settings with the action "updateAppearance",\n - update form\'s accessibility settings with the action "updateAccessibility",\n - update form\'s title with the action "updateFormHeader",\n - update form\'s description with the action "updateFormHeader",\n - update form\'s question order with the action "updateQuestionOrder",\n - create a new form tag with the action "createTag",\n - delete a form tag with the action "deleteTag",\n - update a form tag with the action "updateTag",\n - set or update the form\'s password with the action "setFormPassword"\n - shorten form\'s url with the action "shortenFormUrl"\n - deactivate form with the action "deactivateForm"\n - reactivate form with the action "activateForm"'}getInputSchema(){return Zx}async executeInternal(e){const t=this.actionHandlers.get(e.action);return t?await t(e):{content:"Received an invalid action for the update form tool."}}},class extends wu{constructor(){super(...arguments),this.name="get_form",this.type=x.READ,this.annotations=_u({title:"Get Form",readOnlyHint:!0,destructiveHint:!1})}getDescription(){return"Get a monday.com form by its form token. Form tokens can be extracted from the form’s url. Given a form url, such as https://forms.monday.com/forms/abc123def456ghi789?r=use1, the token is the alphanumeric string that appears right after /forms/ and before the ?. In the example, the token is abc123def456ghi789."}getInputSchema(){return tT}async executeInternal(e){const t={formToken:e.formToken},a=await this.mondayApi.request(Hw,t);return a.form?{content:{message:"Form retrieved",form_token:e.formToken,data:a.form}}:{content:`Form with token ${e.formToken} not found or you don't have access to it.`}}},class extends wu{constructor(){super(...arguments),this.name="form_questions_editor",this.type=x.WRITE,this.annotations=_u({title:"Form Questions Editor",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1}),this.helpers=new kx(this.mondayApi),this.actionHandlers=new Map([[Nx.Delete,this.helpers.deleteQuestion.bind(this.helpers)],[Nx.Update,this.helpers.updateQuestion.bind(this.helpers)],[Nx.Create,this.helpers.createQuestion.bind(this.helpers)]])}getDescription(){return"Create, update, or delete a question in a monday.com form"}getInputSchema(){return Dx}async executeInternal(e){const t=this.actionHandlers.get(e.action);return t?await t(e):{content:`Unknown action: ${e.action}`}}},class extends wu{constructor(){super(...arguments),this.name="create_column",this.type=x.WRITE,this.annotations=_u({title:"Create Column",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new column in a monday.com board"}getInputSchema(){return this.context?.boardId?iT:nT}async executeInternal(e){const t=this.context?.boardId??e.boardId,a={boardId:t?.toString()??"",columnType:e.columnType,columnTitle:e.columnTitle,columnDescription:e.columnDescription,columnSettings:"string"==typeof e.columnSettings?JSON.parse(e.columnSettings):e.columnSettings},i=await this.mondayApi.request(gw,a);return{content:{message:"Column successfully created",column_id:i.create_column?.id,column_title:i.create_column?.title}}}},class extends wu{constructor(){super(...arguments),this.name="create_group",this.type=x.WRITE,this.annotations=_u({title:"Create Group",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new group in a monday.com board. Groups are sections that organize related items. Use when users want to add structure, categorize items, or create workflow phases. Groups can be positioned relative to existing groups and assigned predefined colors. Items will always be created in the top group and so the top group should be the most relevant one for new item creation"}getInputSchema(){return cT}async executeInternal(e){const t={boardId:e.boardId,groupName:e.groupName,groupColor:e.groupColor,relativeTo:e.relativeTo,positionRelativeMethod:e.positionRelativeMethod},a=await this.mondayApi.request(pT,t);return{content:{message:"Group created successfully",group_id:a.create_group?.id,group_title:a.create_group?.title,board_id:e.boardId,group_name:e.groupName}}}},class extends wu{constructor(){super(...arguments),this.name="delete_column",this.type=x.WRITE,this.annotations=_u({title:"Delete Column",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1})}getDescription(){return"Delete a column from a monday.com board"}getInputSchema(){return this.context?.boardId?OT:RT}async executeInternal(e){const t={boardId:(this.context?.boardId??e.boardId).toString(),columnId:e.columnId},a=await this.mondayApi.request(yw,t);return{content:{message:`Column ${a.delete_column?.id} successfully deleted`,column_id:a.delete_column?.id}}}},Aw,class extends wu{constructor(){super(...arguments),this.name="get_graphql_schema",this.type=x.ALL_API,this.annotations=_u({title:"Get GraphQL Schema",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Fetch the monday.com GraphQL schema structure including query and mutation definitions. This tool returns available query fields, mutation fields, and a list of GraphQL types in the schema. You can filter results by operation type (read/write) to focus on either queries or mutations."}getInputSchema(){return oE}async executeInternal(e){try{const t=await this.mondayApi.request(_w),a=e?.operationType,i=t.__schema,n="write"!==a?t.queryType?.fields?.map((e=>({name:e.name,description:e.description??null})))??[]:void 0,o="read"!==a?t.mutationType?.fields?.map((e=>({name:e.name,description:e.description??null})))??[]:void 0,r=i?.types?.filter((e=>e.name&&!e.name.startsWith("__"))).map((e=>({name:e.name,kind:e.kind??"unknown"})))??[];return{content:{message:"GraphQL schema retrieved",...void 0!==n&&{query_fields:n},...void 0!==o&&{mutation_fields:o},types:r}}}catch(e){return{content:`Error fetching GraphQL schema: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends wu{constructor(){super(...arguments),this.name="get_column_type_info",this.type=x.READ,this.annotations=_u({title:"Get Column Type Info",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Retrieves comprehensive information about a specific column type, including JSON schema definition and other metadata. Use this before creating columns with the create_column tool to understand the structure, validation rules, and available properties for column settings."}getInputSchema(){return nE}async executeInternal(e){const t={type:e.columnType},a=await this.mondayApi.request(aE,t);if(!a?.get_column_type_schema)return{content:`Information for column type "${e.columnType}" not found or not available.`};const i={schema:a.get_column_type_schema};return{content:{message:`Column type info for ${e.columnType}`,data:i,url:iE}}}},class extends wu{constructor(){super(...arguments),this.name="get_type_details",this.type=x.ALL_API,this.annotations=_u({title:"Get Type Details",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get detailed information about a specific GraphQL type from the monday.com API schema"}getInputSchema(){return rE}async executeInternal(e){try{if(!e.typeName)return{content:"Error: typeName is required. Please provide a valid GraphQL type name."};const a=(t=e.typeName,sw`
1964
1964
  query getTypeDetails {
1965
1965
  __type(name: "${t}") {
1966
1966
  name
@@ -2048,5 +2048,5 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import t from"util";import a,{R
2048
2048
  }
2049
2049
  }
2050
2050
  }
2051
- `),i=await this.mondayApi.request(a);if(!i.__type)return{content:`Type '${e.typeName}' not found in the GraphQL schema. Please check the type name and try again.`};let n=`## Type: ${i.__type.name||"Unnamed"} ${e.typeName===i.__type.name?"":`(queried: ${e.typeName})`}\nKind: ${i.__type.kind}\n${i.__type.description?`Description: ${i.__type.description}`:""}\n\n`;return i.__type.fields&&i.__type.fields.length>0&&(n+="## Fields\n",i.__type.fields.forEach((e=>{const t=sE(e.type);n+=`- ${e.name}: ${t}${e.description?` - ${e.description}`:""}\n`,e.args&&e.args.length>0&&(n+=" Arguments:\n",e.args.forEach((e=>{const t=sE(e.type);n+=` - ${e.name}: ${t}${e.description?` - ${e.description}`:""}${e.defaultValue?` (default: ${e.defaultValue})`:""}\n`})))})),n+="\n"),i.__type.inputFields&&i.__type.inputFields.length>0&&(n+="## Input Fields\n",i.__type.inputFields.forEach((e=>{const t=sE(e.type);n+=`- ${e.name}: ${t}${e.description?` - ${e.description}`:""}${e.defaultValue?` (default: ${e.defaultValue})`:""}\n`})),n+="\n"),i.__type.interfaces&&i.__type.interfaces.length>0&&(n+="## Implements\n",i.__type.interfaces.forEach((e=>{n+=`- ${e.name}\n`})),n+="\n"),i.__type.enumValues&&i.__type.enumValues.length>0&&(n+="## Enum Values\n",i.__type.enumValues.forEach((e=>{n+=`- ${e.name}${e.description?` - ${e.description}`:""}\n`})),n+="\n"),i.__type.possibleTypes&&i.__type.possibleTypes.length>0&&(n+="## Possible Types\n",i.__type.possibleTypes.forEach((e=>{n+=`- ${e.name}\n`}))),n+=`\n## Usage Examples\nIf this is a Query or Mutation field, you can use it in the all_monday_api tool.\n\nExample for query:\nall_monday_api(operation: "query", name: "getTypeData", variables: "{\\"typeName\\": \\"${i.__type.name}\\"}")\n\nExample for object field access:\nWhen querying objects that have this type, include these fields in your query.\n`,{content:n}}catch(e){const 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 wu{constructor(){super(...arguments),this.name="create_custom_activity",this.type=x.WRITE,this.annotations=_u({title:"Create Custom Activity",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new custom activity in the E&A app"}getInputSchema(){return oT}async executeInternal(e){const t={color:e.color,icon_id:e.icon_id,name:e.name};return await this.mondayApi.request(xw,t),{content:`Custom activity '${e.name}' with color ${e.color} and icon ${e.icon_id} successfully created`}}},class extends wu{constructor(){super(...arguments),this.name="create_notification",this.type=x.WRITE,this.annotations=_u({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 sT}async executeInternal(e){const t={user_id:e.user_id,target_id:e.target_id,text:e.text,target_type:e.target_type};try{await this.mondayApi.request(rT,t);return{content:{message:"Notification sent",user_id:e.user_id,text:e.text}}}catch(t){return{content:`Failed to send notification to user ${e.user_id}`}}}},class extends wu{constructor(){super(...arguments),this.name="create_timeline_item",this.type=x.WRITE,this.annotations=_u({title:"Create Timeline Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new timeline item in the E&A app"}getInputSchema(){return wT}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(Tw,t);return{content:`Timeline item '${e.title}' with ID ${a.create_timeline_item?.id} successfully created on item ${e.item_id}`}}},class extends wu{constructor(){super(...arguments),this.name="fetch_custom_activity",this.type=x.READ,this.annotations=_u({title:"Fetch Custom Activities",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get custom activities from the E&A app"}getInputSchema(){return $T}async executeInternal(e){const t=await this.mondayApi.request(Ew);if(!t.custom_activity||0===t.custom_activity.length)return{content:"No custom activities found"};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:`Found ${a.length} custom activities: ${JSON.stringify(a,null,2)}`}}},class extends wu{constructor(){super(...arguments),this.name="read_docs",this.type=x.READ,this.annotations=_u({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- Set include_comments: true to fetch all comments and replies on the document. 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 LE}async executeInternal(e){return"version_history"===e.mode?this.executeVersionHistory(e):this.executeContent(e)}async executeContent(e){try{if(!e.type||!e.ids||0===e.ids.length)return{content:'Error: type and ids are required when mode is "content".'};let t,a,i;switch(e.type){case"ids":t=e.ids;break;case"object_ids":a=e.ids;break;case"workspace_ids":i=e.ids}const n=e.include_blocks??!1,o={ids:t,object_ids:a,limit:e.limit||25,order_by:e.order_by,page:e.page,workspace_ids:i,includeBlocks:n};let r=await this.mondayApi.request(pw,o);if((!r.docs||0===r.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:i,includeBlocks:n};r=await this.mondayApi.request(pw,a)}if(!r.docs||0===r.docs.length){return{content:`No documents found matching the specified criteria${e.page?` (page ${e.page})`:""}.`}}const s=e.include_comments??!1,p=e.comments_limit??50;return this.enrichDocsWithMarkdown(r.docs,o,n,s,p)}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:i,version_history_limit:n}=e,o=e.ids?.[0];if(!o)return{content:'Error: ids is required when mode is "version_history". Provide the document object_id.'};try{const e={docId:o,since:a,until:i},r=await this.mondayApi.request(dw,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 n&&(s=s.slice(0,n)),{content:JSON.stringify({doc_id:o,since:a,until:i,restoring_points:s},null,2)};const p=Math.min(n??10,10),d=s.slice(0,p+1),c=s.length>p,l=(await Promise.allSettled(d.map((async(e,t)=>{if(t===d.length-1||!e.date)return e;const a=d[t+1];if(!a?.date)return e;const i={docId:o,date:e.date,prevDate:a.date},n=await this.mondayApi.request(lw,i);return{...e,diff:n?.doc_version_diff?.blocks??[]}}))).then((e=>e.map(((e,t)=>"fulfilled"===e.status?e.value:d[t]))))).slice(0,p);return{content:JSON.stringify({doc_id:o,since:a,until:i,restoring_points:l,...c&&{truncated:!0,total_count:s.length}},null,2)}}catch(e){return{content:`Error fetching version history for document ${o}: ${e instanceof Error?e.message:"Unknown error"}`}}}async fetchDocComments(e,t){try{const a={boardId:e,itemsLimit:100,updatesLimit:t},i=await this.mondayApi.request(cw,a),n=i.boards?.[0]?.items_page?.items;if(!n)return[];const o=[];for(const e of n)if(e.updates&&0!==e.updates.length)for(const t of e.updates)o.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,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 o}catch(e){return`Error fetching comments: ${e instanceof Error?e.message:"Unknown error"}`}}async enrichDocsWithMarkdown(e,t,a,i=!1,n=50){const o=await Promise.all(e.filter((e=>null!==e)).map((async e=>{let t,o="";try{const t={docId:e.id},a=await this.mondayApi.request(Iw,t);o=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){o=`Error getting markdown: ${e instanceof Error?e.message:"Unknown error"}`}return i&&e.object_id&&(t=await this.fetchDocComments(e.object_id,n)),{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})))},blocks_as_markdown:o,...i&&{comments:t}}}))),r=t.page||1,s=t.limit||25,p=o.length,d=p===s;return{content:{message:`Documents retrieved (${o.length})`,pagination:{current_page:r,limit:s,count:p,has_more_pages:d},data:o}}}},class extends wu{constructor(){super(...arguments),this.name="workspace_info",this.type=x.READ,this.annotations=_u({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 FE}async executeInternal(e){const t={workspace_id:e.workspace_id},a=await this.mondayApi.request(Sw,t);if(!a.workspaces||0===a.workspaces.length)return{content:`No workspace found with ID ${e.workspace_id}`};const i=function(e,t){const{workspaces:a,boards:i,docs:n,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:[]}]))),p=[];(i||[]).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):p.push(t)}));const d=[];return(n||[]).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):d.push(t)})),{workspace:{id:r.id,name:r.name,url:t?OE(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:p,docs:d}}}(a,await kE(this.mondayApi));return{content:{message:"Workspace info retrieved",data:i}}}},class extends wu{constructor(){super(...arguments),this.name="list_workspaces",this.type=x.READ,this.annotations=_u({title:"List Workspaces",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"List all workspaces available to the user. Returns up to 500 workspaces with their ID, name, and description."}getInputSchema(){return ME}async executeInternal(e){const t=e.searchTerm?1e4:e.limit,a=e.searchTerm?1:e.page;let i=null;if(e.searchTerm&&(i=UE(e.searchTerm),0===i.length))throw new Error("Search term did not include any alphanumeric characters. Please provide a valid search term.");const n=e=>({limit:t,page:a,membershipKind:e}),o=VE(await this.mondayApi.request(PE,n(Uy.Member))),r=!BE(o)||i&&!function(e,t){return t.some((t=>UE(t.name).includes(e)))}(i,o);let s=o;if(r){s=VE(await this.mondayApi.request(PE,n(Uy.All)))}if(!BE(s))return{content:"No workspaces found."};const p=i&&s?.length<=jE,d=function(e,t,a,i){if(!e||t.length<=jE)return t;const n=(a-1)*i,o=n+i;return t.filter((t=>UE(t.name).includes(e))).slice(n,o)}(i,s,e.page,e.limit);if(!BE(d))return{content:"No workspaces found matching the search term. Try using the tool without a search term"};const c=d.length===e.limit,l=await kE(this.mondayApi),m=d.map((e=>({id:e.id,name:e.name,description:e.description||void 0,url:l&&e.id?OE(l,e.id):void 0})));return{content:{message:"Workspaces retrieved",...p?{disclaimer:"Search term not applied - returning all workspaces. Perform the filtering manually."}:{},...c?{next_page:e.page+1}:{},data:m}}}},class extends wu{constructor(){super(...arguments),this.name="create_doc",this.type=x.WRITE,this.annotations=_u({title:"Create Document",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Create a new monday.com doc either inside a workspace or attached to an item (via a doc column). After creation, the provided markdown will be appended to the document.\n\nLOCATION TYPES:\n- workspace: Creates a document in a workspace (requires workspace_id, optional doc_kind, optional folder_id)\n- item: Creates a document attached to an item (requires item_id, optional column_id)\n\nUSAGE EXAMPLES:\n- Workspace doc: { location: "workspace", workspace_id: 123, doc_kind: "private" , markdown: "..." }\n- Workspace doc in folder: { location: "workspace", workspace_id: 123, folder_id: 17264196 , markdown: "..." }\n- Item doc: { location: "item", item_id: 456, column_id: "doc_col_1" , markdown: "..." }'}getInputSchema(){return KE}async executeInternal(e){const t=YE.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,i,n;if(a.type===WE.enum.workspace){const o={location:{workspace:{workspace_id:a.workspace_id.toString(),name:e.doc_name,kind:a.doc_kind||Gb.Public,folder_id:a.folder_id?.toString()}}},r=await this.mondayApi.request(HE,o);t=r?.create_doc?.id??void 0,i=r?.create_doc?.object_id??void 0,n=r?.create_doc?.url??void 0}else if(a.type===WE.enum.item){const o={itemId:a.item_id.toString()},r=await this.mondayApi.request(qE,o),s=r.items?.[0];if(!s)return{content:`Error: Item with id ${a.item_id} not found.`};const p=s.board?.id,d=s.board?.columns?.find((e=>e&&e.type===aT.Doc));let c=a.column_id;if(!c)if(d)c=d.id;else{const e={boardId:p.toString(),columnType:aT.Doc,columnTitle:"Doc"},t=await this.mondayApi.request(gw,e);if(c=t?.create_column?.id,!c)return{content:"Error: Failed to create doc column."}}const l={location:{board:{item_id:a.item_id.toString(),column_id:c}}},m=await this.mondayApi.request(HE,l);if(t=m.create_doc?.id??void 0,i=m.create_doc?.object_id??void 0,n=m.create_doc?.url??void 0,e.doc_name&&t)try{const a={docId:t,name:e.doc_name};await this.mondayApi.request(zE,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(GE,o),s=r?.add_content_to_doc_from_markdown?.success,p=r?.add_content_to_doc_from_markdown?.error;return s?{content:{message:"Document successfully created",doc_id:t,object_id:i,doc_url:n,doc_name:e.doc_name}}:{content:`Document ${t} created, but failed to add markdown content: ${p||"Unknown error"}`}}catch(e){return{content:`Error creating document: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends wu{constructor(){super(...arguments),this.name="add_content_to_doc",this.type=x.WRITE,this.annotations=_u({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 ZE}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(XE,{docId:[e.doc_id]});t=a.docs?.[0]??null}else{const a=await this.mondayApi.request(JE,{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}`}.`}}const a={docId:t.id,markdown:e.markdown,afterBlockId:e.after_block_id},i=await this.mondayApi.request(QE,a);if(!i?.add_content_to_doc_from_markdown)return{content:"Error: Failed to add content to document — no response from API."};const{success:n,block_ids:o,error:r}=i.add_content_to_doc_from_markdown;if(!n)return{content:`Error adding content to document: ${r||"Unknown error"}`};const s=o?.length??0;return{content:{message:`Successfully added content to document ${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 wu{constructor(){super(...arguments),this.name="update_doc",this.type=x.WRITE,this.annotations=_u({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_block: Remove any block. 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\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_block 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\nCOMMENTS:\n- add_comment: Create a new comment or reply on the document. Documents have a backing board with a single item where comments live. The tool automatically resolves the item ID from the doc\'s object_id (board ID). Use parent_update_id to reply to an existing comment. Format text with HTML, not markdown. Use mentions_list for @mentions.'}getInputSchema(){return BI}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=e.doc_id;if(!t){const a=await this.mondayApi.request(aI,{objectId:[e.object_id]}),i=a.docs?.[0];if(!i)return{content:`Error: No document found for object_id ${e.object_id}.`};t=i.id}const a=[];let i=null;for(let n=0;n<e.operations.length;n++){const o=e.operations[n];try{const i=await this.executeOperation(t,o,e.object_id);a.push(`- [OK] ${o.operation_type}${i?`: ${i}`:""}`)}catch(e){const t=e instanceof Error?e.message:"Unknown error";a.push(`- [FAILED] ${o.operation_type}: ${t}`),i=n;break}}const n=null!==i?i:e.operations.length,o=e.operations.length;return{content:`${`Completed ${n}/${o} operation${1===o?"":"s"} on doc ${t}.`}\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_block":return this.executeDeleteBlock(t.block_id);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);default:{const e=t.operation_type;throw new Error(`Unsupported operation type: "${e}"`)}}}async executeSetName(e,t){const a={docId:e,name:t},i=await this.mondayApi.request(eI,a);if(!i?.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 i={docId:e,markdown:t,afterBlockId:a},n=await this.mondayApi.request(tI,i),o=n?.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:uI(e.delta_format),alignment:e.alignment,direction:e.direction};case"code":return{deltaFormat:uI(e.delta_format),language:e.language};case"list_item":return{deltaFormat:uI(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),i={blockId:e,content:JSON.stringify(a)},n=await this.mondayApi.request(iI,i);if(!n?.update_doc_block)throw new Error("No response from update_doc_block");return`Block ${e} updated`}async executeCreateBlock(e,t,a,i){const n=function(e){switch(e.block_type){case"text":return{text_block:{delta_format:mI(e.delta_format),text_block_type:e.text_block_type?e.text_block_type:void 0,alignment:dI(e.alignment),direction:cI(e.direction)}};case"list_item":return{list_block:{delta_format:mI(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:mI(e.delta_format),text_block_type:Iy.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(i){const e=Object.keys(n);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=n[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=i}const o={docId:e,afterBlockId:a,blocksInput:[n]},r=await this.mondayApi.request(pI,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(nI,t);if(!a?.delete_doc_block)throw new Error("No response from delete_doc_block");return`Block ${e} deleted`}async resolveObjectId(e,t){if(t)return t;const a=await this.mondayApi.request(oI,{docId:[e]}),i=a.docs?.[0];if(!i?.object_id)throw new Error(`Could not resolve object_id for doc ${e}`);return i.object_id}async resolveDocItemId(e){const t=await this.mondayApi.request(rI,{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 executeAddComment(e,t,a,i,n){const o=await this.resolveObjectId(e,t),r=await this.resolveDocItemId(o);let s;if(n){const e=JSON.parse(n),t=ET.safeParse(e);if(!t.success)throw new Error(`Invalid mentions_list format: ${t.error.message}`);s=t.data}const p={itemId:r,body:a,parentId:i?.toString(),mentionsList:s},d=await this.mondayApi.request(sI,p);if(!d.create_update?.id)throw new Error("Failed to create comment: no update returned");return`${i?`Reply to update ${i}`:"Comment"} created (update ID: ${d.create_update.id})`}async executeReplaceBlock(e,t,a,i,n){await this.executeDeleteBlock(t);try{return`Block ${t} replaced. ${await this.executeCreateBlock(e,a,i,n)}`}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 wu{constructor(){super(...arguments),this.name="update_workspace",this.type=x.WRITE,this.annotations=_u({title:"Update Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing workspace in monday.com"}getInputSchema(){return YI}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(WI,t),i=await kE(this.mondayApi),n=i?OE(i,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:n}}}},class extends wu{constructor(){super(...arguments),this.name="update_folder",this.type=x.WRITE,this.annotations=_u({title:"Update Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing folder in monday.com"}getInputSchema(){return QI}async executeInternal(e){const{position_object_id:t,position_object_type:a,position_is_after:i}=e;if(!!t!=!!a)throw new Error("position_object_id and position_object_type must be provided together");const n={folderId:e.folderId,name:e.name,color:e.color,fontWeight:e.fontWeight,customIcon:e.customIcon,parentFolderId:e.parentFolderId,workspaceId:e.workspaceId,accountProductId:e.accountProductId,position:t?{position_is_after:i,position_object_id:t,position_object_type:a}:void 0},o=await this.mondayApi.request(KI,n);return{content:{message:`Folder ${o.update_folder?.id} updated`,folder_id:o.update_folder?.id,folder_name:o.update_folder?.name}}}},class extends wu{constructor(){super(...arguments),this.name="create_workspace",this.type=x.WRITE,this.annotations=_u({title:"Create Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new workspace in monday.com"}getInputSchema(){return XI}async executeInternal(e){const t={name:e.name,workspaceKind:e.workspaceKind,description:e.description,accountProductId:e.accountProductId},a=await this.mondayApi.request(JI,t),i=await kE(this.mondayApi),n=i&&a.create_workspace?.id?OE(i,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:n}}}},class extends wu{constructor(){super(...arguments),this.name="create_folder",this.type=x.WRITE,this.annotations=_u({title:"Create Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new folder in a monday.com workspace"}getInputSchema(){return eS}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(ZI,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 wu{constructor(){super(...arguments),this.name="move_object",this.type=x.WRITE,this.annotations=_u({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 iS}async executeUpdateFolder(e){const{id:t,position_object_id:a,position_object_type:i,position_is_after:n,parentFolderId:o,workspaceId:r,accountProductId:s}=e;if(!!a!=!!i)throw new Error("position_object_id and position_object_type must be provided together");const p={folderId:t,position:a?{position_is_after:n,position_object_id:a,position_object_type:i}:void 0,parentFolderId:o,workspaceId:r,accountProductId:s},d=await this.mondayApi.request(KI,p);return{content:{message:"Object moved",object_id:d.update_folder?.id}}}async executeUpdateBoardHierarchy(e){const{id:t,position_object_id:a,position_object_type:i,position_is_after:n,parentFolderId:o,workspaceId:r,accountProductId:s}=e;if(!!a!=!!i)throw new Error("position_object_id and position_object_type must be provided together");const p={boardId:t,attributes:{position:a?{position_is_after:n,position_object_id:a,position_object_type:i}:void 0,folder_id:o,workspace_id:r,account_product_id:s}},d=await this.mondayApi.request(tS,p);return d.update_board_hierarchy?.success?{content:{message:"Board position updated",object_id:d.update_board_hierarchy?.board?.id,action_name:"move_board"}}:{content:`Board position update failed: ${d.update_board_hierarchy?.message}`}}async executeUpdateOverviewHierarchy(e){const{id:t,position_object_id:a,position_object_type:i,position_is_after:n,parentFolderId:o,workspaceId:r,accountProductId:s}=e;if(!!a!=!!i)throw new Error("position_object_id and position_object_type must be provided together");const p={overviewId:t,attributes:{position:a?{position_is_after:n,position_object_id:a,position_object_type:i}:void 0,folder_id:o,workspace_id:r,account_product_id:s}},d=await this.mondayApi.request(aS,p);return d.update_overview_hierarchy?.success?{content:{message:"Overview position updated",object_id:d.update_overview_hierarchy?.overview?.id}}:{content:`Overview position update failed: ${d.update_overview_hierarchy?.message}`}}async executeInternal(e){const{objectType:t}=e;switch(t){case ty.Folder:return this.executeUpdateFolder(e);case ty.Board:return this.executeUpdateBoardHierarchy(e);case ty.Overview:return this.executeUpdateOverviewHierarchy(e);default:throw new Error(`Unsupported object type: ${t}`)}}},class extends wu{constructor(){super(...arguments),this.name="create_dashboard",this.type=x.WRITE,this.annotations=_u({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 GI}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(MI,t);if(!a.create_dashboard)throw new Error("Failed to create dashboard");const i=a.create_dashboard;return{content:{message:`Dashboard ${i.id} successfully created`,dashboard_id:i.id,dashboard_name:i.name}}}catch(e){const t=e instanceof Error?e.message:String(e);throw new Error(`Failed to create dashboard: ${t}`)}}},class extends wu{constructor(){super(...arguments),this.name="all_widgets_schema",this.type=x.READ,this.annotations=_u({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(qI,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 i=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,n=t?.description||t?.title||`${e.widget_type} widget for data visualization`;a[e.widget_type]={type:e.widget_type,description:n,schema:e.schema},i++}if(0===i)throw new Error("No valid widget schemas found in API response");Object.keys(a).map((e=>`• **${e}**: ${a[e].description}`)).join("\n");return{content:{message:"Widgets schema",data:a,url:iE}}}catch(e){const t=e instanceof Error?e.message:String(e);throw new Error(`Failed to fetch widget schemas: ${t}`)}}},class extends wu{constructor(){super(...arguments),this.name="create_widget",this.type=x.WRITE,this.annotations=_u({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 zI}async executeInternal(e){if(!e.settings)throw new Error("You must pass the settings parameter");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(HI,t);if(!a.create_widget)throw new Error("Failed to create widget");const i=a.create_widget;i.parent?.kind===Py.Dashboard?i.parent.id:i.parent;return{content:{message:`Widget ${i.id} created`,widget_id:i.id,widget_name:i.name,dashboard_id:i.parent?.id}}}catch(t){const a=t instanceof Error?t.message:String(t);throw new Error(`Failed to create ${e.widget_kind} widget: ${a}`)}}},class extends wu{constructor(){super(...arguments),this.name="board_insights",this.type=x.READ,this.annotations=_u({title:"Get Board Insights",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"This tool allows you to calculate insights about board's data by filtering, grouping and aggregating columns. For example, you can get the total number of items in a board, the number of items in each status, the number of items in each column, etc. Use this tool when you need to get a summary of the board's data, for example, you want to know the total number of items in a board, the number of items in each status, the number of items in each column, etc.[REQUIRED PRECONDITION]: Before using this tool, if new columns were added to the board or if you are not familiar with the board's structure (column IDs, column types, status labels, etc.), first use get_board_info to understand the board metadata. This is essential for constructing proper filters and knowing which columns are available.[IMPORTANT]: For some columns, human-friendly label is returned inside 'LABEL_<column_id' field. E.g. for column with id 'status_123' the label is returned inside 'LABEL_status_123' field."}getInputSchema(){return dS}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})))||[],i=new Set(e.aggregations.filter((e=>e.function===Db.Label)).map((e=>e.columnId))),n=e.groupBy?.filter((e=>!i.has(e))).map((e=>({function:Db.Label,columnId:e})))??[],o=e.aggregations.concat(n).map((e=>{if(e.function){const o=`${e.function}_${e.columnId}`,r=t[o]||0;t[o]=r+1;const s=`${o}_${r}`;return sS.has(e.function)&&(a.some((e=>e.column_id===s))||a.push({column_id:s})),{type:Ab.Function,function:(i=e.function,n=e.columnId,{function:i,params:i===Db.CountItems?[]:[{type:Ab.Column,column:pS(n),as:n}]}),as:s}}var i,n;const o={type:Ab.Column,column:pS(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:Ab.Column,column:pS(e.column_id),as:e.column_id})})),{selectElements:o,groupByElements:a}}(e),i=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),n=function(e){return{id:e.boardId.toString(),type:Nb.Table}}(e),o={query:{from:n,query:i,select:t,group_by:a,limit:e.limit},boardId:String(e.boardId)},r=await this.mondayApi.request(nS,o),s=(r.aggregate?.results??[]).map((e=>{const t={};return(e.entries??[]).forEach((e=>{const a=e.alias??"";if(!a)return;const i=e.value;if(!i)return void(t[a]=null);const n=i.result??i.value??null;t[a]=n})),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 wu{constructor(){super(...arguments),this.name="search",this.type=x.READ,this.annotations=_u({title:"Search",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Search within monday.com platform. Can search for boards, documents, forms, folders.\nFor users and teams, use list_users_and_teams tool.\nFor workspaces, use list_workspaces tool.\nFor items and groups, use get_board_items_page tool.\nFor groups, use get_board_info tool.\nIMPORTANT: ids returned by this tool are prefixed with the type of the object (e.g doc-123, board-456, folder-789). When passing the ids to other tools, you need to remove the prefix and just pass the number.\n "}getInputSchema(){return hS}async executeInternal(e){if(e.searchType!==ZT.FOLDERS&&e.searchTerm)try{return{content:{message:"Search results",data:(await this.searchWithDevEndpointAsync(e)).items}}}catch(e){gT(e)}const t={[ZT.BOARD]:this.searchBoardsAsync.bind(this),[ZT.DOCUMENTS]:this.searchDocsAsync.bind(this),[ZT.FOLDERS]:this.searchFoldersAsync.bind(this)}[e.searchType];if(!t)throw new Error(`Unsupported search type: ${e.searchType}`);const a=await t(e);return{content:{message:"Search results",disclaimer:a.wasFiltered||!e.searchTerm?void 0:"[IMPORTANT]Items were not filtered. Please perform the filtering.",data:a.items}}}async searchWithDevEndpointAsync(e){const t={[ZT.BOARD]:{entities:[{boards:{workspace_ids:e.workspaceIds?.map((e=>e.toString()))}}]},[ZT.DOCUMENTS]:{entities:[{docs:{workspace_ids:e.workspaceIds?.map((e=>e.toString()))}}]},[ZT.FOLDERS]:void 0}[e.searchType];if(!t)throw new Error(`Unsupported search type for dev endpoint: ${e.searchType}`);if(e.page>1)throw new Error("Pagination is not supported for search, increase the limit parameter instead");const a={query:e.searchTerm,limit:e.limit,filters:t},i=(await this.mondayApi.request(uS,a,{versionOverride:"dev",timeout:vT})).search||[],n=[];for(const e of i)"BoardSearchResult"===e.__typename?n.push({id:XT.BOARD+e.data.id,title:e.data.name,url:e.data.url}):"DocSearchResult"===e.__typename&&n.push({id:XT.DOCUMENT+e.data.id,title:e.data.name});return{items:n,wasFiltered:!0}}async searchFoldersAsync(e){const t={...this.getPagingParamsForSearch(e,100),workspace_ids:e.workspaceIds?.map((e=>e.toString()))};t.workspace_ids??=[],0===t.workspace_ids.length&&bT(new Error("Searching for folders require specifying workspace ids"),"search folders");const a=await this.mondayApi.request(mS,t),i=this.searchAndVirtuallyPaginate(e,a.folders||[],(e=>e.name));return{items:i.items.map((e=>({id:XT.FOLDER+e.id,title:e.name}))),wasFiltered:i.wasFiltered}}async searchDocsAsync(e){const t={...this.getPagingParamsForSearch(e),workspace_ids:e.workspaceIds?.map((e=>e.toString()))},a=await this.mondayApi.request(lS,t),i=this.searchAndVirtuallyPaginate(e,a.docs||[],(e=>e.name));return{items:i.items.map((e=>({id:XT.DOCUMENT+e.id,title:e.name,url:e.url||void 0}))),wasFiltered:i.wasFiltered}}async searchBoardsAsync(e){const t={...this.getPagingParamsForSearch(e),workspace_ids:e.workspaceIds?.map((e=>e.toString()))},a=await this.mondayApi.request(cS,t),i=this.searchAndVirtuallyPaginate(e,a.boards||[],(e=>e.name));return{items:i.items.map((e=>({id:XT.BOARD+e.id,title:e.name,url:e.url}))),wasFiltered:i.wasFiltered}}getPagingParamsForSearch(e,t=1e3){return{page:e.searchTerm?1:e.page,limit:e.searchTerm?Math.min(1e3,t):e.limit}}searchAndVirtuallyPaginate(e,t,a){if(t.length<=fS)return{items:t,wasFiltered:!1};const i=UE(e.searchTerm??""),n=(e.page-1)*e.limit,o=n+e.limit;return{items:t.filter((e=>UE(a(e)).includes(i))).slice(n,o),wasFiltered:!0}}},class extends wu{constructor(){super(...arguments),this.name="get_user_context",this.type=x.READ,this.annotations=_u({title:"Get User Context",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Fetch current user information and their relevant items (boards, folders, workspaces, dashboards).\n \n Use this tool at the beginning of conversations to:\n - Get context about who the current user is (id, name, title)\n - Discover user's favorite boards, folders, workspaces, and dashboards\n - Get user's most relevant boards based on visit frequency and recency\n - Get user's most relevant people based on interaction frequency and recency\n - Reduce the need for search requests by knowing user's commonly accessed items\n "}getInputSchema(){}async executeInternal(){const{me:e,favorites:t,intelligence:a}=await this.mondayApi.request(xS,{},{versionOverride:"dev"});if(!e)return{content:"AUTHENTICATION_ERROR: Unable to fetch current user. Verify API token and user permissions."};return{content:{message:"User context",...{user:e,favorites:await this.fetchFavorites(t||[]),relevantBoards:this.extractRelevantBoards(a),relevantPeople:this.extractRelevantPeople(a)}}}}async fetchFavorites(e){const t=this.groupByType(e),a=Object.keys(t);if(0===a.length)return[];const i={};for(const e of a)i[ES[e]]=t[e];const n=await this.mondayApi.request(TS,i),o=[];for(const e of a){const t=IS[e];for(const a of n[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}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 wu{constructor(){super(...arguments),this.name="update_assets_on_item",this.type=x.WRITE,this.annotations=_u({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 wS}async executeInternal(e){const t={boardId:e.boardId,itemId:e.itemId,columnId:e.columnId,files:e.files},a=await this.mondayApi.request(yS,t);return{content:`Item ${a.update_assets_on_item?.id} (${a.update_assets_on_item?.name}) assets successfully updated`}}},class extends wu{constructor(){super(...arguments),this.name="get_notetaker_meetings",this.type=x.READ,this.annotations=_u({title:"Get Notetaker Meetings",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Retrieve notetaker meetings with optional detailed fields. Use include_summary, include_topics, include_action_items, and include_transcript flags to control which details are returned. Use access to filter by meeting access level (OWN, SHARED_WITH_ME, SHARED_WITH_ACCOUNT, ALL). Defaults to OWN. Supports filtering by ids, search term, and cursor-based pagination."}getInputSchema(){return NS}async executeInternal(e){const t={access:e.access};e.ids&&e.ids.length>0&&(t.ids=e.ids),e.search&&(t.search=e.search);const a={limit:e.limit,cursor:e.cursor||void 0,filters:t,includeSummary:e.include_summary,includeTopics:e.include_topics,includeActionItems:e.include_action_items,includeTranscript:e.include_transcript},i=await this.mondayApi.request(SS,a,{versionOverride:"2026-04"}),n=i.notetaker?.meetings;if(!n?.meetings||0===n.meetings.length)return{content:"No notetaker meetings found matching the specified criteria."};return{content:{message:"Meetings retrieved",data:{meetings:n.meetings,pagination:{has_next_page:n.page_info?.has_next_page??!1,cursor:n.page_info?.cursor??null,count:n.meetings.length}}}}}},class extends wu{constructor(){super(...arguments),this.name="create_view",this.type=x.WRITE,this.annotations=_u({title:"Create View",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Create a new board view (tab) with optional filters and sorting. This creates a saved view on a monday.com board that users can switch to.\n\nFilter operators: any_of, not_any_of, is_empty, is_not_empty, greater_than, lower_than, between, contains_text, not_contains_text\n\nExample filter for people column: { "rules": [{ "column_id": "people", "compare_value": ["person-12345"], "operator": "any_of" }] }\nExample filter for status column: { "rules": [{ "column_id": "status", "compare_value": [1], "operator": "any_of" }] }'}getInputSchema(){return $w}async executeInternal(e){const t={boardId:e.boardId,type:e.type,name:e.name,filter:e.filter,sort:e.sort},a=await this.mondayApi.request(Cw,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 wu{constructor(){super(...arguments),this.name="undo_action",this.type=x.WRITE,this.annotations=_u({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 DS}async executeInternal(e){return await this.mondayApi.request(AS,{boardId:e.boardId.toString(),undoRecordId:e.undoRecordId},{versionOverride:"dev"}),{content:`Successfully undid action "${e.undoRecordId}" on board ${e.boardId}.`}}}];var pN;!function(e){e.API="api",e.APPS="apps",e.ATP="atp"}(pN||(pN={}));const dN=(e,t)=>{let a=[];t?.mode===pN.APPS?a=[...yu]:t?.mode!==pN.API&&t?.mode||(a=[...sN,...rN]);const i=a.map((t=>((e,t)=>e.prototype instanceof wu?new e(t.apiClient,t.apiToken,t.context):e.prototype instanceof Jm?new e(t.apiToken):new e)(t,e)));return i.filter((e=>{if(!t)return e.type!==x.ALL_API;if(t.mode===pN.API&&"only"===t.enableDynamicApiTools)return e.type===x.ALL_API;let a=!1;return t.mode===pN.API&&!1===t.enableDynamicApiTools&&(a=a||e.type===x.ALL_API),t.readOnlyMode&&(a=a||e.type!==x.READ),t.include?a=a||!t.include?.includes(e.name):t.exclude&&(a=a||t.exclude?.includes(e.name)),!a}))},cN=e=>"object"==typeof e?JSON.stringify(e):e;class lN{constructor(t){this.mondayApi=new e({token:t.mondayApiToken,apiVersion:t.mondayApiVersion??Km,endpoint:t.mondayApiEndpoint,requestConfig:t.mondayApiRequestConfig}),this.mondayApiToken=t.mondayApiToken,this.context={...t.context,apiVersion:t.mondayApiVersion??Km},this.tools=this.initializeTools(t)}initializeTools(e){const t={apiClient:this.mondayApi,apiToken:this.mondayApiToken,context:this.context};return dN(t,e.toolsConfiguration)}getTools(){return this.tools.map((e=>{const t=e.getInputSchema();return{type:"function",function:{name:e.name,description:e.getDescription(),parameters:t?w(y.object(t)):void 0}}}))}async handleToolCall(e){const{name:t,arguments:a}=e.function,i=JSON.parse(a),n=this.tools.find((e=>e.name===t));if(!n)throw new Error(`Unknown tool: ${t}`);const o=n.getInputSchema();if(o){const t=y.object(o).safeParse(i);if(!t.success)throw new Error(`Invalid arguments: ${t.error.message}`);const a=await n.execute(t.data);return{role:"tool",tool_call_id:e.id,content:cN(a.content)}}{const t=await n.execute();return{role:"tool",tool_call_id:e.id,content:cN(t.content)}}}}export{lN as MondayAgentToolkit};
2051
+ `),i=await this.mondayApi.request(a);return i.__type?{content:{message:"Type details retrieved",data:{name:i.__type.name,kind:i.__type.kind,description:i.__type.description??null,fields:i.__type.fields??[],inputFields:i.__type.inputFields??[],interfaces:i.__type.interfaces??[],enumValues:i.__type.enumValues??[],possibleTypes:i.__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 wu{constructor(){super(...arguments),this.name="create_custom_activity",this.type=x.WRITE,this.annotations=_u({title:"Create Custom Activity",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new custom activity in the E&A app"}getInputSchema(){return oT}async executeInternal(e){const t={color:e.color,icon_id:e.icon_id,name:e.name};return await this.mondayApi.request(xw,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 wu{constructor(){super(...arguments),this.name="create_notification",this.type=x.WRITE,this.annotations=_u({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 sT}async executeInternal(e){const t={user_id:e.user_id,target_id:e.target_id,text:e.text,target_type:e.target_type};try{await this.mondayApi.request(rT,t);return{content:{message:"Notification sent",user_id:e.user_id,text:e.text}}}catch(t){return{content:`Failed to send notification to user ${e.user_id}`}}}},class extends wu{constructor(){super(...arguments),this.name="create_timeline_item",this.type=x.WRITE,this.annotations=_u({title:"Create Timeline Item",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new timeline item in the E&A app"}getInputSchema(){return wT}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(Tw,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 wu{constructor(){super(...arguments),this.name="fetch_custom_activity",this.type=x.READ,this.annotations=_u({title:"Fetch Custom Activities",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Get custom activities from the E&A app"}getInputSchema(){return $T}async executeInternal(e){const t=await this.mondayApi.request(Ew);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 wu{constructor(){super(...arguments),this.name="read_docs",this.type=x.READ,this.annotations=_u({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- Set include_comments: true to fetch all comments and replies on the document. 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 $E}async executeInternal(e){return"version_history"===e.mode?this.executeVersionHistory(e):this.executeContent(e)}async executeContent(e){try{if(!e.type||!e.ids||0===e.ids.length)return{content:'Error: type and ids are required when mode is "content".'};let t,a,i;switch(e.type){case"ids":t=e.ids;break;case"object_ids":a=e.ids;break;case"workspace_ids":i=e.ids}const n=e.include_blocks??!1,o={ids:t,object_ids:a,limit:e.limit||25,order_by:e.order_by,page:e.page,workspace_ids:i,includeBlocks:n};let r=await this.mondayApi.request(pw,o);if((!r.docs||0===r.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:i,includeBlocks:n};r=await this.mondayApi.request(pw,a)}if(!r.docs||0===r.docs.length){return{content:`No documents found matching the specified criteria${e.page?` (page ${e.page})`:""}.`}}const s=e.include_comments??!1,p=e.comments_limit??50;return this.enrichDocsWithMarkdown(r.docs,o,n,s,p)}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:i,version_history_limit:n}=e,o=e.ids?.[0];if(!o)return{content:'Error: ids is required when mode is "version_history". Provide the document object_id.'};try{const e={docId:o,since:a,until:i},r=await this.mondayApi.request(dw,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 n&&(s=s.slice(0,n)),{content:{doc_id:o,since:a,until:i,restoring_points:s}};const p=Math.min(n??10,10),d=s.slice(0,p+1),c=s.length>p,l=(await Promise.allSettled(d.map((async(e,t)=>{if(t===d.length-1||!e.date)return e;const a=d[t+1];if(!a?.date)return e;const i={docId:o,date:e.date,prevDate:a.date},n=await this.mondayApi.request(lw,i);return{...e,diff:n?.doc_version_diff?.blocks??[]}}))).then((e=>e.map(((e,t)=>"fulfilled"===e.status?e.value:d[t]))))).slice(0,p);return{content:{doc_id:o,since:a,until:i,restoring_points:l,...c&&{truncated:!0,total_count:s.length}}}}catch(e){return{content:`Error fetching version history for document ${o}: ${e instanceof Error?e.message:"Unknown error"}`}}}async fetchDocComments(e,t){try{const a={boardId:e,itemsLimit:100,updatesLimit:t},i=await this.mondayApi.request(cw,a),n=i.boards?.[0]?.items_page?.items;if(!n)return[];const o=[];for(const e of n)if(e.updates&&0!==e.updates.length)for(const t of e.updates)o.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,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 o}catch(e){return`Error fetching comments: ${e instanceof Error?e.message:"Unknown error"}`}}async enrichDocsWithMarkdown(e,t,a,i=!1,n=50){const o=await Promise.all(e.filter((e=>null!==e)).map((async e=>{let t,o="";try{const t={docId:e.id},a=await this.mondayApi.request(Iw,t);o=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){o=`Error getting markdown: ${e instanceof Error?e.message:"Unknown error"}`}return i&&e.object_id&&(t=await this.fetchDocComments(e.object_id,n)),{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})))},blocks_as_markdown:o,...i&&{comments:t}}}))),r=t.page||1,s=t.limit||25,p=o.length,d=p===s;return{content:{message:`Documents retrieved (${o.length})`,pagination:{current_page:r,limit:s,count:p,has_more_pages:d},data:o}}}},class extends wu{constructor(){super(...arguments),this.name="workspace_info",this.type=x.READ,this.annotations=_u({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 LE}async executeInternal(e){const t={workspace_id:e.workspace_id},a=await this.mondayApi.request(Sw,t);if(!a.workspaces||0===a.workspaces.length)return{content:`No workspace found with ID ${e.workspace_id}`};const i=function(e,t){const{workspaces:a,boards:i,docs:n,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:[]}]))),p=[];(i||[]).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):p.push(t)}));const d=[];return(n||[]).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):d.push(t)})),{workspace:{id:r.id,name:r.name,url:t?kE(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:p,docs:d}}}(a,await DE(this.mondayApi));return{content:{message:"Workspace info retrieved",data:i}}}},class extends wu{constructor(){super(...arguments),this.name="list_workspaces",this.type=x.READ,this.annotations=_u({title:"List Workspaces",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"List all workspaces available to the user. Returns up to 500 workspaces with their ID, name, and description."}getInputSchema(){return BE}async executeInternal(e){const t=e.searchTerm?1e4:e.limit,a=e.searchTerm?1:e.page;let i=null;if(e.searchTerm&&(i=jE(e.searchTerm),0===i.length))throw new Error("Search term did not include any alphanumeric characters. Please provide a valid search term.");const n=e=>({limit:t,page:a,membershipKind:e}),o=UE(await this.mondayApi.request(FE,n(Uy.Member))),r=!VE(o)||i&&!function(e,t){return t.some((t=>jE(t.name).includes(e)))}(i,o);let s=o;if(r){s=UE(await this.mondayApi.request(FE,n(Uy.All)))}if(!VE(s))return{content:{message:"No workspaces found.",data:[]}};const p=i&&s?.length<=PE,d=function(e,t,a,i){if(!e||t.length<=PE)return t;const n=(a-1)*i,o=n+i;return t.filter((t=>jE(t.name).includes(e))).slice(n,o)}(i,s,e.page,e.limit);if(!VE(d))return{content:{message:"No workspaces found matching the search term. Try using the tool without a search term",data:[]}};const c=d.length===e.limit,l=await DE(this.mondayApi),m=d.map((e=>({id:e.id,name:e.name,description:e.description||void 0,url:l&&e.id?kE(l,e.id):void 0})));return{content:{message:"Workspaces retrieved",...p?{disclaimer:"Search term not applied - returning all workspaces. Perform the filtering manually."}:{},...c?{next_page:e.page+1}:{},data:m}}}},class extends wu{constructor(){super(...arguments),this.name="create_doc",this.type=x.WRITE,this.annotations=_u({title:"Create Document",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Create a new monday.com doc either inside a workspace or attached to an item (via a doc column). After creation, the provided markdown will be appended to the document.\n\nLOCATION TYPES:\n- workspace: Creates a document in a workspace (requires workspace_id, optional doc_kind, optional folder_id)\n- item: Creates a document attached to an item (requires item_id, optional column_id)\n\nUSAGE EXAMPLES:\n- Workspace doc: { location: "workspace", workspace_id: 123, doc_kind: "private" , markdown: "..." }\n- Workspace doc in folder: { location: "workspace", workspace_id: 123, folder_id: 17264196 , markdown: "..." }\n- Item doc: { location: "item", item_id: 456, column_id: "doc_col_1" , markdown: "..." }'}getInputSchema(){return YE}async executeInternal(e){const t=WE.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,i,n;if(a.type===zE.enum.workspace){const o={location:{workspace:{workspace_id:a.workspace_id.toString(),name:e.doc_name,kind:a.doc_kind||Gb.Public,folder_id:a.folder_id?.toString()}}},r=await this.mondayApi.request(qE,o);t=r?.create_doc?.id??void 0,i=r?.create_doc?.object_id??void 0,n=r?.create_doc?.url??void 0}else if(a.type===zE.enum.item){const o={itemId:a.item_id.toString()},r=await this.mondayApi.request(ME,o),s=r.items?.[0];if(!s)return{content:`Error: Item with id ${a.item_id} not found.`};const p=s.board?.id,d=s.board?.columns?.find((e=>e&&e.type===aT.Doc));let c=a.column_id;if(!c)if(d)c=d.id;else{const e={boardId:p.toString(),columnType:aT.Doc,columnTitle:"Doc"},t=await this.mondayApi.request(gw,e);if(c=t?.create_column?.id,!c)return{content:"Error: Failed to create doc column."}}const l={location:{board:{item_id:a.item_id.toString(),column_id:c}}},m=await this.mondayApi.request(qE,l);if(t=m.create_doc?.id??void 0,i=m.create_doc?.object_id??void 0,n=m.create_doc?.url??void 0,e.doc_name&&t)try{const a={docId:t,name:e.doc_name};await this.mondayApi.request(GE,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(HE,o),s=r?.add_content_to_doc_from_markdown?.success,p=r?.add_content_to_doc_from_markdown?.error;return s?{content:{message:"Document successfully created",doc_id:t,object_id:i,doc_url:n,doc_name:e.doc_name}}:{content:`Document ${t} created, but failed to add markdown content: ${p||"Unknown error"}`}}catch(e){return{content:`Error creating document: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends wu{constructor(){super(...arguments),this.name="add_content_to_doc",this.type=x.WRITE,this.annotations=_u({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 XE}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(JE,{docId:[e.doc_id]});t=a.docs?.[0]??null}else{const a=await this.mondayApi.request(QE,{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}`}.`}}const a={docId:t.id,markdown:e.markdown,afterBlockId:e.after_block_id},i=await this.mondayApi.request(KE,a);if(!i?.add_content_to_doc_from_markdown)return{content:"Error: Failed to add content to document — no response from API."};const{success:n,block_ids:o,error:r}=i.add_content_to_doc_from_markdown;if(!n)return{content:`Error adding content to document: ${r||"Unknown error"}`};const s=o?.length??0;return{content:{message:`Successfully added content to document ${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 wu{constructor(){super(...arguments),this.name="update_doc",this.type=x.WRITE,this.annotations=_u({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_block: Remove any block. 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\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_block 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\nCOMMENTS:\n- add_comment: Create a new comment or reply on the document. Documents have a backing board with a single item where comments live. The tool automatically resolves the item ID from the doc\'s object_id (board ID). Use parent_update_id to reply to an existing comment. Format text with HTML, not markdown. Use mentions_list for @mentions.'}getInputSchema(){return VI}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=e.doc_id;if(!t){const a=await this.mondayApi.request(tI,{objectId:[e.object_id]}),i=a.docs?.[0];if(!i)return{content:`Error: No document found for object_id ${e.object_id}.`};t=i.id}const a=[];let i=null;for(let n=0;n<e.operations.length;n++){const o=e.operations[n];try{const i=await this.executeOperation(t,o,e.object_id);a.push(`- [OK] ${o.operation_type}${i?`: ${i}`:""}`)}catch(e){const t=e instanceof Error?e.message:"Unknown error";a.push(`- [FAILED] ${o.operation_type}: ${t}`),i=n;break}}const n=null!==i?i:e.operations.length,o=e.operations.length;return{content:`${`Completed ${n}/${o} operation${1===o?"":"s"} on doc ${t}.`}\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_block":return this.executeDeleteBlock(t.block_id);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);default:{const e=t.operation_type;throw new Error(`Unsupported operation type: "${e}"`)}}}async executeSetName(e,t){const a={docId:e,name:t},i=await this.mondayApi.request(ZE,a);if(!i?.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 i={docId:e,markdown:t,afterBlockId:a},n=await this.mondayApi.request(eI,i),o=n?.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:mI(e.delta_format),alignment:e.alignment,direction:e.direction};case"code":return{deltaFormat:mI(e.delta_format),language:e.language};case"list_item":return{deltaFormat:mI(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),i={blockId:e,content:JSON.stringify(a)},n=await this.mondayApi.request(aI,i);if(!n?.update_doc_block)throw new Error("No response from update_doc_block");return`Block ${e} updated`}async executeCreateBlock(e,t,a,i){const n=function(e){switch(e.block_type){case"text":return{text_block:{delta_format:lI(e.delta_format),text_block_type:e.text_block_type?e.text_block_type:void 0,alignment:pI(e.alignment),direction:dI(e.direction)}};case"list_item":return{list_block:{delta_format:lI(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:lI(e.delta_format),text_block_type:Iy.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(i){const e=Object.keys(n);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=n[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=i}const o={docId:e,afterBlockId:a,blocksInput:[n]},r=await this.mondayApi.request(sI,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(iI,t);if(!a?.delete_doc_block)throw new Error("No response from delete_doc_block");return`Block ${e} deleted`}async resolveObjectId(e,t){if(t)return t;const a=await this.mondayApi.request(nI,{docId:[e]}),i=a.docs?.[0];if(!i?.object_id)throw new Error(`Could not resolve object_id for doc ${e}`);return i.object_id}async resolveDocItemId(e){const t=await this.mondayApi.request(oI,{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 executeAddComment(e,t,a,i,n){const o=await this.resolveObjectId(e,t),r=await this.resolveDocItemId(o);let s;if(n){const e=JSON.parse(n),t=ET.safeParse(e);if(!t.success)throw new Error(`Invalid mentions_list format: ${t.error.message}`);s=t.data}const p={itemId:r,body:a,parentId:i?.toString(),mentionsList:s},d=await this.mondayApi.request(rI,p);if(!d.create_update?.id)throw new Error("Failed to create comment: no update returned");return`${i?`Reply to update ${i}`:"Comment"} created (update ID: ${d.create_update.id})`}async executeReplaceBlock(e,t,a,i,n){await this.executeDeleteBlock(t);try{return`Block ${t} replaced. ${await this.executeCreateBlock(e,a,i,n)}`}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 wu{constructor(){super(...arguments),this.name="update_workspace",this.type=x.WRITE,this.annotations=_u({title:"Update Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing workspace in monday.com"}getInputSchema(){return WI}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(zI,t),i=await DE(this.mondayApi),n=i?kE(i,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:n}}}},class extends wu{constructor(){super(...arguments),this.name="update_folder",this.type=x.WRITE,this.annotations=_u({title:"Update Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Update an existing folder in monday.com"}getInputSchema(){return KI}async executeInternal(e){const{position_object_id:t,position_object_type:a,position_is_after:i}=e;if(!!t!=!!a)throw new Error("position_object_id and position_object_type must be provided together");const n={folderId:e.folderId,name:e.name,color:e.color,fontWeight:e.fontWeight,customIcon:e.customIcon,parentFolderId:e.parentFolderId,workspaceId:e.workspaceId,accountProductId:e.accountProductId,position:t?{position_is_after:i,position_object_id:t,position_object_type:a}:void 0},o=await this.mondayApi.request(YI,n);return{content:{message:`Folder ${o.update_folder?.id} updated`,folder_id:o.update_folder?.id,folder_name:o.update_folder?.name}}}},class extends wu{constructor(){super(...arguments),this.name="create_workspace",this.type=x.WRITE,this.annotations=_u({title:"Create Workspace",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new workspace in monday.com"}getInputSchema(){return JI}async executeInternal(e){const t={name:e.name,workspaceKind:e.workspaceKind,description:e.description,accountProductId:e.accountProductId},a=await this.mondayApi.request(QI,t),i=await DE(this.mondayApi),n=i&&a.create_workspace?.id?kE(i,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:n}}}},class extends wu{constructor(){super(...arguments),this.name="create_folder",this.type=x.WRITE,this.annotations=_u({title:"Create Folder",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return"Create a new folder in a monday.com workspace"}getInputSchema(){return ZI}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(XI,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 wu{constructor(){super(...arguments),this.name="move_object",this.type=x.WRITE,this.annotations=_u({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 aS}async executeUpdateFolder(e){const{id:t,position_object_id:a,position_object_type:i,position_is_after:n,parentFolderId:o,workspaceId:r,accountProductId:s}=e;if(!!a!=!!i)throw new Error("position_object_id and position_object_type must be provided together");const p={folderId:t,position:a?{position_is_after:n,position_object_id:a,position_object_type:i}:void 0,parentFolderId:o,workspaceId:r,accountProductId:s},d=await this.mondayApi.request(YI,p);return{content:{message:"Object moved",object_id:d.update_folder?.id}}}async executeUpdateBoardHierarchy(e){const{id:t,position_object_id:a,position_object_type:i,position_is_after:n,parentFolderId:o,workspaceId:r,accountProductId:s}=e;if(!!a!=!!i)throw new Error("position_object_id and position_object_type must be provided together");const p={boardId:t,attributes:{position:a?{position_is_after:n,position_object_id:a,position_object_type:i}:void 0,folder_id:o,workspace_id:r,account_product_id:s}},d=await this.mondayApi.request(eS,p);return d.update_board_hierarchy?.success?{content:{message:"Board position updated",object_id:d.update_board_hierarchy?.board?.id,action_name:"move_board"}}:{content:`Board position update failed: ${d.update_board_hierarchy?.message}`}}async executeUpdateOverviewHierarchy(e){const{id:t,position_object_id:a,position_object_type:i,position_is_after:n,parentFolderId:o,workspaceId:r,accountProductId:s}=e;if(!!a!=!!i)throw new Error("position_object_id and position_object_type must be provided together");const p={overviewId:t,attributes:{position:a?{position_is_after:n,position_object_id:a,position_object_type:i}:void 0,folder_id:o,workspace_id:r,account_product_id:s}},d=await this.mondayApi.request(tS,p);return d.update_overview_hierarchy?.success?{content:{message:"Overview position updated",object_id:d.update_overview_hierarchy?.overview?.id}}:{content:`Overview position update failed: ${d.update_overview_hierarchy?.message}`}}async executeInternal(e){const{objectType:t}=e;switch(t){case ty.Folder:return this.executeUpdateFolder(e);case ty.Board:return this.executeUpdateBoardHierarchy(e);case ty.Overview:return this.executeUpdateOverviewHierarchy(e);default:throw new Error(`Unsupported object type: ${t}`)}}},class extends wu{constructor(){super(...arguments),this.name="create_dashboard",this.type=x.WRITE,this.annotations=_u({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 HI}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(BI,t);if(!a.create_dashboard)throw new Error("Failed to create dashboard");const i=a.create_dashboard;return{content:{message:`Dashboard ${i.id} successfully created`,dashboard_id:i.id,dashboard_name:i.name}}}catch(e){const t=e instanceof Error?e.message:String(e);throw new Error(`Failed to create dashboard: ${t}`)}}},class extends wu{constructor(){super(...arguments),this.name="all_widgets_schema",this.type=x.READ,this.annotations=_u({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(MI,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 i=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,n=t?.description||t?.title||`${e.widget_type} widget for data visualization`;a[e.widget_type]={type:e.widget_type,description:n,schema:e.schema},i++}if(0===i)throw new Error("No valid widget schemas found in API response");Object.keys(a).map((e=>`• **${e}**: ${a[e].description}`)).join("\n");return{content:{message:"Widgets schema",data:a,url:iE}}}catch(e){const t=e instanceof Error?e.message:String(e);throw new Error(`Failed to fetch widget schemas: ${t}`)}}},class extends wu{constructor(){super(...arguments),this.name="create_widget",this.type=x.WRITE,this.annotations=_u({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 GI}async executeInternal(e){if(!e.settings)throw new Error("You must pass the settings parameter");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(qI,t);if(!a.create_widget)throw new Error("Failed to create widget");const i=a.create_widget;i.parent?.kind===Py.Dashboard?i.parent.id:i.parent;return{content:{message:`Widget ${i.id} created`,widget_id:i.id,widget_name:i.name,dashboard_id:i.parent?.id}}}catch(t){const a=t instanceof Error?t.message:String(t);throw new Error(`Failed to create ${e.widget_kind} widget: ${a}`)}}},class extends wu{constructor(){super(...arguments),this.name="board_insights",this.type=x.READ,this.annotations=_u({title:"Get Board Insights",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"This tool allows you to calculate insights about board's data by filtering, grouping and aggregating columns. For example, you can get the total number of items in a board, the number of items in each status, the number of items in each column, etc. Use this tool when you need to get a summary of the board's data, for example, you want to know the total number of items in a board, the number of items in each status, the number of items in each column, etc.[REQUIRED PRECONDITION]: Before using this tool, if new columns were added to the board or if you are not familiar with the board's structure (column IDs, column types, status labels, etc.), first use get_board_info to understand the board metadata. This is essential for constructing proper filters and knowing which columns are available.[IMPORTANT]: For some columns, human-friendly label is returned inside 'LABEL_<column_id' field. E.g. for column with id 'status_123' the label is returned inside 'LABEL_status_123' field."}getInputSchema(){return pS}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})))||[],i=new Set(e.aggregations.filter((e=>e.function===Db.Label)).map((e=>e.columnId))),n=e.groupBy?.filter((e=>!i.has(e))).map((e=>({function:Db.Label,columnId:e})))??[],o=e.aggregations.concat(n).map((e=>{if(e.function){const o=`${e.function}_${e.columnId}`,r=t[o]||0;t[o]=r+1;const s=`${o}_${r}`;return rS.has(e.function)&&(a.some((e=>e.column_id===s))||a.push({column_id:s})),{type:Ab.Function,function:(i=e.function,n=e.columnId,{function:i,params:i===Db.CountItems?[]:[{type:Ab.Column,column:sS(n),as:n}]}),as:s}}var i,n;const o={type:Ab.Column,column:sS(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:Ab.Column,column:sS(e.column_id),as:e.column_id})})),{selectElements:o,groupByElements:a}}(e),i=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),n=function(e){return{id:e.boardId.toString(),type:Nb.Table}}(e),o={query:{from:n,query:i,select:t,group_by:a,limit:e.limit},boardId:String(e.boardId)},r=await this.mondayApi.request(iS,o),s=(r.aggregate?.results??[]).map((e=>{const t={};return(e.entries??[]).forEach((e=>{const a=e.alias??"";if(!a)return;const i=e.value;if(!i)return void(t[a]=null);const n=i.result??i.value??null;t[a]=n})),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 wu{constructor(){super(...arguments),this.name="search",this.type=x.READ,this.annotations=_u({title:"Search",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Search within monday.com platform. Can search for boards, documents, forms, folders.\nFor users and teams, use list_users_and_teams tool.\nFor workspaces, use list_workspaces tool.\nFor items and groups, use get_board_items_page tool.\nFor groups, use get_board_info tool.\nIMPORTANT: ids returned by this tool are prefixed with the type of the object (e.g doc-123, board-456, folder-789). When passing the ids to other tools, you need to remove the prefix and just pass the number.\n "}getInputSchema(){return fS}async executeInternal(e){if(e.searchType!==ZT.FOLDERS&&e.searchTerm)try{return{content:{message:"Search results",data:(await this.searchWithDevEndpointAsync(e)).items}}}catch(e){gT(e)}const t={[ZT.BOARD]:this.searchBoardsAsync.bind(this),[ZT.DOCUMENTS]:this.searchDocsAsync.bind(this),[ZT.FOLDERS]:this.searchFoldersAsync.bind(this)}[e.searchType];if(!t)throw new Error(`Unsupported search type: ${e.searchType}`);const a=await t(e);return{content:{message:"Search results",disclaimer:a.wasFiltered||!e.searchTerm?void 0:"[IMPORTANT]Items were not filtered. Please perform the filtering.",data:a.items}}}async searchWithDevEndpointAsync(e){const t={[ZT.BOARD]:{entities:[{boards:{workspace_ids:e.workspaceIds?.map((e=>e.toString()))}}]},[ZT.DOCUMENTS]:{entities:[{docs:{workspace_ids:e.workspaceIds?.map((e=>e.toString()))}}]},[ZT.FOLDERS]:void 0}[e.searchType];if(!t)throw new Error(`Unsupported search type for dev endpoint: ${e.searchType}`);if(e.page>1)throw new Error("Pagination is not supported for search, increase the limit parameter instead");const a={query:e.searchTerm,limit:e.limit,filters:t},i=(await this.mondayApi.request(mS,a,{versionOverride:"dev",timeout:vT})).search||[],n=[];for(const e of i)"BoardSearchResult"===e.__typename?n.push({id:XT.BOARD+e.data.id,title:e.data.name,url:e.data.url}):"DocSearchResult"===e.__typename&&n.push({id:XT.DOCUMENT+e.data.id,title:e.data.name});return{items:n,wasFiltered:!0}}async searchFoldersAsync(e){const t={...this.getPagingParamsForSearch(e,100),workspace_ids:e.workspaceIds?.map((e=>e.toString()))};t.workspace_ids??=[],0===t.workspace_ids.length&&bT(new Error("Searching for folders require specifying workspace ids"),"search folders");const a=await this.mondayApi.request(lS,t),i=this.searchAndVirtuallyPaginate(e,a.folders||[],(e=>e.name));return{items:i.items.map((e=>({id:XT.FOLDER+e.id,title:e.name}))),wasFiltered:i.wasFiltered}}async searchDocsAsync(e){const t={...this.getPagingParamsForSearch(e),workspace_ids:e.workspaceIds?.map((e=>e.toString()))},a=await this.mondayApi.request(cS,t),i=this.searchAndVirtuallyPaginate(e,a.docs||[],(e=>e.name));return{items:i.items.map((e=>({id:XT.DOCUMENT+e.id,title:e.name,url:e.url||void 0}))),wasFiltered:i.wasFiltered}}async searchBoardsAsync(e){const t={...this.getPagingParamsForSearch(e),workspace_ids:e.workspaceIds?.map((e=>e.toString()))},a=await this.mondayApi.request(dS,t),i=this.searchAndVirtuallyPaginate(e,a.boards||[],(e=>e.name));return{items:i.items.map((e=>({id:XT.BOARD+e.id,title:e.name,url:e.url}))),wasFiltered:i.wasFiltered}}getPagingParamsForSearch(e,t=1e3){return{page:e.searchTerm?1:e.page,limit:e.searchTerm?Math.min(1e3,t):e.limit}}searchAndVirtuallyPaginate(e,t,a){if(t.length<=uS)return{items:t,wasFiltered:!1};const i=jE(e.searchTerm??""),n=(e.page-1)*e.limit,o=n+e.limit;return{items:t.filter((e=>jE(a(e)).includes(i))).slice(n,o),wasFiltered:!0}}},class extends wu{constructor(){super(...arguments),this.name="get_user_context",this.type=x.READ,this.annotations=_u({title:"Get User Context",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Fetch current user information and their relevant items (boards, folders, workspaces, dashboards).\n \n Use this tool at the beginning of conversations to:\n - Get context about who the current user is (id, name, title)\n - Discover user's favorite boards, folders, workspaces, and dashboards\n - Get user's most relevant boards based on visit frequency and recency\n - Get user's most relevant people based on interaction frequency and recency\n - Reduce the need for search requests by knowing user's commonly accessed items\n "}getInputSchema(){}async executeInternal(){const{me:e,favorites:t,intelligence:a}=await this.mondayApi.request(wS,{},{versionOverride:"dev"});if(!e)return{content:"AUTHENTICATION_ERROR: Unable to fetch current user. Verify API token and user permissions."};return{content:{message:"User context",...{user:e,favorites:await this.fetchFavorites(t||[]),relevantBoards:this.extractRelevantBoards(a),relevantPeople:this.extractRelevantPeople(a)}}}}async fetchFavorites(e){const t=this.groupByType(e),a=Object.keys(t);if(0===a.length)return[];const i={};for(const e of a)i[TS[e]]=t[e];const n=await this.mondayApi.request(xS,i),o=[];for(const e of a){const t=ES[e];for(const a of n[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}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 wu{constructor(){super(...arguments),this.name="update_assets_on_item",this.type=x.WRITE,this.annotations=_u({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 _S}async executeInternal(e){const t={boardId:e.boardId,itemId:e.itemId,columnId:e.columnId,files:e.files},a=await this.mondayApi.request(gS,t);return{content:`Item ${a.update_assets_on_item?.id} (${a.update_assets_on_item?.name}) assets successfully updated`}}},class extends wu{constructor(){super(...arguments),this.name="get_notetaker_meetings",this.type=x.READ,this.annotations=_u({title:"Get Notetaker Meetings",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0})}getDescription(){return"Retrieve notetaker meetings with optional detailed fields. Use include_summary, include_topics, include_action_items, and include_transcript flags to control which details are returned. Use access to filter by meeting access level (OWN, SHARED_WITH_ME, SHARED_WITH_ACCOUNT, ALL). Defaults to OWN. Supports filtering by ids, search term, and cursor-based pagination."}getInputSchema(){return SS}async executeInternal(e){const t={access:e.access};e.ids&&e.ids.length>0&&(t.ids=e.ids),e.search&&(t.search=e.search);const a={limit:e.limit,cursor:e.cursor||void 0,filters:t,includeSummary:e.include_summary,includeTopics:e.include_topics,includeActionItems:e.include_action_items,includeTranscript:e.include_transcript},i=await this.mondayApi.request(IS,a,{versionOverride:"2026-04"}),n=i.notetaker?.meetings;if(!n?.meetings||0===n.meetings.length)return{content:"No notetaker meetings found matching the specified criteria."};return{content:{message:"Meetings retrieved",data:{meetings:n.meetings,pagination:{has_next_page:n.page_info?.has_next_page??!1,cursor:n.page_info?.cursor??null,count:n.meetings.length}}}}}},class extends wu{constructor(){super(...arguments),this.name="create_view",this.type=x.WRITE,this.annotations=_u({title:"Create View",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1})}getDescription(){return'Create a new board view (tab) with optional filters and sorting. This creates a saved view on a monday.com board that users can switch to.\n\nFilter operators: any_of, not_any_of, is_empty, is_not_empty, greater_than, lower_than, between, contains_text, not_contains_text\n\nExample filter for people column: { "rules": [{ "column_id": "people", "compare_value": ["person-12345"], "operator": "any_of" }] }\nExample filter for status column: { "rules": [{ "column_id": "status", "compare_value": [1], "operator": "any_of" }] }'}getInputSchema(){return $w}async executeInternal(e){const t={boardId:e.boardId,type:e.type,name:e.name,filter:e.filter,sort:e.sort},a=await this.mondayApi.request(Cw,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 wu{constructor(){super(...arguments),this.name="undo_action",this.type=x.WRITE,this.annotations=_u({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 AS}async executeInternal(e){return await this.mondayApi.request(NS,{boardId:e.boardId.toString(),undoRecordId:e.undoRecordId},{versionOverride:"dev"}),{content:`Successfully undid action "${e.undoRecordId}" on board ${e.boardId}.`}}}];var sN;!function(e){e.API="api",e.APPS="apps",e.ATP="atp"}(sN||(sN={}));const pN=(e,t)=>{let a=[];t?.mode===sN.APPS?a=[...yu]:t?.mode!==sN.API&&t?.mode||(a=[...rN,...oN]);const i=a.map((t=>((e,t)=>e.prototype instanceof wu?new e(t.apiClient,t.apiToken,t.context):e.prototype instanceof Jm?new e(t.apiToken):new e)(t,e)));return i.filter((e=>{if(!t)return e.type!==x.ALL_API;if(t.mode===sN.API&&"only"===t.enableDynamicApiTools)return e.type===x.ALL_API;let a=!1;return t.mode===sN.API&&!1===t.enableDynamicApiTools&&(a=a||e.type===x.ALL_API),t.readOnlyMode&&(a=a||e.type!==x.READ),t.include?a=a||!t.include?.includes(e.name):t.exclude&&(a=a||t.exclude?.includes(e.name)),!a}))},dN=e=>"object"==typeof e?JSON.stringify(e):e;class cN{constructor(t){this.mondayApi=new e({token:t.mondayApiToken,apiVersion:t.mondayApiVersion??Km,endpoint:t.mondayApiEndpoint,requestConfig:t.mondayApiRequestConfig}),this.mondayApiToken=t.mondayApiToken,this.context={...t.context,apiVersion:t.mondayApiVersion??Km},this.tools=this.initializeTools(t)}initializeTools(e){const t={apiClient:this.mondayApi,apiToken:this.mondayApiToken,context:this.context};return pN(t,e.toolsConfiguration)}getTools(){return this.tools.map((e=>{const t=e.getInputSchema();return{type:"function",function:{name:e.name,description:e.getDescription(),parameters:t?w(y.object(t)):void 0}}}))}async handleToolCall(e){const{name:t,arguments:a}=e.function,i=JSON.parse(a),n=this.tools.find((e=>e.name===t));if(!n)throw new Error(`Unknown tool: ${t}`);const o=n.getInputSchema();if(o){const t=y.object(o).safeParse(i);if(!t.success)throw new Error(`Invalid arguments: ${t.error.message}`);const a=await n.execute(t.data);return{role:"tool",tool_call_id:e.id,content:dN(a.content)}}{const t=await n.execute();return{role:"tool",tool_call_id:e.id,content:dN(t.content)}}}}export{cN as MondayAgentToolkit};
2052
2052
  //# sourceMappingURL=index.js.map