@mondaydotcomorg/agent-toolkit 2.0.8 → 2.0.9
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 +1 -1
- package/dist/cjs/mcp/index.js +1 -1
- package/dist/cjs/mcp/index.js.map +1 -1
- package/dist/cjs/openai/index.d.ts +1 -1
- package/dist/cjs/openai/index.js +1 -1
- package/dist/cjs/openai/index.js.map +1 -1
- package/dist/esm/mcp/index.d.ts +1 -1
- package/dist/esm/mcp/index.js +1 -1
- package/dist/esm/mcp/index.js.map +1 -1
- package/dist/esm/openai/index.d.ts +1 -1
- package/dist/esm/openai/index.js +3 -3
- package/dist/esm/openai/index.js.map +1 -1
- package/package.json +1 -1
package/dist/esm/mcp/index.d.ts
CHANGED
package/dist/esm/mcp/index.js
CHANGED
|
@@ -392,5 +392,5 @@ import{z as e,ZodType as a}from"zod";import{zodToJsonSchema as p}from"zod-to-jso
|
|
|
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=Kr(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=Kr(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=Kr(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 He{constructor(){super(...arguments),this.name="create_custom_activity",this.type=Ge.MUTATION}getDescription(){return"Create a new custom activity in the E&A app"}getInputSchema(){return Xr}async execute(e){const a={color:e.color,icon_id:e.icon_id,name:e.name};return await this.mondayApi.request(Sn,a),{content:`Custom activity '${e.name}' with color ${e.color} and icon ${e.icon_id} successfully created`}}},class extends He{constructor(){super(...arguments),this.name="create_timeline_item",this.type=Ge.MUTATION}getDescription(){return"Create a new timeline item in the E&A app"}getInputSchema(){return Wr}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(Dn,a);return{content:`Timeline item '${e.title}' with ID ${p.create_timeline_item?.id} successfully created on item ${e.item_id}`}}},class extends He{constructor(){super(...arguments),this.name="fetch_custom_activity",this.type=Ge.QUERY}getDescription(){return"Get custom activities from the E&A app"}getInputSchema(){return Zr}async execute(e){const a=await this.mondayApi.request(An);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)}`}}}];class as extends Be{constructor(a){super({name:"monday.com",version:"1.0.0"}),this.mondayApiClient=new t({token:a.mondayApiToken,apiVersion:a.mondayApiVersion,requestConfig:{...a.mondayApiRequestConfig,headers:{...a.mondayApiRequestConfig?.headers||{},"user-agent":"monday-api-mcp"}}});const p=function(e,a,p){if(!p)return e;let t=e;return p.enableDynamicApiTools&&!p.readOnlyMode
|
|
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=Kr(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=Kr(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=Kr(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 He{constructor(){super(...arguments),this.name="create_custom_activity",this.type=Ge.MUTATION}getDescription(){return"Create a new custom activity in the E&A app"}getInputSchema(){return Xr}async execute(e){const a={color:e.color,icon_id:e.icon_id,name:e.name};return await this.mondayApi.request(Sn,a),{content:`Custom activity '${e.name}' with color ${e.color} and icon ${e.icon_id} successfully created`}}},class extends He{constructor(){super(...arguments),this.name="create_timeline_item",this.type=Ge.MUTATION}getDescription(){return"Create a new timeline item in the E&A app"}getInputSchema(){return Wr}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(Dn,a);return{content:`Timeline item '${e.title}' with ID ${p.create_timeline_item?.id} successfully created on item ${e.item_id}`}}},class extends He{constructor(){super(...arguments),this.name="fetch_custom_activity",this.type=Ge.QUERY}getDescription(){return"Get custom activities from the E&A app"}getInputSchema(){return Zr}async execute(e){const a=await this.mondayApi.request(An);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)}`}}}];class as extends Be{constructor(a){super({name:"monday.com",version:"1.0.0"}),this.mondayApiClient=new t({token:a.mondayApiToken,apiVersion:a.mondayApiVersion,requestConfig:{...a.mondayApiRequestConfig,headers:{...a.mondayApiRequestConfig?.headers||{},"user-agent":"monday-api-mcp"}}});const p=function(e,a,p){if(!p)return e;let t=e;return p.enableDynamicApiTools&&!p.readOnlyMode?"only"===p.enableDynamicApiTools?e.filter((e=>new e(a).type===Ge.ALL_API)):t:(t=t.filter((e=>new e(a).type!==Ge.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===Ge.QUERY))),t)}(es,this.mondayApiClient,a.toolsConfiguration);p.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.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}}export{as as MondayAgentToolkit};
|
|
396
396
|
//# sourceMappingURL=index.js.map
|