@mondaydotcomorg/agent-toolkit 2.0.9 → 2.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/core/index.d.ts +13 -12
- package/dist/cjs/core/index.js +2 -2
- package/dist/cjs/core/index.js.map +1 -1
- package/dist/cjs/mcp/index.js +17 -17
- package/dist/cjs/mcp/index.js.map +1 -1
- package/dist/cjs/openai/index.js +4 -4
- package/dist/cjs/openai/index.js.map +1 -1
- package/dist/esm/core/index.d.ts +13 -12
- package/dist/esm/core/index.js +3 -3
- package/dist/esm/core/index.js.map +1 -1
- package/dist/esm/mcp/index.js +4 -4
- package/dist/esm/mcp/index.js.map +1 -1
- package/dist/esm/openai/index.js +1 -1
- package/dist/esm/openai/index.js.map +1 -1
- package/package.json +1 -1
package/dist/esm/openai/index.js
CHANGED
|
@@ -304,7 +304,7 @@ import{ApiClient as e}from"@mondaydotcomorg/api";import{zodToJsonSchema as p}fro
|
|
|
304
304
|
type
|
|
305
305
|
}
|
|
306
306
|
}
|
|
307
|
-
`,zt={itemId:a.number()};const Qt={term:a.string()},Kt={boardId:a.number(),...Qt};const Ht={name:a.string().describe("The name of the new item to be created, must be relevant to the user's request"),groupId:a.string().optional().describe("The id of the group id to which the new item will be added, if its not clearly specified, leave empty"),columnValues:a.string().describe('A string containing the new column values for the item following this structure: {\\"column_id\\": \\"value\\",... you can change multiple columns at once, note that for status column you must use nested value with \'label\' as a key and for date column use \'date\' as key} - example: "{\\"text_column_id\\":\\"New text\\", \\"status_column_id\\":{\\"label\\":\\"Done\\"}, \\"date_column_id\\":{\\"date\\":\\"2023-05-25\\"},\\"dropdown_id\\":\\"value\\", \\"phone_id\\":\\"123-456-7890\\", \\"email_id\\":\\"test@example.com\\"}"')},Xt={boardId:a.number().describe("The id of the board to which the new item will be added"),...Ht};const Wt={itemId:a.number().describe("The id of the item to which the update will be added"),body:a.string().describe("The update to be created, must be relevant to the user's request")};const Zt={boardId:a.number().describe("The id of the board to get the schema of")};const ei={name:a.string().optional().describe("The name or partial name of the user to get")};const pi={itemId:a.number().describe("The ID of the item to be updated"),columnValues:a.string().describe('A string containing the new column values for the item following this structure: {\\"column_id\\": \\"value\\",... you can change multiple columns at once, note that for status column you must use nested value with \'label\' as a key and for date column use \'date\' as key} - example: "{\\"text_column_id\\":\\"New text\\", \\"status_column_id\\":{\\"label\\":\\"Done\\"}, \\"date_column_id\\":{\\"date\\":\\"2023-05-25\\"}, \\"phone_id\\":\\"123-456-7890\\", \\"email_id\\":\\"test@example.com\\"}"')},ai={boardId:a.number().describe("The ID of the board that contains the item to be updated"),...pi};const di={itemId:a.number().describe("The id of the item to which the update will be added"),groupId:a.string().describe("The id of the group to which the item will be moved")};var ti,ii,ni,oi,ri,si,li,mi,ui,ci,vi,hi,fi,_i,yi,wi,Ni,Ti,gi,Ei,bi,Ii,Di,Si,Ai,Oi,Vi,Li,Ci,Fi,xi,ki,Ri,$i,Ui,Pi,Bi,ji,Mi,Gi,qi,Yi,Ji,zi,Qi,Ki,Hi,Xi,Wi,Zi,en,pn,an,dn,tn;!function(e){e.CannotUpdateSelf="CANNOT_UPDATE_SELF",e.ExceedsBatchLimit="EXCEEDS_BATCH_LIMIT",e.Failed="FAILED",e.InvalidInput="INVALID_INPUT",e.UserNotFound="USER_NOT_FOUND"}(ti||(ti={})),function(e){e.All="all",e.Columns="columns",e.Gallery="gallery"}(ii||(ii={})),function(e){e.CannotUpdateSelf="CANNOT_UPDATE_SELF",e.ExceedsBatchLimit="EXCEEDS_BATCH_LIMIT",e.Failed="FAILED",e.InvalidInput="INVALID_INPUT",e.UserNotFound="USER_NOT_FOUND",e.UserNotMemberOfTeam="USER_NOT_MEMBER_OF_TEAM",e.ViewersOrGuests="VIEWERS_OR_GUESTS"}(ni||(ni={})),function(e){e.Admin="ADMIN",e.Guest="GUEST",e.Member="MEMBER",e.PortalUser="PORTAL_USER",e.ViewOnly="VIEW_ONLY"}(oi||(oi={})),function(e){e.Communication="communication",e.Description="description",e.Name="name"}(ri||(ri={})),function(e){e.Private="private",e.Public="public",e.Share="share"}(si||(si={})),function(e){e.Board="board",e.CustomObject="custom_object",e.Document="document",e.SubItemsBoard="sub_items_board"}(li||(li={})),function(e){e.Owner="owner",e.Subscriber="subscriber"}(mi||(mi={})),function(e){e.CreatedAt="created_at",e.UsedAt="used_at"}(ui||(ui={})),function(e){e.Description="description",e.Title="title"}(ci||(ci={})),function(e){e.AutoNumber="auto_number",e.BoardRelation="board_relation",e.Button="button",e.Checkbox="checkbox",e.ColorPicker="color_picker",e.Country="country",e.CreationLog="creation_log",e.Date="date",e.Dependency="dependency",e.DirectDoc="direct_doc",e.Doc="doc",e.Dropdown="dropdown",e.Email="email",e.File="file",e.Formula="formula",e.Group="group",e.Hour="hour",e.Integration="integration",e.ItemAssignees="item_assignees",e.ItemId="item_id",e.LastUpdated="last_updated",e.Link="link",e.Location="location",e.LongText="long_text",e.Mirror="mirror",e.Name="name",e.Numbers="numbers",e.People="people",e.Person="person",e.Phone="phone",e.Progress="progress",e.Rating="rating",e.Status="status",e.Subtasks="subtasks",e.Tags="tags",e.Team="team",e.Text="text",e.TimeTracking="time_tracking",e.Timeline="timeline",e.Unsupported="unsupported",e.Vote="vote",e.Week="week",e.WorldClock="world_clock"}(vi||(vi={})),function(e){e.BrinkPink="BRINK_PINK",e.CelticBlue="CELTIC_BLUE",e.CornflowerBlue="CORNFLOWER_BLUE",e.DingyDungeon="DINGY_DUNGEON",e.GoGreen="GO_GREEN",e.Gray="GRAY",e.LightDeepPink="LIGHT_DEEP_PINK",e.LightHotPink="LIGHT_HOT_PINK",e.MayaBlue="MAYA_BLUE",e.MediumTurquoise="MEDIUM_TURQUOISE",e.ParadisePink="PARADISE_PINK",e.PhilippineGreen="PHILIPPINE_GREEN",e.PhilippineYellow="PHILIPPINE_YELLOW",e.SlateBlue="SLATE_BLUE",e.VividCerulean="VIVID_CERULEAN",e.YankeesBlue="YANKEES_BLUE",e.YellowGreen="YELLOW_GREEN",e.YellowOrange="YELLOW_ORANGE"}(hi||(hi={})),function(e){e.Ascending="ASCENDING",e.Camera="CAMERA",e.Conference="CONFERENCE",e.Flag="FLAG",e.Gift="GIFT",e.Headphones="HEADPHONES",e.Homekeys="HOMEKEYS",e.Location="LOCATION",e.Notebook="NOTEBOOK",e.Paperplane="PAPERPLANE",e.Plane="PLANE",e.Pliers="PLIERS",e.Tripod="TRIPOD",e.Twoflags="TWOFLAGS",e.Utencils="UTENCILS"}(fi||(fi={})),function(e){e.CannotUpdateSelf="CANNOT_UPDATE_SELF",e.ExceedsBatchLimit="EXCEEDS_BATCH_LIMIT",e.Failed="FAILED",e.InvalidInput="INVALID_INPUT",e.UserNotFound="USER_NOT_FOUND"}(_i||(_i={})),function(e){e.Monthly="MONTHLY",e.Yearly="YEARLY"}(yi||(yi={})),function(e){e.BulletedList="bulleted_list",e.CheckList="check_list",e.Code="code",e.Divider="divider",e.Image="image",e.LargeTitle="large_title",e.Layout="layout",e.MediumTitle="medium_title",e.NormalText="normal_text",e.NoticeBox="notice_box",e.NumberedList="numbered_list",e.PageBreak="page_break",e.Quote="quote",e.SmallTitle="small_title",e.Table="table",e.Video="video"}(wi||(wi={})),function(e){e.CreatedAt="created_at",e.UsedAt="used_at"}(Ni||(Ni={})),function(e){e.DuplicateBoardWithPulses="duplicate_board_with_pulses",e.DuplicateBoardWithPulsesAndUpdates="duplicate_board_with_pulses_and_updates",e.DuplicateBoardWithStructure="duplicate_board_with_structure"}(Ti||(Ti={})),function(e){e.Asset="asset",e.Box="box",e.Doc="doc",e.Dropbox="dropbox",e.GoogleDrive="google_drive",e.Link="link",e.Onedrive="onedrive"}(gi||(gi={})),function(e){e.Box="box",e.Dropbox="dropbox",e.GoogleDrive="google_drive",e.Link="link",e.Onedrive="onedrive"}(Ei||(Ei={})),function(e){e.Monday="monday",e.Sunday="sunday"}(bi||(bi={})),function(e){e.Aquamarine="AQUAMARINE",e.BrightBlue="BRIGHT_BLUE",e.BrightGreen="BRIGHT_GREEN",e.ChiliBlue="CHILI_BLUE",e.DarkOrange="DARK_ORANGE",e.DarkPurple="DARK_PURPLE",e.DarkRed="DARK_RED",e.DoneGreen="DONE_GREEN",e.Indigo="INDIGO",e.Lipstick="LIPSTICK",e.Null="NULL",e.Purple="PURPLE",e.SofiaPink="SOFIA_PINK",e.StuckRed="STUCK_RED",e.Sunset="SUNSET",e.WorkingOrange="WORKING_ORANGE"}(Ii||(Ii={})),function(e){e.Folder="FOLDER",e.Morebelow="MOREBELOW",e.Morebelowfilled="MOREBELOWFILLED",e.Null="NULL",e.Work="WORK"}(Di||(Di={})),function(e){e.FontWeightBold="FONT_WEIGHT_BOLD",e.FontWeightLight="FONT_WEIGHT_LIGHT",e.FontWeightNormal="FONT_WEIGHT_NORMAL",e.FontWeightVeryLight="FONT_WEIGHT_VERY_LIGHT",e.Null="NULL"}(Si||(Si={})),function(e){e.Color="color",e.Position="position",e.RelativePositionAfter="relative_position_after",e.RelativePositionBefore="relative_position_before",e.Title="title"}(Ai||(Ai={})),function(e){e.Error="ERROR"}(Oi||(Oi={})),function(e){e.Asc="asc",e.Desc="desc"}(Vi||(Vi={})),function(e){e.And="and",e.Or="or"}(Li||(Li={})),function(e){e.AnyOf="any_of",e.Between="between",e.ContainsTerms="contains_terms",e.ContainsText="contains_text",e.EndsWith="ends_with",e.GreaterThan="greater_than",e.GreaterThanOrEquals="greater_than_or_equals",e.IsEmpty="is_empty",e.IsNotEmpty="is_not_empty",e.LowerThan="lower_than",e.LowerThanOrEqual="lower_than_or_equal",e.NotAnyOf="not_any_of",e.NotContainsText="not_contains_text",e.StartsWith="starts_with",e.WithinTheLast="within_the_last",e.WithinTheNext="within_the_next"}(Ci||(Ci={})),function(e){e.Person="person",e.Team="team"}(Fi||(Fi={})),function(e){e.Active="active",e.Deleted="deleted",e.Inactive="inactive"}(xi||(xi={})),function(e){e.Dropdown="dropdown",e.Status="status"}(ki||(ki={})),function(e){e.Post="Post",e.Project="Project"}(Ri||(Ri={})),function(e){e.Left="left",e.Right="right"}($i||($i={})),function(e){e.AfterAt="after_at",e.BeforeAt="before_at"}(Ui||(Ui={})),function(e){e.Crm="crm",e.Dev="dev",e.Forms="forms",e.Knowledge="knowledge",e.Service="service",e.Whiteboard="whiteboard",e.WorkManagement="work_management",e.Workflows="workflows"}(Pi||(Pi={})),function(e){e.CannotUpdateSelf="CANNOT_UPDATE_SELF",e.ExceedsBatchLimit="EXCEEDS_BATCH_LIMIT",e.Failed="FAILED",e.InvalidInput="INVALID_INPUT",e.UserNotFound="USER_NOT_FOUND",e.UserNotMemberOfTeam="USER_NOT_MEMBER_OF_TEAM",e.ViewersOrGuests="VIEWERS_OR_GUESTS"}(Bi||(Bi={})),function(e){e.Active="active",e.All="all",e.Archived="archived",e.Deleted="deleted"}(ji||(ji={})),function(e){e.AmericanGray="american_gray",e.Aquamarine="aquamarine",e.Berry="berry",e.Blackish="blackish",e.BrightBlue="bright_blue",e.BrightGreen="bright_green",e.Brown="brown",e.Bubble="bubble",e.ChiliBlue="chili_blue",e.Coffee="coffee",e.DarkBlue="dark_blue",e.DarkIndigo="dark_indigo",e.DarkOrange="dark_orange",e.DarkPurple="dark_purple",e.DarkRed="dark_red",e.DoneGreen="done_green",e.EggYolk="egg_yolk",e.Explosive="explosive",e.GrassGreen="grass_green",e.Indigo="indigo",e.Lavender="lavender",e.Lilac="lilac",e.Lipstick="lipstick",e.Navy="navy",e.Orchid="orchid",e.Peach="peach",e.Pecan="pecan",e.Purple="purple",e.River="river",e.Royal="royal",e.Saladish="saladish",e.Sky="sky",e.SofiaPink="sofia_pink",e.Steel="steel",e.StuckRed="stuck_red",e.Sunset="sunset",e.Tan="tan",e.Teal="teal",e.Winter="winter",e.WorkingOrange="working_orange"}(Mi||(Mi={})),function(e){e.Nominal="nominal",e.Percent="percent"}(Gi||(Gi={})),function(e){e.OneTime="one_time",e.Recurring="recurring"}(qi||(qi={})),function(e){e.Monthly="monthly",e.Yearly="yearly"}(Yi||(Yi={})),function(e){e.Active="active",e.Inactive="inactive"}(Ji||(Ji={})),function(e){e.CannotUpdateSelf="CANNOT_UPDATE_SELF",e.ExceedsBatchLimit="EXCEEDS_BATCH_LIMIT",e.Failed="FAILED",e.InvalidInput="INVALID_INPUT",e.UpdateEmailDomainError="UPDATE_EMAIL_DOMAIN_ERROR",e.UserNotFound="USER_NOT_FOUND"}(zi||(zi={})),function(e){e.InvalidField="INVALID_FIELD"}(Qi||(Qi={})),function(e){e.CannotUpdateSelf="CANNOT_UPDATE_SELF",e.ExceedsBatchLimit="EXCEEDS_BATCH_LIMIT",e.Failed="FAILED",e.InvalidInput="INVALID_INPUT",e.UserNotFound="USER_NOT_FOUND"}(Ki||(Ki={})),function(e){e.All="all",e.Guests="guests",e.NonGuests="non_guests",e.NonPending="non_pending"}(Hi||(Hi={})),function(e){e.Admin="ADMIN",e.Guest="GUEST",e.Member="MEMBER",e.PortalUser="PORTAL_USER",e.ViewOnly="VIEW_ONLY"}(Xi||(Xi={})),function(e){e.Current="current",e.Deprecated="deprecated",e.Dev="dev",e.Maintenance="maintenance",e.OldMaintenance="old__maintenance",e.OldPreviousMaintenance="old_previous_maintenance",e.PreviousMaintenance="previous_maintenance",e.ReleaseCandidate="release_candidate"}(Wi||(Wi={})),function(e){e.ChangeColumnValue="change_column_value",e.ChangeName="change_name",e.ChangeSpecificColumnValue="change_specific_column_value",e.ChangeStatusColumnValue="change_status_column_value",e.ChangeSubitemColumnValue="change_subitem_column_value",e.ChangeSubitemName="change_subitem_name",e.CreateColumn="create_column",e.CreateItem="create_item",e.CreateSubitem="create_subitem",e.CreateSubitemUpdate="create_subitem_update",e.CreateUpdate="create_update",e.DeleteUpdate="delete_update",e.EditUpdate="edit_update",e.ItemArchived="item_archived",e.ItemDeleted="item_deleted",e.ItemMovedToAnyGroup="item_moved_to_any_group",e.ItemMovedToSpecificGroup="item_moved_to_specific_group",e.ItemRestored="item_restored",e.MoveSubitem="move_subitem",e.SubitemArchived="subitem_archived",e.SubitemDeleted="subitem_deleted"}(Zi||(Zi={})),function(e){e.Closed="closed",e.Open="open"}(en||(en={})),function(e){e.Owner="owner",e.Subscriber="subscriber"}(pn||(pn={})),function(e){e.CreatedAt="created_at"}(an||(an={})),function(e){e.Query="QUERY",e.Mutation="MUTATION",e.Subscription="SUBSCRIPTION",e.Field="FIELD",e.FragmentDefinition="FRAGMENT_DEFINITION",e.FragmentSpread="FRAGMENT_SPREAD",e.InlineFragment="INLINE_FRAGMENT",e.VariableDefinition="VARIABLE_DEFINITION",e.Schema="SCHEMA",e.Scalar="SCALAR",e.Object="OBJECT",e.FieldDefinition="FIELD_DEFINITION",e.ArgumentDefinition="ARGUMENT_DEFINITION",e.Interface="INTERFACE",e.Union="UNION",e.Enum="ENUM",e.EnumValue="ENUM_VALUE",e.InputObject="INPUT_OBJECT",e.InputFieldDefinition="INPUT_FIELD_DEFINITION"}(dn||(dn={})),function(e){e.Scalar="SCALAR",e.Object="OBJECT",e.Interface="INTERFACE",e.Union="UNION",e.Enum="ENUM",e.InputObject="INPUT_OBJECT",e.List="LIST",e.NonNull="NON_NULL"}(tn||(tn={}));const nn={boardName:a.string().describe("The name of the board to create"),boardKind:a.nativeEnum(si).default(si.Public).describe("The kind of board to create"),boardDescription:a.string().optional().describe("The description of the board to create"),workspaceId:a.string().optional().describe("The ID of the workspace to create the board in")};const on={columnType:a.nativeEnum(vi).describe("The type of the column to be created"),columnTitle:a.string().describe("The title of the column to be created"),columnDescription:a.string().optional().describe("The description of the column to be created"),columnSettings:a.array(a.string()).optional().describe("The default values for the new column (relevant only for column type 'status' or 'dropdown') when possible make the values relevant to the user's request")},rn={boardId:a.number().describe("The id of the board to which the new column will be added"),...on};const sn={columnId:a.string().describe("The id of the column to be deleted")},ln={boardId:a.number().describe("The id of the board to which the new column will be added"),...sn};const mn={query:a.string().describe("Custom GraphQL query/mutation. you need to provide the full query / mutation"),variables:a.string().describe("JSON string containing the variables for the GraphQL operation")};class un extends l{constructor(e,p){super(e,p),this.name="all_monday_api",this.type=s.ALL_API}getDescription(){return"Execute any Monday.com API operation by generating GraphQL queries and mutations dynamically"}getInputSchema(){return mn}async loadSchema(e){if(un.schemaCache[e])return un.schemaCache[e];try{const p=await this.mondayApi.rawRequest(Gt),{data:a}=p,d=ud(a);return un.schemaCache[e]=d,d}catch(e){throw new Error(`Failed to load GraphQL schema: ${e instanceof Error?e.message:"Unknown error"}`)}}async validateOperation(e,p){var a;return md(await this.loadSchema(p),new ne(e,a).parseDocument()).map((e=>e.message))}async execute(e){const{query:p,variables:a}=e;try{let e={};try{e=JSON.parse(a)}catch(e){return{content:`Error parsing variables: ${e instanceof Error?e.message:"Unknown error"}`}}const d=this.mondayApi.apiVersion,t=await this.validateOperation(p,d);if(t.length>0)return{content:t.join(", ")};const i=await this.mondayApi.request(p,e);return{content:JSON.stringify(i)}}catch(e){const p=e instanceof Error?e.message:"Unknown error";if(e instanceof Error&&"response"in e){const p=e;if(p.response?.errors)return{content:p.response.errors.map((e=>e.message)).join(", ")}}return{content:p}}}}un.schemaCache={};const cn={random_string:a.string().describe("Dummy parameter for no-parameter tools").optional()};const vn={typeName:a.string().describe("The name of the GraphQL type to get details for")};function hn(e){return e?"NON_NULL"===e.kind?`${hn(e.ofType)}!`:"LIST"===e.kind?`[${hn(e.ofType)}]`:e.name||"unknown":"unknown"}const fn={color:a.nativeEnum(hi).describe("The color of the custom activity"),icon_id:a.nativeEnum(fi).describe("The icon ID of the custom activity"),name:a.string().describe("The name of the custom activity")};const _n={item_id:a.number().describe("The ID of the item to create the new timeline item on"),custom_activity_id:a.string().describe("The ID of the custom activity for the timeline item"),title:a.string().describe("The title of the new timeline item"),summary:a.string().optional().describe("The summary of the new timeline item (max 255 characters)"),content:a.string().optional().describe("The content of the new timeline item"),timestamp:a.string().describe("The creation time of the new timeline item in ISO8601 format (e.g., 2024-06-06T18:00:30Z)"),start_timestamp:a.string().optional().describe("The start time of the timeline item in ISO8601 format"),end_timestamp:a.string().optional().describe("The end time of the timeline item in ISO8601 format"),location:a.string().optional().describe("The location to add to the new timeline item"),phone:a.string().optional().describe("The phone number to add to the new timeline item"),url:a.string().optional().describe("The URL to add to the new timeline item")};const yn={};const wn=[class extends l{constructor(){super(...arguments),this.name="delete_item",this.type=s.MUTATION}getDescription(){return"Delete an item"}getInputSchema(){return zt}async execute(e){const p={id:e.itemId.toString()},a=await this.mondayApi.request(Lt,p);return{content:`Item ${a.delete_item?.id} successfully deleted`}}},class extends l{constructor(){super(...arguments),this.name="get_board_items_by_name",this.type=s.QUERY}getDescription(){return"Get items by board id and term"}getInputSchema(){return this.context?.boardId?Qt:Kt}async execute(e){const p={boardId:(this.context?.boardId??e.boardId).toString(),term:e.term},a=await this.mondayApi.request(Ct,p);return{content:`Items ${a.boards?.[0]?.items_page?.items?.map((e=>`name: ${e.name}, id: ${e.id}`)).join(", ")} successfully fetched`}}},class extends l{constructor(){super(...arguments),this.name="create_item",this.type=s.MUTATION}getDescription(){return"Create a new item in a monday.com board"}getInputSchema(){return this.context?.boardId?Ht:Xt}async execute(e){const p={boardId:(this.context?.boardId??e.boardId).toString(),itemName:e.name,groupId:e.groupId,columnValues:e.columnValues},a=await this.mondayApi.request(Ft,p);return{content:`Item ${a.create_item?.id} successfully created`}}},class extends l{constructor(){super(...arguments),this.name="create_update",this.type=s.MUTATION}getDescription(){return"Create a new update in a monday.com board"}getInputSchema(){return Wt}async execute(e){const p={itemId:e.itemId.toString(),body:e.body},a=await this.mondayApi.request(xt,p);return{content:`Update ${a.create_update?.id} successfully created on item ${e.itemId}`}}},class extends l{constructor(){super(...arguments),this.name="get_board_schema",this.type=s.QUERY}getDescription(){return"Get board schema (columns and groups) by board id"}getInputSchema(){if(!this.context?.boardId)return Zt}async execute(e){const p=this.context?.boardId??e.boardId,a={boardId:p.toString()},d=await this.mondayApi.request(kt,a);return{content:`The current schema of the board ${p} is: \n \n\nColumns:\n ${d.boards?.[0]?.columns?.map((e=>`Id - ${e?.id}\n Title - ${e?.title}\n Type - ${e?.type}`)).join("\n")}\n \n\nGroups:\n ${d.boards?.[0]?.groups?.map((e=>`Id - ${e?.id}\n Title - ${e?.title}`)).join("\n")}`}}},class extends l{constructor(){super(...arguments),this.name="get_users_by_name",this.type=s.QUERY}getDescription(){return"Get users, can be filtered by name or partial name"}getInputSchema(){return ei}async execute(e){const p={name:e.name},a=await this.mondayApi.request(Rt,p);return{content:`Relevant users:\n ${a.users?.map((e=>` id: ${e?.id}, name: ${e?.name}, title: ${e?.title}`)).join("\n")}`}}},class extends l{constructor(){super(...arguments),this.name="change_item_column_values",this.type=s.MUTATION}getDescription(){return"Change the column values of an item in a monday.com board"}getInputSchema(){return this.context?.boardId?pi:ai}async execute(e){const p={boardId:(this.context?.boardId??e.boardId).toString(),itemId:e.itemId.toString(),columnValues:e.columnValues},a=await this.mondayApi.request($t,p);return{content:`Item ${a.change_multiple_column_values?.id} successfully updated with the new column values`}}},class extends l{constructor(){super(...arguments),this.name="move_item_to_group",this.type=s.MUTATION}getDescription(){return"Move an item to a group in a monday.com board"}getInputSchema(){return di}async execute(e){const p={itemId:e.itemId.toString(),groupId:e.groupId},a=await this.mondayApi.request(Ut,p);return{content:`Item ${a.move_item_to_group?.id} successfully moved to group ${e.groupId}`}}},class extends l{constructor(){super(...arguments),this.name="create_board",this.type=s.MUTATION}getDescription(){return"Create a monday.com board"}getInputSchema(){return nn}async execute(e){const p={boardName:e.boardName,boardKind:e.boardKind,boardDescription:e.boardDescription,workspaceId:e.workspaceId},a=await this.mondayApi.request(Pt,p);return{content:`Board ${a.create_board?.id} successfully created`}}},class extends l{constructor(){super(...arguments),this.name="create_column",this.type=s.MUTATION}getDescription(){return"Create a new column in a monday.com board"}getInputSchema(){return this.context?.boardId?on:rn}async execute(e){const p=this.context?.boardId??e.boardId;let a;e.columnSettings&&e.columnType===vi.Status?a=JSON.stringify({labels:Object.fromEntries(e.columnSettings.map(((e,p)=>[String(p+1),e])))}):e.columnSettings&&e.columnType===vi.Dropdown&&(a=JSON.stringify({settings:{labels:e.columnSettings.map(((e,p)=>({id:p+1,name:e})))}}));const d={boardId:p.toString(),columnType:e.columnType,columnTitle:e.columnTitle,columnDescription:e.columnDescription,columnSettings:a},t=await this.mondayApi.request(Bt,d);return{content:`Column ${t.create_column?.id} successfully created`}}},class extends l{constructor(){super(...arguments),this.name="delete_column",this.type=s.MUTATION}getDescription(){return"Delete a column from a monday.com board"}getInputSchema(){return this.context?.boardId?sn:ln}async execute(e){const p={boardId:(this.context?.boardId??e.boardId).toString(),columnId:e.columnId},a=await this.mondayApi.request(jt,p);return{content:`Column ${a.delete_column?.id} successfully deleted`}}},un,class extends l{constructor(){super(...arguments),this.name="get_graphql_schema",this.type=s.ALL_API}getDescription(){return"Fetch the Monday.com GraphQL schema structure including query and mutation definitions"}getInputSchema(){return cn}async execute(){try{const e=await this.mondayApi.request(Mt),p=e.queryType?.fields?.map((e=>`- ${e.name}${e.description?`: ${e.description}`:""}`)).join("\n")||"No query fields found",a=e.mutationType?.fields?.map((e=>`- ${e.name}${e.description?`: ${e.description}`:""}`)).join("\n")||"No mutation fields found",d=e.__schema,t=d?.types?.filter((e=>e.name&&!e.name.startsWith("__"))).map((e=>`- ${e.name} (${e.kind||"unknown"})`)).join("\n")||"No types found";return{content:`\n## GraphQL Schema\n- Query Type: ${e.__schema?.queryType?.name}\n- Mutation Type: ${e.__schema?.mutationType?.name}\n\n## Query Fields\n${p}\n\n## Mutation Fields\n${a}\n\n## Available Types\n${t}\n\nTo 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.\n`}}catch(e){return{content:`Error fetching GraphQL schema: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends l{constructor(){super(...arguments),this.name="get_type_details",this.type=s.ALL_API}getDescription(){return"Get detailed information about a specific GraphQL type from the Monday.com API schema"}getInputSchema(){return vn}async execute(e){try{if(!e.typeName)return{content:"Error: typeName is required. Please provide a valid GraphQL type name."};const a=(p=e.typeName,Vt`
|
|
307
|
+
`,zt={itemId:a.number()};const Qt={term:a.string()},Kt={boardId:a.number(),...Qt};const Ht={name:a.string().describe("The name of the new item to be created, must be relevant to the user's request"),groupId:a.string().optional().describe("The id of the group id to which the new item will be added, if its not clearly specified, leave empty"),columnValues:a.string().describe('A string containing the new column values for the item following this structure: {\\"column_id\\": \\"value\\",... you can change multiple columns at once, note that for status column you must use nested value with \'label\' as a key and for date column use \'date\' as key} - example: "{\\"text_column_id\\":\\"New text\\", \\"status_column_id\\":{\\"label\\":\\"Done\\"}, \\"date_column_id\\":{\\"date\\":\\"2023-05-25\\"},\\"dropdown_id\\":\\"value\\", \\"phone_id\\":\\"123-456-7890\\", \\"email_id\\":\\"test@example.com\\"}"')},Xt={boardId:a.number().describe("The id of the board to which the new item will be added"),...Ht};const Wt={itemId:a.number().describe("The id of the item to which the update will be added"),body:a.string().describe("The update to be created, must be relevant to the user's request")};const Zt={boardId:a.number().describe("The id of the board to get the schema of")};const ei={name:a.string().optional().describe("The name or partial name of the user to get")};const pi={itemId:a.number().describe("The ID of the item to be updated"),columnValues:a.string().describe('A string containing the new column values for the item following this structure: {\\"column_id\\": \\"value\\",... you can change multiple columns at once, note that for status column you must use nested value with \'label\' as a key and for date column use \'date\' as key} - example: "{\\"text_column_id\\":\\"New text\\", \\"status_column_id\\":{\\"label\\":\\"Done\\"}, \\"date_column_id\\":{\\"date\\":\\"2023-05-25\\"}, \\"phone_id\\":\\"123-456-7890\\", \\"email_id\\":\\"test@example.com\\"}"')},ai={boardId:a.number().describe("The ID of the board that contains the item to be updated"),...pi};const di={itemId:a.number().describe("The id of the item to which the update will be added"),groupId:a.string().describe("The id of the group to which the item will be moved")};var ti,ii,ni,oi,ri,si,li,mi,ui,ci,vi,hi,fi,_i,yi,wi,Ni,Ti,gi,Ei,bi,Ii,Di,Si,Ai,Oi,Vi,Li,Ci,Fi,xi,ki,Ri,$i,Ui,Pi,Bi,ji,Mi,Gi,qi,Yi,Ji,zi,Qi,Ki,Hi,Xi,Wi,Zi,en,pn,an,dn,tn;!function(e){e.CannotUpdateSelf="CANNOT_UPDATE_SELF",e.ExceedsBatchLimit="EXCEEDS_BATCH_LIMIT",e.Failed="FAILED",e.InvalidInput="INVALID_INPUT",e.UserNotFound="USER_NOT_FOUND"}(ti||(ti={})),function(e){e.All="all",e.Columns="columns",e.Gallery="gallery"}(ii||(ii={})),function(e){e.CannotUpdateSelf="CANNOT_UPDATE_SELF",e.ExceedsBatchLimit="EXCEEDS_BATCH_LIMIT",e.Failed="FAILED",e.InvalidInput="INVALID_INPUT",e.UserNotFound="USER_NOT_FOUND",e.UserNotMemberOfTeam="USER_NOT_MEMBER_OF_TEAM",e.ViewersOrGuests="VIEWERS_OR_GUESTS"}(ni||(ni={})),function(e){e.Admin="ADMIN",e.Guest="GUEST",e.Member="MEMBER",e.PortalUser="PORTAL_USER",e.ViewOnly="VIEW_ONLY"}(oi||(oi={})),function(e){e.Communication="communication",e.Description="description",e.Name="name"}(ri||(ri={})),function(e){e.Private="private",e.Public="public",e.Share="share"}(si||(si={})),function(e){e.Board="board",e.CustomObject="custom_object",e.Document="document",e.SubItemsBoard="sub_items_board"}(li||(li={})),function(e){e.Owner="owner",e.Subscriber="subscriber"}(mi||(mi={})),function(e){e.CreatedAt="created_at",e.UsedAt="used_at"}(ui||(ui={})),function(e){e.Description="description",e.Title="title"}(ci||(ci={})),function(e){e.AutoNumber="auto_number",e.BoardRelation="board_relation",e.Button="button",e.Checkbox="checkbox",e.ColorPicker="color_picker",e.Country="country",e.CreationLog="creation_log",e.Date="date",e.Dependency="dependency",e.DirectDoc="direct_doc",e.Doc="doc",e.Dropdown="dropdown",e.Email="email",e.File="file",e.Formula="formula",e.Group="group",e.Hour="hour",e.Integration="integration",e.ItemAssignees="item_assignees",e.ItemId="item_id",e.LastUpdated="last_updated",e.Link="link",e.Location="location",e.LongText="long_text",e.Mirror="mirror",e.Name="name",e.Numbers="numbers",e.People="people",e.Person="person",e.Phone="phone",e.Progress="progress",e.Rating="rating",e.Status="status",e.Subtasks="subtasks",e.Tags="tags",e.Team="team",e.Text="text",e.TimeTracking="time_tracking",e.Timeline="timeline",e.Unsupported="unsupported",e.Vote="vote",e.Week="week",e.WorldClock="world_clock"}(vi||(vi={})),function(e){e.BrinkPink="BRINK_PINK",e.CelticBlue="CELTIC_BLUE",e.CornflowerBlue="CORNFLOWER_BLUE",e.DingyDungeon="DINGY_DUNGEON",e.GoGreen="GO_GREEN",e.Gray="GRAY",e.LightDeepPink="LIGHT_DEEP_PINK",e.LightHotPink="LIGHT_HOT_PINK",e.MayaBlue="MAYA_BLUE",e.MediumTurquoise="MEDIUM_TURQUOISE",e.ParadisePink="PARADISE_PINK",e.PhilippineGreen="PHILIPPINE_GREEN",e.PhilippineYellow="PHILIPPINE_YELLOW",e.SlateBlue="SLATE_BLUE",e.VividCerulean="VIVID_CERULEAN",e.YankeesBlue="YANKEES_BLUE",e.YellowGreen="YELLOW_GREEN",e.YellowOrange="YELLOW_ORANGE"}(hi||(hi={})),function(e){e.Ascending="ASCENDING",e.Camera="CAMERA",e.Conference="CONFERENCE",e.Flag="FLAG",e.Gift="GIFT",e.Headphones="HEADPHONES",e.Homekeys="HOMEKEYS",e.Location="LOCATION",e.Notebook="NOTEBOOK",e.Paperplane="PAPERPLANE",e.Plane="PLANE",e.Pliers="PLIERS",e.Tripod="TRIPOD",e.Twoflags="TWOFLAGS",e.Utencils="UTENCILS"}(fi||(fi={})),function(e){e.CannotUpdateSelf="CANNOT_UPDATE_SELF",e.ExceedsBatchLimit="EXCEEDS_BATCH_LIMIT",e.Failed="FAILED",e.InvalidInput="INVALID_INPUT",e.UserNotFound="USER_NOT_FOUND"}(_i||(_i={})),function(e){e.Monthly="MONTHLY",e.Yearly="YEARLY"}(yi||(yi={})),function(e){e.BulletedList="bulleted_list",e.CheckList="check_list",e.Code="code",e.Divider="divider",e.Image="image",e.LargeTitle="large_title",e.Layout="layout",e.MediumTitle="medium_title",e.NormalText="normal_text",e.NoticeBox="notice_box",e.NumberedList="numbered_list",e.PageBreak="page_break",e.Quote="quote",e.SmallTitle="small_title",e.Table="table",e.Video="video"}(wi||(wi={})),function(e){e.CreatedAt="created_at",e.UsedAt="used_at"}(Ni||(Ni={})),function(e){e.DuplicateBoardWithPulses="duplicate_board_with_pulses",e.DuplicateBoardWithPulsesAndUpdates="duplicate_board_with_pulses_and_updates",e.DuplicateBoardWithStructure="duplicate_board_with_structure"}(Ti||(Ti={})),function(e){e.Asset="asset",e.Box="box",e.Doc="doc",e.Dropbox="dropbox",e.GoogleDrive="google_drive",e.Link="link",e.Onedrive="onedrive"}(gi||(gi={})),function(e){e.Box="box",e.Dropbox="dropbox",e.GoogleDrive="google_drive",e.Link="link",e.Onedrive="onedrive"}(Ei||(Ei={})),function(e){e.Monday="monday",e.Sunday="sunday"}(bi||(bi={})),function(e){e.Aquamarine="AQUAMARINE",e.BrightBlue="BRIGHT_BLUE",e.BrightGreen="BRIGHT_GREEN",e.ChiliBlue="CHILI_BLUE",e.DarkOrange="DARK_ORANGE",e.DarkPurple="DARK_PURPLE",e.DarkRed="DARK_RED",e.DoneGreen="DONE_GREEN",e.Indigo="INDIGO",e.Lipstick="LIPSTICK",e.Null="NULL",e.Purple="PURPLE",e.SofiaPink="SOFIA_PINK",e.StuckRed="STUCK_RED",e.Sunset="SUNSET",e.WorkingOrange="WORKING_ORANGE"}(Ii||(Ii={})),function(e){e.Folder="FOLDER",e.Morebelow="MOREBELOW",e.Morebelowfilled="MOREBELOWFILLED",e.Null="NULL",e.Work="WORK"}(Di||(Di={})),function(e){e.FontWeightBold="FONT_WEIGHT_BOLD",e.FontWeightLight="FONT_WEIGHT_LIGHT",e.FontWeightNormal="FONT_WEIGHT_NORMAL",e.FontWeightVeryLight="FONT_WEIGHT_VERY_LIGHT",e.Null="NULL"}(Si||(Si={})),function(e){e.Color="color",e.Position="position",e.RelativePositionAfter="relative_position_after",e.RelativePositionBefore="relative_position_before",e.Title="title"}(Ai||(Ai={})),function(e){e.Error="ERROR"}(Oi||(Oi={})),function(e){e.Asc="asc",e.Desc="desc"}(Vi||(Vi={})),function(e){e.And="and",e.Or="or"}(Li||(Li={})),function(e){e.AnyOf="any_of",e.Between="between",e.ContainsTerms="contains_terms",e.ContainsText="contains_text",e.EndsWith="ends_with",e.GreaterThan="greater_than",e.GreaterThanOrEquals="greater_than_or_equals",e.IsEmpty="is_empty",e.IsNotEmpty="is_not_empty",e.LowerThan="lower_than",e.LowerThanOrEqual="lower_than_or_equal",e.NotAnyOf="not_any_of",e.NotContainsText="not_contains_text",e.StartsWith="starts_with",e.WithinTheLast="within_the_last",e.WithinTheNext="within_the_next"}(Ci||(Ci={})),function(e){e.Person="person",e.Team="team"}(Fi||(Fi={})),function(e){e.Active="active",e.Deleted="deleted",e.Inactive="inactive"}(xi||(xi={})),function(e){e.Dropdown="dropdown",e.Status="status"}(ki||(ki={})),function(e){e.Post="Post",e.Project="Project"}(Ri||(Ri={})),function(e){e.Left="left",e.Right="right"}($i||($i={})),function(e){e.AfterAt="after_at",e.BeforeAt="before_at"}(Ui||(Ui={})),function(e){e.Crm="crm",e.Dev="dev",e.Forms="forms",e.Knowledge="knowledge",e.Service="service",e.Whiteboard="whiteboard",e.WorkManagement="work_management",e.Workflows="workflows"}(Pi||(Pi={})),function(e){e.CannotUpdateSelf="CANNOT_UPDATE_SELF",e.ExceedsBatchLimit="EXCEEDS_BATCH_LIMIT",e.Failed="FAILED",e.InvalidInput="INVALID_INPUT",e.UserNotFound="USER_NOT_FOUND",e.UserNotMemberOfTeam="USER_NOT_MEMBER_OF_TEAM",e.ViewersOrGuests="VIEWERS_OR_GUESTS"}(Bi||(Bi={})),function(e){e.Active="active",e.All="all",e.Archived="archived",e.Deleted="deleted"}(ji||(ji={})),function(e){e.AmericanGray="american_gray",e.Aquamarine="aquamarine",e.Berry="berry",e.Blackish="blackish",e.BrightBlue="bright_blue",e.BrightGreen="bright_green",e.Brown="brown",e.Bubble="bubble",e.ChiliBlue="chili_blue",e.Coffee="coffee",e.DarkBlue="dark_blue",e.DarkIndigo="dark_indigo",e.DarkOrange="dark_orange",e.DarkPurple="dark_purple",e.DarkRed="dark_red",e.DoneGreen="done_green",e.EggYolk="egg_yolk",e.Explosive="explosive",e.GrassGreen="grass_green",e.Indigo="indigo",e.Lavender="lavender",e.Lilac="lilac",e.Lipstick="lipstick",e.Navy="navy",e.Orchid="orchid",e.Peach="peach",e.Pecan="pecan",e.Purple="purple",e.River="river",e.Royal="royal",e.Saladish="saladish",e.Sky="sky",e.SofiaPink="sofia_pink",e.Steel="steel",e.StuckRed="stuck_red",e.Sunset="sunset",e.Tan="tan",e.Teal="teal",e.Winter="winter",e.WorkingOrange="working_orange"}(Mi||(Mi={})),function(e){e.Nominal="nominal",e.Percent="percent"}(Gi||(Gi={})),function(e){e.OneTime="one_time",e.Recurring="recurring"}(qi||(qi={})),function(e){e.Monthly="monthly",e.Yearly="yearly"}(Yi||(Yi={})),function(e){e.Active="active",e.Inactive="inactive"}(Ji||(Ji={})),function(e){e.CannotUpdateSelf="CANNOT_UPDATE_SELF",e.ExceedsBatchLimit="EXCEEDS_BATCH_LIMIT",e.Failed="FAILED",e.InvalidInput="INVALID_INPUT",e.UpdateEmailDomainError="UPDATE_EMAIL_DOMAIN_ERROR",e.UserNotFound="USER_NOT_FOUND"}(zi||(zi={})),function(e){e.InvalidField="INVALID_FIELD"}(Qi||(Qi={})),function(e){e.CannotUpdateSelf="CANNOT_UPDATE_SELF",e.ExceedsBatchLimit="EXCEEDS_BATCH_LIMIT",e.Failed="FAILED",e.InvalidInput="INVALID_INPUT",e.UserNotFound="USER_NOT_FOUND"}(Ki||(Ki={})),function(e){e.All="all",e.Guests="guests",e.NonGuests="non_guests",e.NonPending="non_pending"}(Hi||(Hi={})),function(e){e.Admin="ADMIN",e.Guest="GUEST",e.Member="MEMBER",e.PortalUser="PORTAL_USER",e.ViewOnly="VIEW_ONLY"}(Xi||(Xi={})),function(e){e.Current="current",e.Deprecated="deprecated",e.Dev="dev",e.Maintenance="maintenance",e.OldMaintenance="old__maintenance",e.OldPreviousMaintenance="old_previous_maintenance",e.PreviousMaintenance="previous_maintenance",e.ReleaseCandidate="release_candidate"}(Wi||(Wi={})),function(e){e.ChangeColumnValue="change_column_value",e.ChangeName="change_name",e.ChangeSpecificColumnValue="change_specific_column_value",e.ChangeStatusColumnValue="change_status_column_value",e.ChangeSubitemColumnValue="change_subitem_column_value",e.ChangeSubitemName="change_subitem_name",e.CreateColumn="create_column",e.CreateItem="create_item",e.CreateSubitem="create_subitem",e.CreateSubitemUpdate="create_subitem_update",e.CreateUpdate="create_update",e.DeleteUpdate="delete_update",e.EditUpdate="edit_update",e.ItemArchived="item_archived",e.ItemDeleted="item_deleted",e.ItemMovedToAnyGroup="item_moved_to_any_group",e.ItemMovedToSpecificGroup="item_moved_to_specific_group",e.ItemRestored="item_restored",e.MoveSubitem="move_subitem",e.SubitemArchived="subitem_archived",e.SubitemDeleted="subitem_deleted"}(Zi||(Zi={})),function(e){e.Closed="closed",e.Open="open"}(en||(en={})),function(e){e.Owner="owner",e.Subscriber="subscriber"}(pn||(pn={})),function(e){e.CreatedAt="created_at"}(an||(an={})),function(e){e.Query="QUERY",e.Mutation="MUTATION",e.Subscription="SUBSCRIPTION",e.Field="FIELD",e.FragmentDefinition="FRAGMENT_DEFINITION",e.FragmentSpread="FRAGMENT_SPREAD",e.InlineFragment="INLINE_FRAGMENT",e.VariableDefinition="VARIABLE_DEFINITION",e.Schema="SCHEMA",e.Scalar="SCALAR",e.Object="OBJECT",e.FieldDefinition="FIELD_DEFINITION",e.ArgumentDefinition="ARGUMENT_DEFINITION",e.Interface="INTERFACE",e.Union="UNION",e.Enum="ENUM",e.EnumValue="ENUM_VALUE",e.InputObject="INPUT_OBJECT",e.InputFieldDefinition="INPUT_FIELD_DEFINITION"}(dn||(dn={})),function(e){e.Scalar="SCALAR",e.Object="OBJECT",e.Interface="INTERFACE",e.Union="UNION",e.Enum="ENUM",e.InputObject="INPUT_OBJECT",e.List="LIST",e.NonNull="NON_NULL"}(tn||(tn={}));const nn={boardName:a.string().describe("The name of the board to create"),boardKind:a.nativeEnum(si).default(si.Public).describe("The kind of board to create"),boardDescription:a.string().optional().describe("The description of the board to create"),workspaceId:a.string().optional().describe("The ID of the workspace to create the board in")};const on={columnType:a.nativeEnum(vi).describe("The type of the column to be created"),columnTitle:a.string().describe("The title of the column to be created"),columnDescription:a.string().optional().describe("The description of the column to be created"),columnSettings:a.array(a.string()).optional().describe("The default values for the new column (relevant only for column type 'status' or 'dropdown') when possible make the values relevant to the user's request")},rn={boardId:a.number().describe("The id of the board to which the new column will be added"),...on};const sn={columnId:a.string().describe("The id of the column to be deleted")},ln={boardId:a.number().describe("The id of the board to which the new column will be added"),...sn};const mn={query:a.string().describe("Custom GraphQL query/mutation. you need to provide the full query / mutation"),variables:a.string().describe("JSON string containing the variables for the GraphQL operation")};class un extends l{constructor(e,p){super(e,p),this.name="all_monday_api",this.type=s.ALL_API}getDescription(){return"Execute any Monday.com API operation by generating GraphQL queries and mutations dynamically. Make sure you ask only for the fields you need and nothing more. When providing the query/mutation - use get_graphql_schema and get_type_details tools first to understand the schema before crafting your query."}getInputSchema(){return mn}async loadSchema(e){if(un.schemaCache[e])return un.schemaCache[e];try{const p=await this.mondayApi.rawRequest(Gt),{data:a}=p,d=ud(a);return un.schemaCache[e]=d,d}catch(e){throw new Error(`Failed to load GraphQL schema: ${e instanceof Error?e.message:"Unknown error"}`)}}async validateOperation(e,p){var a;return md(await this.loadSchema(p),new ne(e,a).parseDocument()).map((e=>e.message))}async execute(e){const{query:p,variables:a}=e;try{let e={};try{e=JSON.parse(a)}catch(e){return{content:`Error parsing variables: ${e instanceof Error?e.message:"Unknown error"}`}}const d=this.mondayApi.apiVersion,t=await this.validateOperation(p,d);if(t.length>0)return{content:t.join(", ")};const i=await this.mondayApi.request(p,e);return{content:JSON.stringify(i)}}catch(e){const p=e instanceof Error?e.message:"Unknown error";if(e instanceof Error&&"response"in e){const p=e;if(p.response?.errors)return{content:p.response.errors.map((e=>e.message)).join(", ")}}return{content:p}}}}un.schemaCache={};const cn={random_string:a.string().describe("Dummy parameter for no-parameter tools").optional(),operationType:a.enum(["read","write"]).describe('Type of operation: "read" for queries, "write" for mutations').optional()};const vn={typeName:a.string().describe("The name of the GraphQL type to get details for")};function hn(e){return e?"NON_NULL"===e.kind?`${hn(e.ofType)}!`:"LIST"===e.kind?`[${hn(e.ofType)}]`:e.name||"unknown":"unknown"}const fn={color:a.nativeEnum(hi).describe("The color of the custom activity"),icon_id:a.nativeEnum(fi).describe("The icon ID of the custom activity"),name:a.string().describe("The name of the custom activity")};const _n={item_id:a.number().describe("The ID of the item to create the new timeline item on"),custom_activity_id:a.string().describe("The ID of the custom activity for the timeline item"),title:a.string().describe("The title of the new timeline item"),summary:a.string().optional().describe("The summary of the new timeline item (max 255 characters)"),content:a.string().optional().describe("The content of the new timeline item"),timestamp:a.string().describe("The creation time of the new timeline item in ISO8601 format (e.g., 2024-06-06T18:00:30Z)"),start_timestamp:a.string().optional().describe("The start time of the timeline item in ISO8601 format"),end_timestamp:a.string().optional().describe("The end time of the timeline item in ISO8601 format"),location:a.string().optional().describe("The location to add to the new timeline item"),phone:a.string().optional().describe("The phone number to add to the new timeline item"),url:a.string().optional().describe("The URL to add to the new timeline item")};const yn={};const wn=[class extends l{constructor(){super(...arguments),this.name="delete_item",this.type=s.MUTATION}getDescription(){return"Delete an item"}getInputSchema(){return zt}async execute(e){const p={id:e.itemId.toString()},a=await this.mondayApi.request(Lt,p);return{content:`Item ${a.delete_item?.id} successfully deleted`}}},class extends l{constructor(){super(...arguments),this.name="get_board_items_by_name",this.type=s.QUERY}getDescription(){return"Get items by board id and term"}getInputSchema(){return this.context?.boardId?Qt:Kt}async execute(e){const p={boardId:(this.context?.boardId??e.boardId).toString(),term:e.term},a=await this.mondayApi.request(Ct,p);return{content:`Items ${a.boards?.[0]?.items_page?.items?.map((e=>`name: ${e.name}, id: ${e.id}`)).join(", ")} successfully fetched`}}},class extends l{constructor(){super(...arguments),this.name="create_item",this.type=s.MUTATION}getDescription(){return"Create a new item in a monday.com board"}getInputSchema(){return this.context?.boardId?Ht:Xt}async execute(e){const p={boardId:(this.context?.boardId??e.boardId).toString(),itemName:e.name,groupId:e.groupId,columnValues:e.columnValues},a=await this.mondayApi.request(Ft,p);return{content:`Item ${a.create_item?.id} successfully created`}}},class extends l{constructor(){super(...arguments),this.name="create_update",this.type=s.MUTATION}getDescription(){return"Create a new update in a monday.com board"}getInputSchema(){return Wt}async execute(e){const p={itemId:e.itemId.toString(),body:e.body},a=await this.mondayApi.request(xt,p);return{content:`Update ${a.create_update?.id} successfully created on item ${e.itemId}`}}},class extends l{constructor(){super(...arguments),this.name="get_board_schema",this.type=s.QUERY}getDescription(){return"Get board schema (columns and groups) by board id"}getInputSchema(){if(!this.context?.boardId)return Zt}async execute(e){const p=this.context?.boardId??e.boardId,a={boardId:p.toString()},d=await this.mondayApi.request(kt,a);return{content:`The current schema of the board ${p} is: \n \n\nColumns:\n ${d.boards?.[0]?.columns?.map((e=>`Id - ${e?.id}\n Title - ${e?.title}\n Type - ${e?.type}`)).join("\n")}\n \n\nGroups:\n ${d.boards?.[0]?.groups?.map((e=>`Id - ${e?.id}\n Title - ${e?.title}`)).join("\n")}`}}},class extends l{constructor(){super(...arguments),this.name="get_users_by_name",this.type=s.QUERY}getDescription(){return"Get users, can be filtered by name or partial name"}getInputSchema(){return ei}async execute(e){const p={name:e.name},a=await this.mondayApi.request(Rt,p);return{content:`Relevant users:\n ${a.users?.map((e=>` id: ${e?.id}, name: ${e?.name}, title: ${e?.title}`)).join("\n")}`}}},class extends l{constructor(){super(...arguments),this.name="change_item_column_values",this.type=s.MUTATION}getDescription(){return"Change the column values of an item in a monday.com board"}getInputSchema(){return this.context?.boardId?pi:ai}async execute(e){const p={boardId:(this.context?.boardId??e.boardId).toString(),itemId:e.itemId.toString(),columnValues:e.columnValues},a=await this.mondayApi.request($t,p);return{content:`Item ${a.change_multiple_column_values?.id} successfully updated with the new column values`}}},class extends l{constructor(){super(...arguments),this.name="move_item_to_group",this.type=s.MUTATION}getDescription(){return"Move an item to a group in a monday.com board"}getInputSchema(){return di}async execute(e){const p={itemId:e.itemId.toString(),groupId:e.groupId},a=await this.mondayApi.request(Ut,p);return{content:`Item ${a.move_item_to_group?.id} successfully moved to group ${e.groupId}`}}},class extends l{constructor(){super(...arguments),this.name="create_board",this.type=s.MUTATION}getDescription(){return"Create a monday.com board"}getInputSchema(){return nn}async execute(e){const p={boardName:e.boardName,boardKind:e.boardKind,boardDescription:e.boardDescription,workspaceId:e.workspaceId},a=await this.mondayApi.request(Pt,p);return{content:`Board ${a.create_board?.id} successfully created`}}},class extends l{constructor(){super(...arguments),this.name="create_column",this.type=s.MUTATION}getDescription(){return"Create a new column in a monday.com board"}getInputSchema(){return this.context?.boardId?on:rn}async execute(e){const p=this.context?.boardId??e.boardId;let a;e.columnSettings&&e.columnType===vi.Status?a=JSON.stringify({labels:Object.fromEntries(e.columnSettings.map(((e,p)=>[String(p+1),e])))}):e.columnSettings&&e.columnType===vi.Dropdown&&(a=JSON.stringify({settings:{labels:e.columnSettings.map(((e,p)=>({id:p+1,name:e})))}}));const d={boardId:p.toString(),columnType:e.columnType,columnTitle:e.columnTitle,columnDescription:e.columnDescription,columnSettings:a},t=await this.mondayApi.request(Bt,d);return{content:`Column ${t.create_column?.id} successfully created`}}},class extends l{constructor(){super(...arguments),this.name="delete_column",this.type=s.MUTATION}getDescription(){return"Delete a column from a monday.com board"}getInputSchema(){return this.context?.boardId?sn:ln}async execute(e){const p={boardId:(this.context?.boardId??e.boardId).toString(),columnId:e.columnId},a=await this.mondayApi.request(jt,p);return{content:`Column ${a.delete_column?.id} successfully deleted`}}},un,class extends l{constructor(){super(...arguments),this.name="get_graphql_schema",this.type=s.ALL_API}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 cn}async execute(e){try{const p=await this.mondayApi.request(Mt),a=e?.operationType,d=p.queryType?.fields?.map((e=>`- ${e.name}${e.description?`: ${e.description}`:""}`)).join("\n")||"No query fields found",t=p.mutationType?.fields?.map((e=>`- ${e.name}${e.description?`: ${e.description}`:""}`)).join("\n")||"No mutation fields found",i=p.__schema,n=i?.types?.filter((e=>e.name&&!e.name.startsWith("__"))).map((e=>`- ${e.name} (${e.kind||"unknown"})`)).join("\n")||"No types found";let o="## GraphQL Schema\n";return a&&"read"!==a||(o+=`- Query Type: ${p.__schema?.queryType?.name}\n\n`,o+=`## Query Fields\n${d}\n\n`),a&&"write"!==a||(o+=`- Mutation Type: ${p.__schema?.mutationType?.name}\n\n`,o+=`## Mutation Fields\n${t}\n\n`),o+=`## Available Types\n${n}\n\n`,o+='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:o}}catch(e){return{content:`Error fetching GraphQL schema: ${e instanceof Error?e.message:"Unknown error"}`}}}},class extends l{constructor(){super(...arguments),this.name="get_type_details",this.type=s.ALL_API}getDescription(){return"Get detailed information about a specific GraphQL type from the Monday.com API schema"}getInputSchema(){return vn}async execute(e){try{if(!e.typeName)return{content:"Error: typeName is required. Please provide a valid GraphQL type name."};const a=(p=e.typeName,Vt`
|
|
308
308
|
query getTypeDetails {
|
|
309
309
|
__type(name: "${p}") {
|
|
310
310
|
name
|