@mondaydotcomorg/agent-toolkit 2.0.2 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/mcp/index.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ type MondayAgentToolkitConfig = {
|
|
|
17
17
|
declare class MondayAgentToolkit extends McpServer {
|
|
18
18
|
private readonly mondayApiClient;
|
|
19
19
|
constructor(config: MondayAgentToolkitConfig);
|
|
20
|
+
getServer(): McpServer;
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
export { MondayAgentToolkit, MondayAgentToolkitConfig };
|
package/dist/cjs/mcp/index.js
CHANGED
|
@@ -392,5 +392,5 @@
|
|
|
392
392
|
}
|
|
393
393
|
}
|
|
394
394
|
}
|
|
395
|
-
`),t=await this.mondayApi.request(p);if(!t.__type)return{content:`Type '${e.typeName}' not found in the GraphQL schema. Please check the type name and try again.`};let d=`## Type: ${t.__type.name||"Unnamed"} ${e.typeName===t.__type.name?"":`(queried: ${e.typeName})`}\nKind: ${t.__type.kind}\n${t.__type.description?`Description: ${t.__type.description}`:""}\n\n`;return t.__type.fields&&t.__type.fields.length>0&&(d+="## Fields\n",t.__type.fields.forEach((e=>{const a=as(e.type);d+=`- ${e.name}: ${a}${e.description?` - ${e.description}`:""}\n`,e.args&&e.args.length>0&&(d+=" Arguments:\n",e.args.forEach((e=>{const a=as(e.type);d+=` - ${e.name}: ${a}${e.description?` - ${e.description}`:""}${e.defaultValue?` (default: ${e.defaultValue})`:""}\n`})))})),d+="\n"),t.__type.inputFields&&t.__type.inputFields.length>0&&(d+="## Input Fields\n",t.__type.inputFields.forEach((e=>{const a=as(e.type);d+=`- ${e.name}: ${a}${e.description?` - ${e.description}`:""}${e.defaultValue?` (default: ${e.defaultValue})`:""}\n`})),d+="\n"),t.__type.interfaces&&t.__type.interfaces.length>0&&(d+="## Implements\n",t.__type.interfaces.forEach((e=>{d+=`- ${e.name}\n`})),d+="\n"),t.__type.enumValues&&t.__type.enumValues.length>0&&(d+="## Enum Values\n",t.__type.enumValues.forEach((e=>{d+=`- ${e.name}${e.description?` - ${e.description}`:""}\n`})),d+="\n"),t.__type.possibleTypes&&t.__type.possibleTypes.length>0&&(d+="## Possible Types\n",t.__type.possibleTypes.forEach((e=>{d+=`- ${e.name}\n`}))),d+=`\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\\": \\"${t.__type.name}\\"}")\n\nExample for object field access:\nWhen querying objects that have this type, include these fields in your query.\n`,{content:d}}catch(e){const a=e instanceof Error?e.message:"Unknown error",p=a.includes("JSON");return{content:`Error fetching type details: ${a}${p?"\n\nThis could be because the type name is incorrect or the GraphQL query format is invalid. Please check the type name and try again.":""}`}}var a}},class extends Xe{constructor(){super(...arguments),this.name="create_custom_activity",this.type=Ke.MUTATION}getDescription(){return"Create a new custom activity in the E&A app"}getInputSchema(){return ps}async execute(e){const a={color:e.color,icon_id:e.icon_id,name:e.name};return await this.mondayApi.request(Cn,a),{content:`Custom activity '${e.name}' with color ${e.color} and icon ${e.icon_id} successfully created`}}},class extends Xe{constructor(){super(...arguments),this.name="create_timeline_item",this.type=Ke.MUTATION}getDescription(){return"Create a new timeline item in the E&A app"}getInputSchema(){return ts}async execute(e){const a={item_id:e.item_id.toString(),custom_activity_id:e.custom_activity_id,title:e.title,timestamp:e.timestamp,summary:e.summary,content:e.content,location:e.location,phone:e.phone,url:e.url};e.start_timestamp&&e.end_timestamp&&(a.time_range={start_timestamp:e.start_timestamp,end_timestamp:e.end_timestamp});const p=await this.mondayApi.request(xn,a);return{content:`Timeline item '${e.title}' with ID ${p.create_timeline_item?.id} successfully created on item ${e.item_id}`}}},class extends Xe{constructor(){super(...arguments),this.name="fetch_custom_activity",this.type=Ke.QUERY}getDescription(){return"Get custom activities from the E&A app"}getInputSchema(){return ds}async execute(e){const a=await this.mondayApi.request(Rn);if(!a.custom_activity||0===a.custom_activity.length)return{content:"No custom activities found"};const p=a.custom_activity.map((e=>({id:e.id,name:e.name,color:e.color,icon_id:e.icon_id,type:e.type})));return{content:`Found ${p.length} custom activities: ${JSON.stringify(p,null,2)}`}}}];exports.MondayAgentToolkit=class extends He{constructor(a){super({name:"monday.com",version:"1.0.0"}),this.mondayApiClient=new p.ApiClient({token:a.mondayApiToken,apiVersion:a.mondayApiVersion,requestConfig:{...a.mondayApiRequestConfig,headers:{...a.mondayApiRequestConfig?.headers||{},"user-agent":"monday-api-mcp"}}});const t=function(e,a,p){if(!p)return e;let t=e;return p.enableDynamicApiTools&&!p.readOnlyMode||(t=t.filter((e=>new e(a).type!==Ke.ALL_API)),p.include?t=e.filter((e=>{const t=new e(a);return p.include?.includes(t.name)})):p.exclude&&(t=e.filter((e=>{const t=new e(a);return!p.exclude?.includes(t.name)}))),p.readOnlyMode&&(t=t.filter((e=>new e(a).type===Ke.QUERY)))),t}(is,this.mondayApiClient,a.toolsConfiguration);t.map((e=>new e(this.mondayApiClient))).forEach((a=>{const p=a.getInputSchema();p?this.tool(a.name,a.getDescription(),p,(async(t,d)=>{const i=e.z.object(p).safeParse(t);if(!i.success)throw new Error(`Invalid arguments: ${i.error.message}`);return{content:[{type:"text",text:(await a.execute(i.data)).content}]}})):this.tool(a.name,a.getDescription(),(async e=>({content:[{type:"text",text:(await a.execute()).content}]})))}))}};
|
|
395
|
+
`),t=await this.mondayApi.request(p);if(!t.__type)return{content:`Type '${e.typeName}' not found in the GraphQL schema. Please check the type name and try again.`};let d=`## Type: ${t.__type.name||"Unnamed"} ${e.typeName===t.__type.name?"":`(queried: ${e.typeName})`}\nKind: ${t.__type.kind}\n${t.__type.description?`Description: ${t.__type.description}`:""}\n\n`;return t.__type.fields&&t.__type.fields.length>0&&(d+="## Fields\n",t.__type.fields.forEach((e=>{const a=as(e.type);d+=`- ${e.name}: ${a}${e.description?` - ${e.description}`:""}\n`,e.args&&e.args.length>0&&(d+=" Arguments:\n",e.args.forEach((e=>{const a=as(e.type);d+=` - ${e.name}: ${a}${e.description?` - ${e.description}`:""}${e.defaultValue?` (default: ${e.defaultValue})`:""}\n`})))})),d+="\n"),t.__type.inputFields&&t.__type.inputFields.length>0&&(d+="## Input Fields\n",t.__type.inputFields.forEach((e=>{const a=as(e.type);d+=`- ${e.name}: ${a}${e.description?` - ${e.description}`:""}${e.defaultValue?` (default: ${e.defaultValue})`:""}\n`})),d+="\n"),t.__type.interfaces&&t.__type.interfaces.length>0&&(d+="## Implements\n",t.__type.interfaces.forEach((e=>{d+=`- ${e.name}\n`})),d+="\n"),t.__type.enumValues&&t.__type.enumValues.length>0&&(d+="## Enum Values\n",t.__type.enumValues.forEach((e=>{d+=`- ${e.name}${e.description?` - ${e.description}`:""}\n`})),d+="\n"),t.__type.possibleTypes&&t.__type.possibleTypes.length>0&&(d+="## Possible Types\n",t.__type.possibleTypes.forEach((e=>{d+=`- ${e.name}\n`}))),d+=`\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\\": \\"${t.__type.name}\\"}")\n\nExample for object field access:\nWhen querying objects that have this type, include these fields in your query.\n`,{content:d}}catch(e){const a=e instanceof Error?e.message:"Unknown error",p=a.includes("JSON");return{content:`Error fetching type details: ${a}${p?"\n\nThis could be because the type name is incorrect or the GraphQL query format is invalid. Please check the type name and try again.":""}`}}var a}},class extends Xe{constructor(){super(...arguments),this.name="create_custom_activity",this.type=Ke.MUTATION}getDescription(){return"Create a new custom activity in the E&A app"}getInputSchema(){return ps}async execute(e){const a={color:e.color,icon_id:e.icon_id,name:e.name};return await this.mondayApi.request(Cn,a),{content:`Custom activity '${e.name}' with color ${e.color} and icon ${e.icon_id} successfully created`}}},class extends Xe{constructor(){super(...arguments),this.name="create_timeline_item",this.type=Ke.MUTATION}getDescription(){return"Create a new timeline item in the E&A app"}getInputSchema(){return ts}async execute(e){const a={item_id:e.item_id.toString(),custom_activity_id:e.custom_activity_id,title:e.title,timestamp:e.timestamp,summary:e.summary,content:e.content,location:e.location,phone:e.phone,url:e.url};e.start_timestamp&&e.end_timestamp&&(a.time_range={start_timestamp:e.start_timestamp,end_timestamp:e.end_timestamp});const p=await this.mondayApi.request(xn,a);return{content:`Timeline item '${e.title}' with ID ${p.create_timeline_item?.id} successfully created on item ${e.item_id}`}}},class extends Xe{constructor(){super(...arguments),this.name="fetch_custom_activity",this.type=Ke.QUERY}getDescription(){return"Get custom activities from the E&A app"}getInputSchema(){return ds}async execute(e){const a=await this.mondayApi.request(Rn);if(!a.custom_activity||0===a.custom_activity.length)return{content:"No custom activities found"};const p=a.custom_activity.map((e=>({id:e.id,name:e.name,color:e.color,icon_id:e.icon_id,type:e.type})));return{content:`Found ${p.length} custom activities: ${JSON.stringify(p,null,2)}`}}}];exports.MondayAgentToolkit=class extends He{constructor(a){super({name:"monday.com",version:"1.0.0"}),this.mondayApiClient=new p.ApiClient({token:a.mondayApiToken,apiVersion:a.mondayApiVersion,requestConfig:{...a.mondayApiRequestConfig,headers:{...a.mondayApiRequestConfig?.headers||{},"user-agent":"monday-api-mcp"}}});const t=function(e,a,p){if(!p)return e;let t=e;return p.enableDynamicApiTools&&!p.readOnlyMode||(t=t.filter((e=>new e(a).type!==Ke.ALL_API)),p.include?t=e.filter((e=>{const t=new e(a);return p.include?.includes(t.name)})):p.exclude&&(t=e.filter((e=>{const t=new e(a);return!p.exclude?.includes(t.name)}))),p.readOnlyMode&&(t=t.filter((e=>new e(a).type===Ke.QUERY)))),t}(is,this.mondayApiClient,a.toolsConfiguration);t.map((e=>new e(this.mondayApiClient))).forEach((a=>{const p=a.getInputSchema();p?this.tool(a.name,a.getDescription(),p,(async(t,d)=>{const i=e.z.object(p).safeParse(t);if(!i.success)throw new Error(`Invalid arguments: ${i.error.message}`);return{content:[{type:"text",text:(await a.execute(i.data)).content}]}})):this.tool(a.name,a.getDescription(),(async e=>({content:[{type:"text",text:(await a.execute()).content}]})))}))}getServer(){return this}};
|
|
396
396
|
//# sourceMappingURL=index.js.map
|