From 79a70c768f70612dd6d32139d44ccd121a362012 Mon Sep 17 00:00:00 2001 From: Vikhyath Mondreti Date: Sat, 10 Jan 2026 23:04:31 -0800 Subject: [PATCH 1/2] improvement(block-outputs):display metadata properties destructured --- apps/docs/components/ui/icon-mapping.ts | 13 +- apps/docs/content/docs/en/tools/apollo.mdx | 75 +- apps/docs/content/docs/en/tools/cursor.mdx | 186 --- apps/docs/content/docs/en/tools/cursor_v2.mdx | 183 +++ apps/docs/content/docs/en/tools/github.mdx | 1177 ----------------- apps/docs/content/docs/en/tools/github_v2.mdx | 20 + apps/docs/content/docs/en/tools/gmail.mdx | 280 ---- apps/docs/content/docs/en/tools/gmail_v2.mdx | 394 ++++++ .../content/docs/en/tools/google_calendar.mdx | 146 -- .../docs/en/tools/google_calendar_v2.mdx | 157 +++ .../content/docs/en/tools/google_drive.mdx | 4 +- apps/docs/content/docs/en/tools/hubspot.mdx | 24 +- apps/docs/content/docs/en/tools/intercom.mdx | 365 ----- .../content/docs/en/tools/intercom_v2.mdx | 790 +++++++++++ apps/docs/content/docs/en/tools/mailchimp.mdx | 139 +- apps/docs/content/docs/en/tools/meta.json | 13 +- apps/docs/content/docs/en/tools/notion.mdx | 180 --- apps/docs/content/docs/en/tools/notion_v2.mdx | 194 +++ apps/docs/content/docs/en/tools/pipedrive.mdx | 27 +- apps/docs/content/docs/en/tools/posthog.mdx | 8 +- .../docs/content/docs/en/tools/salesforce.mdx | 78 +- apps/docs/content/docs/en/tools/stripe.mdx | 3 - apps/docs/content/docs/en/tools/thinking.mdx | 56 - apps/docs/content/docs/en/tools/zendesk.mdx | 68 +- .../components/tag-dropdown/tag-dropdown.tsx | 4 +- .../components/tool-input/tool-input.tsx | 1 + .../components/search-modal/search-modal.tsx | 4 +- apps/sim/blocks/blocks/cursor.ts | 43 +- apps/sim/blocks/blocks/github.ts | 44 +- apps/sim/blocks/blocks/gmail.ts | 122 +- apps/sim/blocks/blocks/google_calendar.ts | 54 +- apps/sim/blocks/blocks/intercom.ts | 109 +- apps/sim/blocks/blocks/notion.ts | 125 +- apps/sim/blocks/blocks/wealthbox.ts | 2 +- apps/sim/blocks/registry.ts | 18 +- apps/sim/blocks/utils.ts | 35 + apps/sim/tools/apollo/account_bulk_create.ts | 22 +- apps/sim/tools/apollo/account_bulk_update.ts | 22 +- apps/sim/tools/apollo/account_create.ts | 6 +- apps/sim/tools/apollo/account_search.ts | 15 +- apps/sim/tools/apollo/account_update.ts | 6 +- apps/sim/tools/apollo/contact_bulk_create.ts | 22 +- apps/sim/tools/apollo/contact_bulk_update.ts | 22 +- apps/sim/tools/apollo/contact_create.ts | 6 +- apps/sim/tools/apollo/contact_search.ts | 15 +- apps/sim/tools/apollo/contact_update.ts | 6 +- apps/sim/tools/apollo/email_accounts.ts | 6 +- apps/sim/tools/apollo/opportunity_create.ts | 6 +- apps/sim/tools/apollo/opportunity_get.ts | 6 +- apps/sim/tools/apollo/opportunity_search.ts | 15 +- apps/sim/tools/apollo/opportunity_update.ts | 6 +- .../tools/apollo/organization_bulk_enrich.ts | 12 +- apps/sim/tools/apollo/organization_enrich.ts | 9 +- apps/sim/tools/apollo/organization_search.ts | 15 +- apps/sim/tools/apollo/people_bulk_enrich.ts | 12 +- apps/sim/tools/apollo/people_enrich.ts | 6 +- apps/sim/tools/apollo/people_search.ts | 15 +- .../sim/tools/apollo/sequence_add_contacts.ts | 12 +- apps/sim/tools/apollo/sequence_search.ts | 15 +- apps/sim/tools/apollo/task_create.ts | 6 +- apps/sim/tools/apollo/task_search.ts | 15 +- apps/sim/tools/apollo/types.ts | 150 +-- apps/sim/tools/cursor/add_followup.ts | 53 +- apps/sim/tools/cursor/delete_agent.ts | 49 +- apps/sim/tools/cursor/get_agent.ts | 68 +- apps/sim/tools/cursor/get_conversation.ts | 56 +- apps/sim/tools/cursor/index.ts | 22 +- apps/sim/tools/cursor/launch_agent.ts | 56 +- apps/sim/tools/cursor/list_agents.ts | 53 +- apps/sim/tools/cursor/stop_agent.ts | 49 +- apps/sim/tools/github/add_assignees.ts | 43 + apps/sim/tools/github/add_labels.ts | 37 + apps/sim/tools/github/cancel_workflow_run.ts | 23 + apps/sim/tools/github/close_issue.ts | 47 + apps/sim/tools/github/close_pr.ts | 49 + apps/sim/tools/github/comment.ts | 39 + apps/sim/tools/github/create_branch.ts | 29 + apps/sim/tools/github/create_file.ts | 24 + apps/sim/tools/github/create_issue.ts | 47 + apps/sim/tools/github/create_pr.ts | 49 + apps/sim/tools/github/create_project.ts | 42 + apps/sim/tools/github/create_release.ts | 46 + apps/sim/tools/github/delete_branch.ts | 25 + apps/sim/tools/github/delete_comment.ts | 24 + apps/sim/tools/github/delete_file.ts | 25 + apps/sim/tools/github/delete_project.ts | 39 + apps/sim/tools/github/delete_release.ts | 24 + apps/sim/tools/github/get_branch.ts | 31 + .../sim/tools/github/get_branch_protection.ts | 46 + apps/sim/tools/github/get_file_content.ts | 54 + apps/sim/tools/github/get_issue.ts | 51 + apps/sim/tools/github/get_pr_files.ts | 42 + apps/sim/tools/github/get_project.ts | 83 ++ apps/sim/tools/github/get_release.ts | 49 + apps/sim/tools/github/get_tree.ts | 50 + apps/sim/tools/github/get_workflow.ts | 41 + apps/sim/tools/github/get_workflow_run.ts | 57 + apps/sim/tools/github/index.ts | 162 ++- apps/sim/tools/github/issue_comment.ts | 32 + apps/sim/tools/github/latest_commit.ts | 31 + apps/sim/tools/github/list_branches.ts | 36 + apps/sim/tools/github/list_issue_comments.ts | 39 + apps/sim/tools/github/list_issues.ts | 46 + apps/sim/tools/github/list_pr_comments.ts | 42 + apps/sim/tools/github/list_projects.ts | 60 + apps/sim/tools/github/list_prs.ts | 43 + apps/sim/tools/github/list_releases.ts | 45 + apps/sim/tools/github/list_workflow_runs.ts | 44 + apps/sim/tools/github/list_workflows.ts | 42 + apps/sim/tools/github/merge_pr.ts | 27 + apps/sim/tools/github/pr.ts | 76 ++ apps/sim/tools/github/remove_label.ts | 21 + apps/sim/tools/github/repo_info.ts | 67 + apps/sim/tools/github/request_reviewers.ts | 32 + apps/sim/tools/github/rerun_workflow.ts | 23 + apps/sim/tools/github/trigger_workflow.ts | 21 + .../tools/github/update_branch_protection.ts | 36 + apps/sim/tools/github/update_comment.ts | 32 + apps/sim/tools/github/update_file.ts | 24 + apps/sim/tools/github/update_issue.ts | 46 + apps/sim/tools/github/update_pr.ts | 46 + apps/sim/tools/github/update_project.ts | 42 + apps/sim/tools/github/update_release.ts | 42 + apps/sim/tools/gmail/add_label.ts | 33 + apps/sim/tools/gmail/archive.ts | 33 + apps/sim/tools/gmail/delete.ts | 33 + apps/sim/tools/gmail/draft.ts | 40 + apps/sim/tools/gmail/index.ts | 36 +- apps/sim/tools/gmail/mark_read.ts | 33 + apps/sim/tools/gmail/mark_unread.ts | 33 + apps/sim/tools/gmail/move.ts | 39 + apps/sim/tools/gmail/read.ts | 72 + apps/sim/tools/gmail/remove_label.ts | 33 + apps/sim/tools/gmail/search.ts | 38 + apps/sim/tools/gmail/send.ts | 44 + apps/sim/tools/gmail/unarchive.ts | 33 + apps/sim/tools/google_calendar/create.ts | 61 + apps/sim/tools/google_calendar/get.ts | 60 + apps/sim/tools/google_calendar/index.ts | 16 +- apps/sim/tools/google_calendar/invite.ts | 159 +++ apps/sim/tools/google_calendar/list.ts | 52 + apps/sim/tools/google_calendar/quick_add.ts | 145 +- apps/sim/tools/google_docs/create.ts | 6 + apps/sim/tools/google_docs/read.ts | 11 +- apps/sim/tools/google_docs/write.ts | 6 + apps/sim/tools/google_sheets/append.ts | 9 +- apps/sim/tools/google_sheets/read.ts | 9 +- apps/sim/tools/google_sheets/update.ts | 9 +- apps/sim/tools/google_sheets/write.ts | 9 +- apps/sim/tools/hubspot/create_company.ts | 7 +- apps/sim/tools/hubspot/create_contact.ts | 7 +- apps/sim/tools/hubspot/get_company.ts | 7 +- apps/sim/tools/hubspot/get_contact.ts | 7 +- apps/sim/tools/hubspot/get_users.ts | 7 +- apps/sim/tools/hubspot/list_companies.ts | 3 +- apps/sim/tools/hubspot/list_contacts.ts | 3 +- apps/sim/tools/hubspot/list_deals.ts | 3 +- apps/sim/tools/hubspot/search_companies.ts | 25 +- apps/sim/tools/hubspot/search_contacts.ts | 25 +- apps/sim/tools/hubspot/types.ts | 66 +- apps/sim/tools/hubspot/update_company.ts | 7 +- apps/sim/tools/hubspot/update_contact.ts | 7 +- apps/sim/tools/intercom/create_company.ts | 133 +- apps/sim/tools/intercom/create_contact.ts | 141 +- apps/sim/tools/intercom/create_message.ts | 85 +- apps/sim/tools/intercom/create_ticket.ts | 95 +- apps/sim/tools/intercom/delete_contact.ts | 70 +- apps/sim/tools/intercom/get_company.ts | 86 +- apps/sim/tools/intercom/get_contact.ts | 94 +- apps/sim/tools/intercom/get_conversation.ts | 95 +- apps/sim/tools/intercom/get_ticket.ts | 129 +- apps/sim/tools/intercom/index.ts | 41 +- apps/sim/tools/intercom/list_companies.ts | 115 +- apps/sim/tools/intercom/list_contacts.ts | 106 +- apps/sim/tools/intercom/list_conversations.ts | 112 +- apps/sim/tools/intercom/reply_conversation.ts | 98 +- apps/sim/tools/intercom/search_contacts.ts | 173 ++- .../tools/intercom/search_conversations.ts | 111 +- apps/sim/tools/intercom/update_contact.ts | 90 +- apps/sim/tools/mailchimp/add_member.ts | 14 +- apps/sim/tools/mailchimp/add_member_tags.ts | 9 - .../tools/mailchimp/add_or_update_member.ts | 14 +- .../sim/tools/mailchimp/add_segment_member.ts | 11 +- .../mailchimp/add_subscriber_to_automation.ts | 13 +- apps/sim/tools/mailchimp/archive_member.ts | 9 - apps/sim/tools/mailchimp/create_audience.ts | 14 +- .../tools/mailchimp/create_batch_operation.ts | 14 +- apps/sim/tools/mailchimp/create_campaign.ts | 14 +- apps/sim/tools/mailchimp/create_interest.ts | 14 +- .../mailchimp/create_interest_category.ts | 14 +- .../tools/mailchimp/create_landing_page.ts | 14 +- .../sim/tools/mailchimp/create_merge_field.ts | 14 +- apps/sim/tools/mailchimp/create_segment.ts | 14 +- apps/sim/tools/mailchimp/create_template.ts | 14 +- apps/sim/tools/mailchimp/delete_audience.ts | 24 +- .../tools/mailchimp/delete_batch_operation.ts | 25 +- apps/sim/tools/mailchimp/delete_campaign.ts | 24 +- apps/sim/tools/mailchimp/delete_interest.ts | 24 +- .../mailchimp/delete_interest_category.ts | 25 +- .../tools/mailchimp/delete_landing_page.ts | 24 +- apps/sim/tools/mailchimp/delete_member.ts | 24 +- .../sim/tools/mailchimp/delete_merge_field.ts | 24 +- apps/sim/tools/mailchimp/delete_segment.ts | 24 +- apps/sim/tools/mailchimp/delete_template.ts | 24 +- apps/sim/tools/mailchimp/get_audience.ts | 21 +- apps/sim/tools/mailchimp/get_audiences.ts | 30 +- apps/sim/tools/mailchimp/get_automation.ts | 21 +- apps/sim/tools/mailchimp/get_automations.ts | 33 +- .../tools/mailchimp/get_batch_operation.ts | 24 +- .../tools/mailchimp/get_batch_operations.ts | 33 +- apps/sim/tools/mailchimp/get_campaign.ts | 21 +- .../tools/mailchimp/get_campaign_content.ts | 19 +- .../tools/mailchimp/get_campaign_report.ts | 24 +- .../tools/mailchimp/get_campaign_reports.ts | 33 +- apps/sim/tools/mailchimp/get_campaigns.ts | 30 +- apps/sim/tools/mailchimp/get_interest.ts | 21 +- .../mailchimp/get_interest_categories.ts | 33 +- .../tools/mailchimp/get_interest_category.ts | 27 +- apps/sim/tools/mailchimp/get_interests.ts | 30 +- apps/sim/tools/mailchimp/get_landing_page.ts | 24 +- apps/sim/tools/mailchimp/get_landing_pages.ts | 33 +- apps/sim/tools/mailchimp/get_member.ts | 24 +- apps/sim/tools/mailchimp/get_member_tags.ts | 30 +- apps/sim/tools/mailchimp/get_members.ts | 30 +- apps/sim/tools/mailchimp/get_merge_field.ts | 21 +- apps/sim/tools/mailchimp/get_merge_fields.ts | 33 +- apps/sim/tools/mailchimp/get_segment.ts | 21 +- .../tools/mailchimp/get_segment_members.ts | 33 +- apps/sim/tools/mailchimp/get_segments.ts | 30 +- apps/sim/tools/mailchimp/get_template.ts | 21 +- apps/sim/tools/mailchimp/get_templates.ts | 30 +- apps/sim/tools/mailchimp/pause_automation.ts | 12 - .../tools/mailchimp/publish_landing_page.ts | 12 - .../sim/tools/mailchimp/remove_member_tags.ts | 9 - .../tools/mailchimp/remove_segment_member.ts | 12 - .../sim/tools/mailchimp/replicate_campaign.ts | 17 +- apps/sim/tools/mailchimp/schedule_campaign.ts | 29 +- apps/sim/tools/mailchimp/send_campaign.ts | 12 - .../tools/mailchimp/set_campaign_content.ts | 12 - apps/sim/tools/mailchimp/start_automation.ts | 12 - apps/sim/tools/mailchimp/types.ts | 5 +- apps/sim/tools/mailchimp/unarchive_member.ts | 15 +- .../tools/mailchimp/unpublish_landing_page.ts | 12 - .../tools/mailchimp/unschedule_campaign.ts | 12 - apps/sim/tools/mailchimp/update_audience.ts | 12 +- apps/sim/tools/mailchimp/update_campaign.ts | 12 +- apps/sim/tools/mailchimp/update_interest.ts | 15 +- .../mailchimp/update_interest_category.ts | 15 +- .../tools/mailchimp/update_landing_page.ts | 15 +- apps/sim/tools/mailchimp/update_member.ts | 12 +- .../sim/tools/mailchimp/update_merge_field.ts | 15 +- apps/sim/tools/mailchimp/update_segment.ts | 12 +- apps/sim/tools/mailchimp/update_template.ts | 15 +- .../tools/microsoft_planner/create_bucket.ts | 9 +- .../tools/microsoft_planner/create_task.ts | 10 +- .../microsoft_planner/get_task_details.ts | 8 +- .../tools/microsoft_planner/list_buckets.ts | 9 +- .../sim/tools/microsoft_planner/list_plans.ts | 9 +- .../tools/microsoft_planner/read_bucket.ts | 9 +- apps/sim/tools/microsoft_planner/read_plan.ts | 9 +- apps/sim/tools/microsoft_planner/read_task.ts | 10 +- .../tools/microsoft_planner/update_bucket.ts | 9 +- .../tools/microsoft_planner/update_task.ts | 10 +- .../microsoft_planner/update_task_details.ts | 8 +- apps/sim/tools/microsoft_teams/get_message.ts | 16 +- apps/sim/tools/mistral/parser.ts | 11 + apps/sim/tools/notion/create_database.ts | 49 + apps/sim/tools/notion/create_page.ts | 60 + apps/sim/tools/notion/index.ts | 29 +- apps/sim/tools/notion/query_database.ts | 59 + apps/sim/tools/notion/read.ts | 129 ++ apps/sim/tools/notion/read_database.ts | 52 + apps/sim/tools/notion/search.ts | 56 + apps/sim/tools/notion/update_page.ts | 57 + apps/sim/tools/notion/write.ts | 32 + apps/sim/tools/pipedrive/create_activity.ts | 4 - apps/sim/tools/pipedrive/create_deal.ts | 4 - apps/sim/tools/pipedrive/create_lead.ts | 4 - apps/sim/tools/pipedrive/create_project.ts | 4 - apps/sim/tools/pipedrive/delete_lead.ts | 4 - apps/sim/tools/pipedrive/get_activities.ts | 7 +- apps/sim/tools/pipedrive/get_all_deals.ts | 10 +- apps/sim/tools/pipedrive/get_deal.ts | 4 - apps/sim/tools/pipedrive/get_files.ts | 7 +- apps/sim/tools/pipedrive/get_leads.ts | 10 +- apps/sim/tools/pipedrive/get_mail_messages.ts | 7 +- apps/sim/tools/pipedrive/get_mail_thread.ts | 10 +- .../sim/tools/pipedrive/get_pipeline_deals.ts | 10 +- apps/sim/tools/pipedrive/get_pipelines.ts | 7 +- apps/sim/tools/pipedrive/get_projects.ts | 10 +- apps/sim/tools/pipedrive/types.ts | 72 +- apps/sim/tools/pipedrive/update_activity.ts | 4 - apps/sim/tools/pipedrive/update_deal.ts | 4 - apps/sim/tools/pipedrive/update_lead.ts | 4 - apps/sim/tools/posthog/batch_events.ts | 8 +- apps/sim/tools/posthog/evaluate_flags.ts | 18 +- apps/sim/tools/posthog/query.ts | 6 +- apps/sim/tools/registry.ts | 201 +++ apps/sim/tools/salesforce/create_account.ts | 4 - apps/sim/tools/salesforce/create_case.ts | 13 +- apps/sim/tools/salesforce/create_contact.ts | 2 - apps/sim/tools/salesforce/create_lead.ts | 13 +- .../tools/salesforce/create_opportunity.ts | 13 +- apps/sim/tools/salesforce/create_task.ts | 13 +- apps/sim/tools/salesforce/delete_account.ts | 4 - apps/sim/tools/salesforce/delete_case.ts | 12 +- apps/sim/tools/salesforce/delete_contact.ts | 2 - apps/sim/tools/salesforce/delete_lead.ts | 12 +- .../tools/salesforce/delete_opportunity.ts | 12 +- apps/sim/tools/salesforce/delete_task.ts | 12 +- apps/sim/tools/salesforce/describe_object.ts | 11 +- apps/sim/tools/salesforce/get_accounts.ts | 19 +- apps/sim/tools/salesforce/get_cases.ts | 36 +- apps/sim/tools/salesforce/get_contacts.ts | 30 +- apps/sim/tools/salesforce/get_dashboard.ts | 17 +- apps/sim/tools/salesforce/get_leads.ts | 37 +- .../sim/tools/salesforce/get_opportunities.ts | 38 +- apps/sim/tools/salesforce/get_report.ts | 8 +- apps/sim/tools/salesforce/get_tasks.ts | 36 +- apps/sim/tools/salesforce/list_dashboards.ts | 11 +- apps/sim/tools/salesforce/list_objects.ts | 11 +- .../sim/tools/salesforce/list_report_types.ts | 11 +- apps/sim/tools/salesforce/list_reports.ts | 11 +- apps/sim/tools/salesforce/query.ts | 17 +- apps/sim/tools/salesforce/query_more.ts | 17 +- .../sim/tools/salesforce/refresh_dashboard.ts | 14 +- apps/sim/tools/salesforce/run_report.ts | 14 +- apps/sim/tools/salesforce/types.ts | 143 +- apps/sim/tools/salesforce/update_account.ts | 4 - apps/sim/tools/salesforce/update_case.ts | 12 +- apps/sim/tools/salesforce/update_contact.ts | 2 - apps/sim/tools/salesforce/update_lead.ts | 12 +- .../tools/salesforce/update_opportunity.ts | 12 +- apps/sim/tools/salesforce/update_task.ts | 12 +- apps/sim/tools/sentry/events_get.ts | 13 +- apps/sim/tools/sentry/events_list.ts | 56 +- apps/sim/tools/sentry/issues_get.ts | 16 +- apps/sim/tools/sentry/issues_list.ts | 60 +- apps/sim/tools/sentry/issues_update.ts | 6 +- apps/sim/tools/sentry/projects_create.ts | 17 + apps/sim/tools/sentry/projects_get.ts | 19 + apps/sim/tools/sentry/projects_list.ts | 26 +- apps/sim/tools/sentry/projects_update.ts | 8 + apps/sim/tools/sentry/releases_create.ts | 64 + apps/sim/tools/sentry/releases_list.ts | 78 +- apps/sim/tools/sentry/types.ts | 79 +- .../sim/tools/stripe/cancel_payment_intent.ts | 7 + apps/sim/tools/stripe/cancel_subscription.ts | 6 + apps/sim/tools/stripe/capture_charge.ts | 8 + .../tools/stripe/capture_payment_intent.ts | 7 + .../tools/stripe/confirm_payment_intent.ts | 7 + apps/sim/tools/stripe/create_charge.ts | 7 + apps/sim/tools/stripe/create_customer.ts | 5 + apps/sim/tools/stripe/create_invoice.ts | 9 + .../sim/tools/stripe/create_payment_intent.ts | 6 + apps/sim/tools/stripe/create_price.ts | 9 + apps/sim/tools/stripe/create_product.ts | 5 + apps/sim/tools/stripe/create_subscription.ts | 5 + apps/sim/tools/stripe/delete_customer.ts | 8 - apps/sim/tools/stripe/delete_invoice.ts | 8 - apps/sim/tools/stripe/delete_product.ts | 8 - apps/sim/tools/stripe/finalize_invoice.ts | 10 + apps/sim/tools/stripe/list_charges.ts | 4 + apps/sim/tools/stripe/list_customers.ts | 5 + apps/sim/tools/stripe/list_events.ts | 5 + apps/sim/tools/stripe/list_invoices.ts | 5 + apps/sim/tools/stripe/list_payment_intents.ts | 5 + apps/sim/tools/stripe/list_prices.ts | 5 + apps/sim/tools/stripe/list_products.ts | 5 + apps/sim/tools/stripe/list_subscriptions.ts | 5 + apps/sim/tools/stripe/pay_invoice.ts | 10 + apps/sim/tools/stripe/resume_subscription.ts | 6 + apps/sim/tools/stripe/retrieve_charge.ts | 8 + apps/sim/tools/stripe/retrieve_customer.ts | 6 + apps/sim/tools/stripe/retrieve_event.ts | 6 + apps/sim/tools/stripe/retrieve_invoice.ts | 10 + .../tools/stripe/retrieve_payment_intent.ts | 7 + apps/sim/tools/stripe/retrieve_price.ts | 10 + apps/sim/tools/stripe/retrieve_product.ts | 6 + .../sim/tools/stripe/retrieve_subscription.ts | 6 + apps/sim/tools/stripe/search_charges.ts | 5 + apps/sim/tools/stripe/search_customers.ts | 5 + apps/sim/tools/stripe/search_invoices.ts | 5 + .../tools/stripe/search_payment_intents.ts | 5 + apps/sim/tools/stripe/search_prices.ts | 5 + apps/sim/tools/stripe/search_products.ts | 5 + apps/sim/tools/stripe/search_subscriptions.ts | 5 + apps/sim/tools/stripe/send_invoice.ts | 10 + apps/sim/tools/stripe/types.ts | 12 - apps/sim/tools/stripe/update_charge.ts | 7 + apps/sim/tools/stripe/update_customer.ts | 5 + apps/sim/tools/stripe/update_invoice.ts | 9 + .../sim/tools/stripe/update_payment_intent.ts | 6 + apps/sim/tools/stripe/update_price.ts | 9 + apps/sim/tools/stripe/update_product.ts | 5 + apps/sim/tools/stripe/update_subscription.ts | 5 + apps/sim/tools/stripe/void_invoice.ts | 10 + apps/sim/tools/wealthbox/read_contact.ts | 8 +- apps/sim/tools/wealthbox/read_note.ts | 8 +- apps/sim/tools/wealthbox/read_task.ts | 8 +- apps/sim/tools/wealthbox/types.ts | 9 +- apps/sim/tools/wealthbox/utils.ts | 13 +- apps/sim/tools/wealthbox/write_contact.ts | 4 +- apps/sim/tools/wealthbox/write_note.ts | 2 +- apps/sim/tools/wealthbox/write_task.ts | 6 +- .../zendesk/autocomplete_organizations.ts | 38 +- apps/sim/tools/zendesk/create_organization.ts | 14 +- .../zendesk/create_organizations_bulk.ts | 18 +- apps/sim/tools/zendesk/create_ticket.ts | 12 +- apps/sim/tools/zendesk/create_tickets_bulk.ts | 18 +- apps/sim/tools/zendesk/create_user.ts | 12 +- apps/sim/tools/zendesk/create_users_bulk.ts | 18 +- apps/sim/tools/zendesk/delete_organization.ts | 14 +- apps/sim/tools/zendesk/delete_ticket.ts | 12 +- apps/sim/tools/zendesk/delete_user.ts | 12 +- apps/sim/tools/zendesk/get_current_user.ts | 10 +- apps/sim/tools/zendesk/get_organization.ts | 12 +- apps/sim/tools/zendesk/get_organizations.ts | 38 +- apps/sim/tools/zendesk/get_ticket.ts | 10 +- apps/sim/tools/zendesk/get_tickets.ts | 38 +- apps/sim/tools/zendesk/get_user.ts | 10 +- apps/sim/tools/zendesk/get_users.ts | 38 +- apps/sim/tools/zendesk/merge_tickets.ts | 26 +- apps/sim/tools/zendesk/search.ts | 38 +- apps/sim/tools/zendesk/search_count.ts | 7 - apps/sim/tools/zendesk/search_users.ts | 38 +- apps/sim/tools/zendesk/types.ts | 14 +- apps/sim/tools/zendesk/update_organization.ts | 14 +- apps/sim/tools/zendesk/update_ticket.ts | 12 +- apps/sim/tools/zendesk/update_tickets_bulk.ts | 18 +- apps/sim/tools/zendesk/update_user.ts | 14 +- apps/sim/tools/zendesk/update_users_bulk.ts | 18 +- scripts/generate-docs.ts | 415 ++++-- 433 files changed, 10784 insertions(+), 5442 deletions(-) delete mode 100644 apps/docs/content/docs/en/tools/cursor.mdx create mode 100644 apps/docs/content/docs/en/tools/cursor_v2.mdx delete mode 100644 apps/docs/content/docs/en/tools/github.mdx create mode 100644 apps/docs/content/docs/en/tools/github_v2.mdx delete mode 100644 apps/docs/content/docs/en/tools/gmail.mdx create mode 100644 apps/docs/content/docs/en/tools/gmail_v2.mdx delete mode 100644 apps/docs/content/docs/en/tools/google_calendar.mdx create mode 100644 apps/docs/content/docs/en/tools/google_calendar_v2.mdx delete mode 100644 apps/docs/content/docs/en/tools/intercom.mdx create mode 100644 apps/docs/content/docs/en/tools/intercom_v2.mdx delete mode 100644 apps/docs/content/docs/en/tools/notion.mdx create mode 100644 apps/docs/content/docs/en/tools/notion_v2.mdx delete mode 100644 apps/docs/content/docs/en/tools/thinking.mdx diff --git a/apps/docs/components/ui/icon-mapping.ts b/apps/docs/components/ui/icon-mapping.ts index 60d0351e57..2d7b6ffed5 100644 --- a/apps/docs/components/ui/icon-mapping.ts +++ b/apps/docs/components/ui/icon-mapping.ts @@ -16,7 +16,6 @@ import { CirclebackIcon, ClayIcon, ConfluenceIcon, - CursorIcon, DatadogIcon, DiscordIcon, DocumentIcon, @@ -29,10 +28,7 @@ import { EyeIcon, FirecrawlIcon, FirefliesIcon, - GithubIcon, GitLabIcon, - GmailIcon, - GoogleCalendarIcon, GoogleDocsIcon, GoogleDriveIcon, GoogleFormsIcon, @@ -49,7 +45,6 @@ import { HunterIOIcon, ImageIcon, IncidentioIcon, - IntercomIcon, JinaAIIcon, JiraIcon, JiraServiceManagementIcon, @@ -137,7 +132,6 @@ export const blockTypeToIconMap: Record = { circleback: CirclebackIcon, clay: ClayIcon, confluence: ConfluenceIcon, - cursor: CursorIcon, datadog: DatadogIcon, discord: DiscordIcon, dropbox: DropboxIcon, @@ -149,10 +143,7 @@ export const blockTypeToIconMap: Record = { file: DocumentIcon, firecrawl: FirecrawlIcon, fireflies: FirefliesIcon, - github: GithubIcon, gitlab: GitLabIcon, - gmail: GmailIcon, - google_calendar: GoogleCalendarIcon, google_docs: GoogleDocsIcon, google_drive: GoogleDriveIcon, google_forms: GoogleFormsIcon, @@ -170,7 +161,6 @@ export const blockTypeToIconMap: Record = { image_generator: ImageIcon, imap: MailServerIcon, incidentio: IncidentioIcon, - intercom: IntercomIcon, jina: JinaAIIcon, jira: JiraIcon, jira_service_management: JiraServiceManagementIcon, @@ -190,7 +180,7 @@ export const blockTypeToIconMap: Record = { mongodb: MongoDBIcon, mysql: MySQLIcon, neo4j: Neo4jIcon, - notion: NotionIcon, + notion_v2: NotionIcon, onedrive: MicrosoftOneDriveIcon, openai: OpenAIIcon, outlook: OutlookIcon, @@ -226,7 +216,6 @@ export const blockTypeToIconMap: Record = { supabase: SupabaseIcon, tavily: TavilyIcon, telegram: TelegramIcon, - thinking: BrainIcon, translate: TranslateIcon, trello: TrelloIcon, tts: TTSIcon, diff --git a/apps/docs/content/docs/en/tools/apollo.mdx b/apps/docs/content/docs/en/tools/apollo.mdx index 4b9e7b1483..602023ecf5 100644 --- a/apps/docs/content/docs/en/tools/apollo.mdx +++ b/apps/docs/content/docs/en/tools/apollo.mdx @@ -61,7 +61,9 @@ Search Apollo | Parameter | Type | Description | | --------- | ---- | ----------- | | `people` | json | Array of people matching the search criteria | -| `metadata` | json | Pagination information including page, per_page, and total_entries | +| `page` | number | Current page number | +| `per_page` | number | Results per page | +| `total_entries` | number | Total matching entries | ### `apollo_people_enrich` @@ -86,7 +88,7 @@ Enrich data for a single person using Apollo | Parameter | Type | Description | | --------- | ---- | ----------- | | `person` | json | Enriched person data from Apollo | -| `metadata` | json | Enrichment metadata including enriched status | +| `enriched` | boolean | Whether the person was successfully enriched | ### `apollo_people_bulk_enrich` @@ -106,7 +108,8 @@ Enrich data for up to 10 people at once using Apollo | Parameter | Type | Description | | --------- | ---- | ----------- | | `people` | json | Array of enriched people data | -| `metadata` | json | Bulk enrichment metadata including total and enriched counts | +| `total` | number | Total number of people processed | +| `enriched` | number | Number of people successfully enriched | ### `apollo_organization_search` @@ -129,7 +132,9 @@ Search Apollo | Parameter | Type | Description | | --------- | ---- | ----------- | | `organizations` | json | Array of organizations matching the search criteria | -| `metadata` | json | Pagination information including page, per_page, and total_entries | +| `page` | number | Current page number | +| `per_page` | number | Results per page | +| `total_entries` | number | Total matching entries | ### `apollo_organization_enrich` @@ -148,7 +153,7 @@ Enrich data for a single organization using Apollo | Parameter | Type | Description | | --------- | ---- | ----------- | | `organization` | json | Enriched organization data from Apollo | -| `metadata` | json | Enrichment metadata including enriched status | +| `enriched` | boolean | Whether the organization was successfully enriched | ### `apollo_organization_bulk_enrich` @@ -166,7 +171,8 @@ Enrich data for up to 10 organizations at once using Apollo | Parameter | Type | Description | | --------- | ---- | ----------- | | `organizations` | json | Array of enriched organization data | -| `metadata` | json | Bulk enrichment metadata including total and enriched counts | +| `total` | number | Total number of organizations processed | +| `enriched` | number | Number of organizations successfully enriched | ### `apollo_contact_create` @@ -189,7 +195,7 @@ Create a new contact in your Apollo database | Parameter | Type | Description | | --------- | ---- | ----------- | | `contact` | json | Created contact data from Apollo | -| `metadata` | json | Creation metadata including created status | +| `created` | boolean | Whether the contact was successfully created | ### `apollo_contact_update` @@ -213,7 +219,7 @@ Update an existing contact in your Apollo database | Parameter | Type | Description | | --------- | ---- | ----------- | | `contact` | json | Updated contact data from Apollo | -| `metadata` | json | Update metadata including updated status | +| `updated` | boolean | Whether the contact was successfully updated | ### `apollo_contact_search` @@ -234,7 +240,9 @@ Search your team | Parameter | Type | Description | | --------- | ---- | ----------- | | `contacts` | json | Array of contacts matching the search criteria | -| `metadata` | json | Pagination information including page, per_page, and total_entries | +| `page` | number | Current page number | +| `per_page` | number | Results per page | +| `total_entries` | number | Total matching entries | ### `apollo_contact_bulk_create` @@ -254,7 +262,9 @@ Create up to 100 contacts at once in your Apollo database. Supports deduplicatio | --------- | ---- | ----------- | | `created_contacts` | json | Array of newly created contacts | | `existing_contacts` | json | Array of existing contacts \(when deduplication is enabled\) | -| `metadata` | json | Bulk creation metadata including counts of created and existing contacts | +| `total_submitted` | number | Total number of contacts submitted | +| `created` | number | Number of contacts successfully created | +| `existing` | number | Number of existing contacts found | ### `apollo_contact_bulk_update` @@ -273,7 +283,9 @@ Update up to 100 existing contacts at once in your Apollo database. Each contact | --------- | ---- | ----------- | | `updated_contacts` | json | Array of successfully updated contacts | | `failed_contacts` | json | Array of contacts that failed to update | -| `metadata` | json | Bulk update metadata including counts of updated and failed contacts | +| `total_submitted` | number | Total number of contacts submitted | +| `updated` | number | Number of contacts successfully updated | +| `failed` | number | Number of contacts that failed to update | ### `apollo_account_create` @@ -294,7 +306,7 @@ Create a new account (company) in your Apollo database | Parameter | Type | Description | | --------- | ---- | ----------- | | `account` | json | Created account data from Apollo | -| `metadata` | json | Creation metadata including created status | +| `created` | boolean | Whether the account was successfully created | ### `apollo_account_update` @@ -316,7 +328,7 @@ Update an existing account in your Apollo database | Parameter | Type | Description | | --------- | ---- | ----------- | | `account` | json | Updated account data from Apollo | -| `metadata` | json | Update metadata including updated status | +| `updated` | boolean | Whether the account was successfully updated | ### `apollo_account_search` @@ -338,7 +350,9 @@ Search your team | Parameter | Type | Description | | --------- | ---- | ----------- | | `accounts` | json | Array of accounts matching the search criteria | -| `metadata` | json | Pagination information including page, per_page, and total_entries | +| `page` | number | Current page number | +| `per_page` | number | Results per page | +| `total_entries` | number | Total matching entries | ### `apollo_account_bulk_create` @@ -357,7 +371,9 @@ Create up to 100 accounts at once in your Apollo database. Note: Apollo does not | --------- | ---- | ----------- | | `created_accounts` | json | Array of newly created accounts | | `failed_accounts` | json | Array of accounts that failed to create | -| `metadata` | json | Bulk creation metadata including counts of created and failed accounts | +| `total_submitted` | number | Total number of accounts submitted | +| `created` | number | Number of accounts successfully created | +| `failed` | number | Number of accounts that failed to create | ### `apollo_account_bulk_update` @@ -376,7 +392,9 @@ Update up to 1000 existing accounts at once in your Apollo database (higher limi | --------- | ---- | ----------- | | `updated_accounts` | json | Array of successfully updated accounts | | `failed_accounts` | json | Array of accounts that failed to update | -| `metadata` | json | Bulk update metadata including counts of updated and failed accounts | +| `total_submitted` | number | Total number of accounts submitted | +| `updated` | number | Number of accounts successfully updated | +| `failed` | number | Number of accounts that failed to update | ### `apollo_opportunity_create` @@ -400,7 +418,7 @@ Create a new deal for an account in your Apollo database (master key required) | Parameter | Type | Description | | --------- | ---- | ----------- | | `opportunity` | json | Created opportunity data from Apollo | -| `metadata` | json | Creation metadata including created status | +| `created` | boolean | Whether the opportunity was successfully created | ### `apollo_opportunity_search` @@ -423,7 +441,9 @@ Search and list all deals/opportunities in your team | Parameter | Type | Description | | --------- | ---- | ----------- | | `opportunities` | json | Array of opportunities matching the search criteria | -| `metadata` | json | Pagination information including page, per_page, and total_entries | +| `page` | number | Current page number | +| `per_page` | number | Results per page | +| `total_entries` | number | Total matching entries | ### `apollo_opportunity_get` @@ -441,7 +461,7 @@ Retrieve complete details of a specific deal/opportunity by ID | Parameter | Type | Description | | --------- | ---- | ----------- | | `opportunity` | json | Complete opportunity data from Apollo | -| `metadata` | json | Retrieval metadata including found status | +| `found` | boolean | Whether the opportunity was found | ### `apollo_opportunity_update` @@ -465,7 +485,7 @@ Update an existing deal/opportunity in your Apollo database | Parameter | Type | Description | | --------- | ---- | ----------- | | `opportunity` | json | Updated opportunity data from Apollo | -| `metadata` | json | Update metadata including updated status | +| `updated` | boolean | Whether the opportunity was successfully updated | ### `apollo_sequence_search` @@ -486,7 +506,9 @@ Search for sequences/campaigns in your team | Parameter | Type | Description | | --------- | ---- | ----------- | | `sequences` | json | Array of sequences/campaigns matching the search criteria | -| `metadata` | json | Pagination information including page, per_page, and total_entries | +| `page` | number | Current page number | +| `per_page` | number | Results per page | +| `total_entries` | number | Total matching entries | ### `apollo_sequence_add_contacts` @@ -507,7 +529,8 @@ Add contacts to an Apollo sequence | Parameter | Type | Description | | --------- | ---- | ----------- | | `contacts_added` | json | Array of contact IDs added to the sequence | -| `metadata` | json | Sequence metadata including sequence_id and total_added count | +| `sequence_id` | string | ID of the sequence contacts were added to | +| `total_added` | number | Total number of contacts added | ### `apollo_task_create` @@ -530,7 +553,7 @@ Create a new task in Apollo | Parameter | Type | Description | | --------- | ---- | ----------- | | `task` | json | Created task data from Apollo | -| `metadata` | json | Creation metadata including created status | +| `created` | boolean | Whether the task was successfully created | ### `apollo_task_search` @@ -552,7 +575,9 @@ Search for tasks in Apollo | Parameter | Type | Description | | --------- | ---- | ----------- | | `tasks` | json | Array of tasks matching the search criteria | -| `metadata` | json | Pagination information including page, per_page, and total_entries | +| `page` | number | Current page number | +| `per_page` | number | Results per page | +| `total_entries` | number | Total matching entries | ### `apollo_email_accounts` @@ -569,7 +594,7 @@ Get list of team | Parameter | Type | Description | | --------- | ---- | ----------- | | `email_accounts` | json | Array of team email accounts linked in Apollo | -| `metadata` | json | Metadata including total count of email accounts | +| `total` | number | Total count of email accounts | diff --git a/apps/docs/content/docs/en/tools/cursor.mdx b/apps/docs/content/docs/en/tools/cursor.mdx deleted file mode 100644 index 77bab828b0..0000000000 --- a/apps/docs/content/docs/en/tools/cursor.mdx +++ /dev/null @@ -1,186 +0,0 @@ ---- -title: Cursor -description: Launch and manage Cursor cloud agents to work on GitHub repositories ---- - -import { BlockInfoCard } from "@/components/ui/block-info-card" - - - -{/* MANUAL-CONTENT-START:intro */} -[Cursor](https://www.cursor.so/) is an AI IDE and cloud-based platform that lets you launch and manage powerful AI agents able to work directly on your GitHub repositories. Cursor agents can automate development tasks, enhance your team's productivity, and collaborate with you by making code changes, responding to natural language instructions, and maintaining conversation history about their activities. - -With Cursor, you can: - -- **Launch cloud agents for codebases**: Instantly create new AI agents that work on your repositories in the cloud -- **Delegate coding tasks using natural language**: Guide agents with written instructions, amendments, and clarifications -- **Monitor progress and outputs**: Retrieve agent status, view detailed results, and inspect current or completed tasks -- **Access full conversation history**: Review all prompts and AI responses for transparency and auditability -- **Control and manage agent lifecycle**: List active agents, terminate agents, and manage API-based agent launches and follow-ups - -In Sim, the Cursor integration enables your agents and workflows to interact programmatically with Cursor cloud agents. This means you can use Sim to: - -- List all cloud agents and browse their current state (`cursor_list_agents`) -- Retrieve up-to-date status and outputs for any agent (`cursor_get_agent`) -- View the full conversation history for any coding agent (`cursor_get_conversation`) -- Add follow-up instructions or new prompts to a running agent -- Manage and terminate agents as needed - -This integration helps you combine the flexible intelligence of Sim agents with the powerful development automation capabilities of Cursor, making it possible to scale AI-driven development across your projects. -{/* MANUAL-CONTENT-END */} - - -## Usage Instructions - -Interact with Cursor Cloud Agents API to launch AI agents that can work on your GitHub repositories. Supports launching agents, adding follow-up instructions, checking status, viewing conversations, and managing agent lifecycle. - - - -## Tools - -### `cursor_list_agents` - -List all cloud agents for the authenticated user with optional pagination. - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `apiKey` | string | Yes | Cursor API key | -| `limit` | number | No | Number of agents to return \(default: 20, max: 100\) | -| `cursor` | string | No | Pagination cursor from previous response | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable list of agents | -| `metadata` | object | Agent list metadata | - -### `cursor_get_agent` - -Retrieve the current status and results of a cloud agent. - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `apiKey` | string | Yes | Cursor API key | -| `agentId` | string | Yes | Unique identifier for the cloud agent \(e.g., bc_abc123\) | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable agent details | -| `metadata` | object | Agent metadata | - -### `cursor_get_conversation` - -Retrieve the conversation history of a cloud agent, including all user prompts and assistant responses. - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `apiKey` | string | Yes | Cursor API key | -| `agentId` | string | Yes | Unique identifier for the cloud agent \(e.g., bc_abc123\) | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable conversation history | -| `metadata` | object | Conversation metadata | - -### `cursor_launch_agent` - -Start a new cloud agent to work on a GitHub repository with the given instructions. - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `apiKey` | string | Yes | Cursor API key | -| `repository` | string | Yes | GitHub repository URL \(e.g., https://github.com/your-org/your-repo\) | -| `ref` | string | No | Branch, tag, or commit to work from \(defaults to default branch\) | -| `promptText` | string | Yes | The instruction text for the agent | -| `promptImages` | string | No | JSON array of image objects with base64 data and dimensions | -| `model` | string | No | Model to use \(leave empty for auto-selection\) | -| `branchName` | string | No | Custom branch name for the agent to use | -| `autoCreatePr` | boolean | No | Automatically create a PR when the agent finishes | -| `openAsCursorGithubApp` | boolean | No | Open the PR as the Cursor GitHub App | -| `skipReviewerRequest` | boolean | No | Skip requesting reviewers on the PR | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Success message with agent details | -| `metadata` | object | Launch result metadata | - -### `cursor_add_followup` - -Add a follow-up instruction to an existing cloud agent. - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `apiKey` | string | Yes | Cursor API key | -| `agentId` | string | Yes | Unique identifier for the cloud agent \(e.g., bc_abc123\) | -| `followupPromptText` | string | Yes | The follow-up instruction text for the agent | -| `promptImages` | string | No | JSON array of image objects with base64 data and dimensions \(max 5\) | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Success message | -| `metadata` | object | Result metadata | - -### `cursor_stop_agent` - -Stop a running cloud agent. This pauses the agent without deleting it. - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `apiKey` | string | Yes | Cursor API key | -| `agentId` | string | Yes | Unique identifier for the cloud agent \(e.g., bc_abc123\) | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Success message | -| `metadata` | object | Result metadata | - -### `cursor_delete_agent` - -Permanently delete a cloud agent. This action cannot be undone. - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `apiKey` | string | Yes | Cursor API key | -| `agentId` | string | Yes | Unique identifier for the cloud agent \(e.g., bc_abc123\) | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Success message | -| `metadata` | object | Result metadata | - - - -## Notes - -- Category: `tools` -- Type: `cursor` diff --git a/apps/docs/content/docs/en/tools/cursor_v2.mdx b/apps/docs/content/docs/en/tools/cursor_v2.mdx new file mode 100644 index 0000000000..78667455f5 --- /dev/null +++ b/apps/docs/content/docs/en/tools/cursor_v2.mdx @@ -0,0 +1,183 @@ +--- +title: Cursor +description: Agent identifier +--- + +import { BlockInfoCard } from "@/components/ui/block-info-card" + + + + + +## Tools + +### `cursor_list_agents_v2` + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `id` | string | Agent identifier | +| `url` | string | Agent URL \(launch operation\) | +| `name` | string | Agent name | +| `status` | string | Agent status | +| `source` | json | Agent source repository info | +| `target` | json | Agent target branch/PR info | +| `summary` | string | Agent summary | +| `createdAt` | string | Agent creation timestamp | +| `agents` | json | Array of agent objects \(list operation\) | +| `nextCursor` | string | Pagination cursor \(list operation\) | +| `messages` | json | Conversation messages \(get conversation operation\) | + +### `cursor_get_agent_v2` + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `id` | string | Agent identifier | +| `url` | string | Agent URL \(launch operation\) | +| `name` | string | Agent name | +| `status` | string | Agent status | +| `source` | json | Agent source repository info | +| `target` | json | Agent target branch/PR info | +| `summary` | string | Agent summary | +| `createdAt` | string | Agent creation timestamp | +| `agents` | json | Array of agent objects \(list operation\) | +| `nextCursor` | string | Pagination cursor \(list operation\) | +| `messages` | json | Conversation messages \(get conversation operation\) | + +### `cursor_get_conversation_v2` + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `id` | string | Agent identifier | +| `url` | string | Agent URL \(launch operation\) | +| `name` | string | Agent name | +| `status` | string | Agent status | +| `source` | json | Agent source repository info | +| `target` | json | Agent target branch/PR info | +| `summary` | string | Agent summary | +| `createdAt` | string | Agent creation timestamp | +| `agents` | json | Array of agent objects \(list operation\) | +| `nextCursor` | string | Pagination cursor \(list operation\) | +| `messages` | json | Conversation messages \(get conversation operation\) | + +### `cursor_launch_agent_v2` + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `id` | string | Agent identifier | +| `url` | string | Agent URL \(launch operation\) | +| `name` | string | Agent name | +| `status` | string | Agent status | +| `source` | json | Agent source repository info | +| `target` | json | Agent target branch/PR info | +| `summary` | string | Agent summary | +| `createdAt` | string | Agent creation timestamp | +| `agents` | json | Array of agent objects \(list operation\) | +| `nextCursor` | string | Pagination cursor \(list operation\) | +| `messages` | json | Conversation messages \(get conversation operation\) | + +### `cursor_add_followup_v2` + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `id` | string | Agent identifier | +| `url` | string | Agent URL \(launch operation\) | +| `name` | string | Agent name | +| `status` | string | Agent status | +| `source` | json | Agent source repository info | +| `target` | json | Agent target branch/PR info | +| `summary` | string | Agent summary | +| `createdAt` | string | Agent creation timestamp | +| `agents` | json | Array of agent objects \(list operation\) | +| `nextCursor` | string | Pagination cursor \(list operation\) | +| `messages` | json | Conversation messages \(get conversation operation\) | + +### `cursor_stop_agent_v2` + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `id` | string | Agent identifier | +| `url` | string | Agent URL \(launch operation\) | +| `name` | string | Agent name | +| `status` | string | Agent status | +| `source` | json | Agent source repository info | +| `target` | json | Agent target branch/PR info | +| `summary` | string | Agent summary | +| `createdAt` | string | Agent creation timestamp | +| `agents` | json | Array of agent objects \(list operation\) | +| `nextCursor` | string | Pagination cursor \(list operation\) | +| `messages` | json | Conversation messages \(get conversation operation\) | + +### `cursor_delete_agent_v2` + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `id` | string | Agent identifier | +| `url` | string | Agent URL \(launch operation\) | +| `name` | string | Agent name | +| `status` | string | Agent status | +| `source` | json | Agent source repository info | +| `target` | json | Agent target branch/PR info | +| `summary` | string | Agent summary | +| `createdAt` | string | Agent creation timestamp | +| `agents` | json | Array of agent objects \(list operation\) | +| `nextCursor` | string | Pagination cursor \(list operation\) | +| `messages` | json | Conversation messages \(get conversation operation\) | + + + +## Notes + +- Category: `misc` +- Type: `cursor_v2` diff --git a/apps/docs/content/docs/en/tools/github.mdx b/apps/docs/content/docs/en/tools/github.mdx deleted file mode 100644 index 09ed416f87..0000000000 --- a/apps/docs/content/docs/en/tools/github.mdx +++ /dev/null @@ -1,1177 +0,0 @@ ---- -title: GitHub -description: Interact with GitHub or trigger workflows from GitHub events ---- - -import { BlockInfoCard } from "@/components/ui/block-info-card" - - - -{/* MANUAL-CONTENT-START:intro */} -[GitHub](https://github.com/) is the world's leading platform for software development and version control using Git. It provides a collaborative environment where developers can host and review code, manage projects, and build software together. - -With GitHub, you can: - -- **Host repositories**: Store your code in public or private repositories with version control -- **Collaborate on code**: Use pull requests to propose changes, review code, and merge contributions -- **Track issues**: Create, assign, and manage issues to organize work and track bugs -- **Automate workflows**: Use GitHub Actions to build, test, and deploy code automatically -- **Manage projects**: Organize work with project boards, milestones, and task tracking -- **Document code**: Create and maintain documentation with GitHub Pages and wikis - -In Sim, the GitHub integration enables your agents to interact directly with GitHub repositories and workflows. This allows for powerful automation scenarios such as code review assistance, pull request management, issue tracking, and repository exploration. Your agents can fetch repository data, analyze code changes, post comments on pull requests, and perform other GitHub operations programmatically. This integration bridges the gap between your AI workflows and your development processes, enabling seamless collaboration between your agents and your development team. -{/* MANUAL-CONTENT-END */} - - -## Usage Instructions - -Integrate Github into the workflow. Can get get PR details, create PR comment, get repository info, and get latest commit. Can be used in trigger mode to trigger a workflow when a PR is created, commented on, or a commit is pushed. - - - -## Tools - -### `github_pr` - -Fetch PR details including diff and files changed - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `owner` | string | Yes | Repository owner | -| `repo` | string | Yes | Repository name | -| `pullNumber` | number | Yes | Pull request number | -| `apiKey` | string | Yes | GitHub API token | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable PR summary | -| `metadata` | object | Detailed PR metadata including file changes | - -### `github_comment` - -Create comments on GitHub PRs - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `owner` | string | Yes | Repository owner | -| `repo` | string | Yes | Repository name | -| `body` | string | Yes | Comment content | -| `pullNumber` | number | Yes | Pull request number | -| `path` | string | No | File path for review comment | -| `position` | number | No | Line number for review comment | -| `commentType` | string | No | Type of comment \(pr_comment or file_comment\) | -| `line` | number | No | Line number for review comment | -| `side` | string | No | Side of the diff \(LEFT or RIGHT\) | -| `commitId` | string | No | The SHA of the commit to comment on | -| `apiKey` | string | Yes | GitHub API token | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable comment confirmation | -| `metadata` | object | Comment metadata | - -### `github_repo_info` - -Retrieve comprehensive GitHub repository metadata including stars, forks, issues, and primary language. Supports both public and private repositories with optional authentication. - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `owner` | string | Yes | Repository owner \(user or organization\) | -| `repo` | string | Yes | Repository name | -| `apiKey` | string | Yes | GitHub Personal Access Token | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable repository summary | -| `metadata` | object | Repository metadata | - -### `github_latest_commit` - -Retrieve the latest commit from a GitHub repository - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `owner` | string | Yes | Repository owner \(user or organization\) | -| `repo` | string | Yes | Repository name | -| `branch` | string | No | Branch name \(defaults to the repository's default branch\) | -| `apiKey` | string | Yes | GitHub API token | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable commit summary | -| `metadata` | object | Commit metadata | - -### `github_issue_comment` - -Create a comment on a GitHub issue - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `owner` | string | Yes | Repository owner | -| `repo` | string | Yes | Repository name | -| `issue_number` | number | Yes | Issue number | -| `body` | string | Yes | Comment content | -| `apiKey` | string | Yes | GitHub API token | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable comment confirmation | -| `metadata` | object | Comment metadata | - -### `github_list_issue_comments` - -List all comments on a GitHub issue - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `owner` | string | Yes | Repository owner | -| `repo` | string | Yes | Repository name | -| `issue_number` | number | Yes | Issue number | -| `since` | string | No | Only show comments updated after this ISO 8601 timestamp | -| `per_page` | number | No | Number of results per page \(max 100\) | -| `page` | number | No | Page number | -| `apiKey` | string | Yes | GitHub API token | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable comments summary | -| `metadata` | object | Comments list metadata | - -### `github_update_comment` - -Update an existing comment on a GitHub issue or pull request - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `owner` | string | Yes | Repository owner | -| `repo` | string | Yes | Repository name | -| `comment_id` | number | Yes | Comment ID | -| `body` | string | Yes | Updated comment content | -| `apiKey` | string | Yes | GitHub API token | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable update confirmation | -| `metadata` | object | Updated comment metadata | - -### `github_delete_comment` - -Delete a comment on a GitHub issue or pull request - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `owner` | string | Yes | Repository owner | -| `repo` | string | Yes | Repository name | -| `comment_id` | number | Yes | Comment ID | -| `apiKey` | string | Yes | GitHub API token | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable deletion confirmation | -| `metadata` | object | Deletion result metadata | - -### `github_list_pr_comments` - -List all review comments on a GitHub pull request - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `owner` | string | Yes | Repository owner | -| `repo` | string | Yes | Repository name | -| `pullNumber` | number | Yes | Pull request number | -| `sort` | string | No | Sort by created or updated | -| `direction` | string | No | Sort direction \(asc or desc\) | -| `since` | string | No | Only show comments updated after this ISO 8601 timestamp | -| `per_page` | number | No | Number of results per page \(max 100\) | -| `page` | number | No | Page number | -| `apiKey` | string | Yes | GitHub API token | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable review comments summary | -| `metadata` | object | Review comments list metadata | - -### `github_create_pr` - -Create a new pull request in a GitHub repository - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `owner` | string | Yes | Repository owner | -| `repo` | string | Yes | Repository name | -| `title` | string | Yes | Pull request title | -| `head` | string | Yes | The name of the branch where your changes are implemented | -| `base` | string | Yes | The name of the branch you want the changes pulled into | -| `body` | string | No | Pull request description \(Markdown\) | -| `draft` | boolean | No | Create as draft pull request | -| `apiKey` | string | Yes | GitHub API token | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable PR creation confirmation | -| `metadata` | object | Pull request metadata | - -### `github_update_pr` - -Update an existing pull request in a GitHub repository - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `owner` | string | Yes | Repository owner | -| `repo` | string | Yes | Repository name | -| `pullNumber` | number | Yes | Pull request number | -| `title` | string | No | New pull request title | -| `body` | string | No | New pull request description \(Markdown\) | -| `state` | string | No | New state \(open or closed\) | -| `base` | string | No | New base branch name | -| `apiKey` | string | Yes | GitHub API token | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable PR update confirmation | -| `metadata` | object | Updated pull request metadata | - -### `github_merge_pr` - -Merge a pull request in a GitHub repository - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `owner` | string | Yes | Repository owner | -| `repo` | string | Yes | Repository name | -| `pullNumber` | number | Yes | Pull request number | -| `commit_title` | string | No | Title for the merge commit | -| `commit_message` | string | No | Extra detail to append to merge commit message | -| `merge_method` | string | No | Merge method: merge, squash, or rebase | -| `apiKey` | string | Yes | GitHub API token | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable merge confirmation | -| `metadata` | object | Merge result metadata | - -### `github_list_prs` - -List pull requests in a GitHub repository - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `owner` | string | Yes | Repository owner | -| `repo` | string | Yes | Repository name | -| `state` | string | No | Filter by state: open, closed, or all | -| `head` | string | No | Filter by head user or branch name \(format: user:ref-name or organization:ref-name\) | -| `base` | string | No | Filter by base branch name | -| `sort` | string | No | Sort by: created, updated, popularity, or long-running | -| `direction` | string | No | Sort direction: asc or desc | -| `per_page` | number | No | Results per page \(max 100\) | -| `page` | number | No | Page number | -| `apiKey` | string | Yes | GitHub API token | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable list of pull requests | -| `metadata` | object | Pull requests list metadata | - -### `github_get_pr_files` - -Get the list of files changed in a pull request - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `owner` | string | Yes | Repository owner | -| `repo` | string | Yes | Repository name | -| `pullNumber` | number | Yes | Pull request number | -| `per_page` | number | No | Results per page \(max 100\) | -| `page` | number | No | Page number | -| `apiKey` | string | Yes | GitHub API token | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable list of files changed in PR | -| `metadata` | object | PR files metadata | - -### `github_close_pr` - -Close a pull request in a GitHub repository - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `owner` | string | Yes | Repository owner | -| `repo` | string | Yes | Repository name | -| `pullNumber` | number | Yes | Pull request number | -| `apiKey` | string | Yes | GitHub API token | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable PR close confirmation | -| `metadata` | object | Closed pull request metadata | - -### `github_request_reviewers` - -Request reviewers for a pull request - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `owner` | string | Yes | Repository owner | -| `repo` | string | Yes | Repository name | -| `pullNumber` | number | Yes | Pull request number | -| `reviewers` | string | Yes | Comma-separated list of user logins to request reviews from | -| `team_reviewers` | string | No | Comma-separated list of team slugs to request reviews from | -| `apiKey` | string | Yes | GitHub API token | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable reviewer request confirmation | -| `metadata` | object | Requested reviewers metadata | - -### `github_get_file_content` - -Get the content of a file from a GitHub repository. Supports files up to 1MB. Content is returned decoded and human-readable. - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `owner` | string | Yes | Repository owner \(user or organization\) | -| `repo` | string | Yes | Repository name | -| `path` | string | Yes | Path to the file in the repository \(e.g., "src/index.ts"\) | -| `ref` | string | No | Branch name, tag, or commit SHA \(defaults to repository default branch\) | -| `apiKey` | string | Yes | GitHub Personal Access Token | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable file information with content preview | -| `metadata` | object | File metadata including name, path, SHA, size, and URLs | - -### `github_create_file` - -Create a new file in a GitHub repository. The file content will be automatically Base64 encoded. Supports files up to 1MB. - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `owner` | string | Yes | Repository owner \(user or organization\) | -| `repo` | string | Yes | Repository name | -| `path` | string | Yes | Path where the file will be created \(e.g., "src/newfile.ts"\) | -| `message` | string | Yes | Commit message for this file creation | -| `content` | string | Yes | File content \(plain text, will be Base64 encoded automatically\) | -| `branch` | string | No | Branch to create the file in \(defaults to repository default branch\) | -| `apiKey` | string | Yes | GitHub Personal Access Token | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable file creation confirmation | -| `metadata` | object | File and commit metadata | - -### `github_update_file` - -Update an existing file in a GitHub repository. Requires the file SHA. Content will be automatically Base64 encoded. Supports files up to 1MB. - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `owner` | string | Yes | Repository owner \(user or organization\) | -| `repo` | string | Yes | Repository name | -| `path` | string | Yes | Path to the file to update \(e.g., "src/index.ts"\) | -| `message` | string | Yes | Commit message for this file update | -| `content` | string | Yes | New file content \(plain text, will be Base64 encoded automatically\) | -| `sha` | string | Yes | The blob SHA of the file being replaced \(get from github_get_file_content\) | -| `branch` | string | No | Branch to update the file in \(defaults to repository default branch\) | -| `apiKey` | string | Yes | GitHub Personal Access Token | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable file update confirmation | -| `metadata` | object | Updated file and commit metadata | - -### `github_delete_file` - -Delete a file from a GitHub repository. Requires the file SHA. This operation cannot be undone through the API. - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `owner` | string | Yes | Repository owner \(user or organization\) | -| `repo` | string | Yes | Repository name | -| `path` | string | Yes | Path to the file to delete \(e.g., "src/oldfile.ts"\) | -| `message` | string | Yes | Commit message for this file deletion | -| `sha` | string | Yes | The blob SHA of the file being deleted \(get from github_get_file_content\) | -| `branch` | string | No | Branch to delete the file from \(defaults to repository default branch\) | -| `apiKey` | string | Yes | GitHub Personal Access Token | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable file deletion confirmation | -| `metadata` | object | Deletion confirmation and commit metadata | - -### `github_get_tree` - -Get the contents of a directory in a GitHub repository. Returns a list of files and subdirectories. Use empty path or omit to get root directory contents. - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `owner` | string | Yes | Repository owner \(user or organization\) | -| `repo` | string | Yes | Repository name | -| `path` | string | No | Directory path \(e.g., "src/components"\). Leave empty for root directory. | -| `ref` | string | No | Branch name, tag, or commit SHA \(defaults to repository default branch\) | -| `apiKey` | string | Yes | GitHub Personal Access Token | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable directory tree listing | -| `metadata` | object | Directory contents metadata | - -### `github_list_branches` - -List all branches in a GitHub repository. Optionally filter by protected status and control pagination. - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `owner` | string | Yes | Repository owner \(user or organization\) | -| `repo` | string | Yes | Repository name | -| `protected` | boolean | No | Filter branches by protection status | -| `per_page` | number | No | Number of results per page \(max 100, default 30\) | -| `page` | number | No | Page number for pagination \(default 1\) | -| `apiKey` | string | Yes | GitHub Personal Access Token | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable list of branches | -| `metadata` | object | Branch list metadata | - -### `github_get_branch` - -Get detailed information about a specific branch in a GitHub repository, including commit details and protection status. - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `owner` | string | Yes | Repository owner \(user or organization\) | -| `repo` | string | Yes | Repository name | -| `branch` | string | Yes | Branch name | -| `apiKey` | string | Yes | GitHub Personal Access Token | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable branch details | -| `metadata` | object | Branch metadata | - -### `github_create_branch` - -Create a new branch in a GitHub repository by creating a git reference pointing to a specific commit SHA. - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `owner` | string | Yes | Repository owner \(user or organization\) | -| `repo` | string | Yes | Repository name | -| `branch` | string | Yes | Name of the branch to create | -| `sha` | string | Yes | Commit SHA to point the branch to | -| `apiKey` | string | Yes | GitHub Personal Access Token | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable branch creation confirmation | -| `metadata` | object | Git reference metadata | - -### `github_delete_branch` - -Delete a branch from a GitHub repository by removing its git reference. Protected branches cannot be deleted. - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `owner` | string | Yes | Repository owner \(user or organization\) | -| `repo` | string | Yes | Repository name | -| `branch` | string | Yes | Name of the branch to delete | -| `apiKey` | string | Yes | GitHub Personal Access Token | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable deletion confirmation | -| `metadata` | object | Deletion metadata | - -### `github_get_branch_protection` - -Get the branch protection rules for a specific branch, including status checks, review requirements, and restrictions. - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `owner` | string | Yes | Repository owner \(user or organization\) | -| `repo` | string | Yes | Repository name | -| `branch` | string | Yes | Branch name | -| `apiKey` | string | Yes | GitHub Personal Access Token | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable branch protection summary | -| `metadata` | object | Branch protection configuration | - -### `github_update_branch_protection` - -Update branch protection rules for a specific branch, including status checks, review requirements, admin enforcement, and push restrictions. - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `owner` | string | Yes | Repository owner \(user or organization\) | -| `repo` | string | Yes | Repository name | -| `branch` | string | Yes | Branch name | -| `required_status_checks` | object | Yes | Required status check configuration \(null to disable\). Object with strict \(boolean\) and contexts \(string array\) | -| `enforce_admins` | boolean | Yes | Whether to enforce restrictions for administrators | -| `required_pull_request_reviews` | object | Yes | PR review requirements \(null to disable\). Object with optional required_approving_review_count, dismiss_stale_reviews, require_code_owner_reviews | -| `restrictions` | object | Yes | Push restrictions \(null to disable\). Object with users \(string array\) and teams \(string array\) | -| `apiKey` | string | Yes | GitHub Personal Access Token | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable branch protection update summary | -| `metadata` | object | Updated branch protection configuration | - -### `github_create_issue` - -Create a new issue in a GitHub repository - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `owner` | string | Yes | Repository owner | -| `repo` | string | Yes | Repository name | -| `title` | string | Yes | Issue title | -| `body` | string | No | Issue description/body | -| `assignees` | string | No | Comma-separated list of usernames to assign to this issue | -| `labels` | string | No | Comma-separated list of label names to add to this issue | -| `milestone` | number | No | Milestone number to associate with this issue | -| `apiKey` | string | Yes | GitHub API token | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable issue creation confirmation | -| `metadata` | object | Issue metadata | - -### `github_update_issue` - -Update an existing issue in a GitHub repository - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `owner` | string | Yes | Repository owner | -| `repo` | string | Yes | Repository name | -| `issue_number` | number | Yes | Issue number | -| `title` | string | No | New issue title | -| `body` | string | No | New issue description/body | -| `state` | string | No | Issue state \(open or closed\) | -| `labels` | array | No | Array of label names \(replaces all existing labels\) | -| `assignees` | array | No | Array of usernames \(replaces all existing assignees\) | -| `apiKey` | string | Yes | GitHub API token | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable issue update confirmation | -| `metadata` | object | Updated issue metadata | - -### `github_list_issues` - -List issues in a GitHub repository. Note: This includes pull requests as PRs are considered issues in GitHub - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `owner` | string | Yes | Repository owner | -| `repo` | string | Yes | Repository name | -| `state` | string | No | Filter by state: open, closed, or all \(default: open\) | -| `assignee` | string | No | Filter by assignee username | -| `creator` | string | No | Filter by creator username | -| `labels` | string | No | Comma-separated list of label names to filter by | -| `sort` | string | No | Sort by: created, updated, or comments \(default: created\) | -| `direction` | string | No | Sort direction: asc or desc \(default: desc\) | -| `per_page` | number | No | Results per page \(max 100, default: 30\) | -| `page` | number | No | Page number \(default: 1\) | -| `apiKey` | string | Yes | GitHub API token | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable list of issues | -| `metadata` | object | Issues list metadata | - -### `github_get_issue` - -Get detailed information about a specific issue in a GitHub repository - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `owner` | string | Yes | Repository owner | -| `repo` | string | Yes | Repository name | -| `issue_number` | number | Yes | Issue number | -| `apiKey` | string | Yes | GitHub API token | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable issue details | -| `metadata` | object | Detailed issue metadata | - -### `github_close_issue` - -Close an issue in a GitHub repository - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `owner` | string | Yes | Repository owner | -| `repo` | string | Yes | Repository name | -| `issue_number` | number | Yes | Issue number | -| `state_reason` | string | No | Reason for closing: completed or not_planned | -| `apiKey` | string | Yes | GitHub API token | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable issue close confirmation | -| `metadata` | object | Closed issue metadata | - -### `github_add_labels` - -Add labels to an issue in a GitHub repository - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `owner` | string | Yes | Repository owner | -| `repo` | string | Yes | Repository name | -| `issue_number` | number | Yes | Issue number | -| `labels` | string | Yes | Comma-separated list of label names to add to the issue | -| `apiKey` | string | Yes | GitHub API token | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable labels confirmation | -| `metadata` | object | Labels metadata | - -### `github_remove_label` - -Remove a label from an issue in a GitHub repository - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `owner` | string | Yes | Repository owner | -| `repo` | string | Yes | Repository name | -| `issue_number` | number | Yes | Issue number | -| `name` | string | Yes | Label name to remove | -| `apiKey` | string | Yes | GitHub API token | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable label removal confirmation | -| `metadata` | object | Remaining labels metadata | - -### `github_add_assignees` - -Add assignees to an issue in a GitHub repository - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `owner` | string | Yes | Repository owner | -| `repo` | string | Yes | Repository name | -| `issue_number` | number | Yes | Issue number | -| `assignees` | string | Yes | Comma-separated list of usernames to assign to the issue | -| `apiKey` | string | Yes | GitHub API token | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable assignees confirmation | -| `metadata` | object | Updated issue metadata with assignees | - -### `github_create_release` - -Create a new release for a GitHub repository. Specify tag name, target commit, title, description, and whether it should be a draft or prerelease. - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `owner` | string | Yes | Repository owner \(user or organization\) | -| `repo` | string | Yes | Repository name | -| `tag_name` | string | Yes | The name of the tag for this release | -| `target_commitish` | string | No | Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Defaults to the repository default branch. | -| `name` | string | No | The name of the release | -| `body` | string | No | Text describing the contents of the release \(markdown supported\) | -| `draft` | boolean | No | true to create a draft \(unpublished\) release, false to create a published one | -| `prerelease` | boolean | No | true to identify the release as a prerelease, false to identify as a full release | -| `apiKey` | string | Yes | GitHub Personal Access Token | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable release creation summary | -| `metadata` | object | Release metadata including download URLs | - -### `github_update_release` - -Update an existing GitHub release. Modify tag name, target commit, title, description, draft status, or prerelease status. - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `owner` | string | Yes | Repository owner \(user or organization\) | -| `repo` | string | Yes | Repository name | -| `release_id` | number | Yes | The unique identifier of the release | -| `tag_name` | string | No | The name of the tag | -| `target_commitish` | string | No | Specifies the commitish value for where the tag is created from | -| `name` | string | No | The name of the release | -| `body` | string | No | Text describing the contents of the release \(markdown supported\) | -| `draft` | boolean | No | true to set as draft, false to publish | -| `prerelease` | boolean | No | true to identify as a prerelease, false for a full release | -| `apiKey` | string | Yes | GitHub Personal Access Token | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable release update summary | -| `metadata` | object | Updated release metadata including download URLs | - -### `github_list_releases` - -List all releases for a GitHub repository. Returns release information including tags, names, and download URLs. - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `owner` | string | Yes | Repository owner \(user or organization\) | -| `repo` | string | Yes | Repository name | -| `per_page` | number | No | Number of results per page \(max 100\) | -| `page` | number | No | Page number of the results to fetch | -| `apiKey` | string | Yes | GitHub Personal Access Token | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable list of releases with summary | -| `metadata` | object | Releases metadata | - -### `github_get_release` - -Get detailed information about a specific GitHub release by ID. Returns release metadata including assets and download URLs. - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `owner` | string | Yes | Repository owner \(user or organization\) | -| `repo` | string | Yes | Repository name | -| `release_id` | number | Yes | The unique identifier of the release | -| `apiKey` | string | Yes | GitHub Personal Access Token | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable release details | -| `metadata` | object | Release metadata including download URLs | - -### `github_delete_release` - -Delete a GitHub release by ID. This permanently removes the release but does not delete the associated Git tag. - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `owner` | string | Yes | Repository owner \(user or organization\) | -| `repo` | string | Yes | Repository name | -| `release_id` | number | Yes | The unique identifier of the release to delete | -| `apiKey` | string | Yes | GitHub Personal Access Token | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable deletion confirmation | -| `metadata` | object | Deletion result metadata | - -### `github_list_workflows` - -List all workflows in a GitHub repository. Returns workflow details including ID, name, path, state, and badge URL. - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `owner` | string | Yes | Repository owner \(user or organization\) | -| `repo` | string | Yes | Repository name | -| `per_page` | number | No | Number of results per page \(default: 30, max: 100\) | -| `page` | number | No | Page number of results to fetch \(default: 1\) | -| `apiKey` | string | Yes | GitHub Personal Access Token | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable workflows summary | -| `metadata` | object | Workflows metadata | - -### `github_get_workflow` - -Get details of a specific GitHub Actions workflow by ID or filename. Returns workflow information including name, path, state, and badge URL. - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `owner` | string | Yes | Repository owner \(user or organization\) | -| `repo` | string | Yes | Repository name | -| `workflow_id` | string | Yes | Workflow ID \(number\) or workflow filename \(e.g., "main.yaml"\) | -| `apiKey` | string | Yes | GitHub Personal Access Token | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable workflow details | -| `metadata` | object | Workflow metadata | - -### `github_trigger_workflow` - -Trigger a workflow dispatch event for a GitHub Actions workflow. The workflow must have a workflow_dispatch trigger configured. Returns 204 No Content on success. - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `owner` | string | Yes | Repository owner \(user or organization\) | -| `repo` | string | Yes | Repository name | -| `workflow_id` | string | Yes | Workflow ID \(number\) or workflow filename \(e.g., "main.yaml"\) | -| `ref` | string | Yes | Git reference \(branch or tag name\) to run the workflow on | -| `inputs` | object | No | Input keys and values configured in the workflow file | -| `apiKey` | string | Yes | GitHub Personal Access Token | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Confirmation message | -| `metadata` | object | Empty metadata object \(204 No Content response\) | - -### `github_list_workflow_runs` - -List workflow runs for a repository. Supports filtering by actor, branch, event, and status. Returns run details including status, conclusion, and links. - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `owner` | string | Yes | Repository owner \(user or organization\) | -| `repo` | string | Yes | Repository name | -| `actor` | string | No | Filter by user who triggered the workflow | -| `branch` | string | No | Filter by branch name | -| `event` | string | No | Filter by event type \(e.g., push, pull_request, workflow_dispatch\) | -| `status` | string | No | Filter by status \(queued, in_progress, completed, waiting, requested, pending\) | -| `per_page` | number | No | Number of results per page \(default: 30, max: 100\) | -| `page` | number | No | Page number of results to fetch \(default: 1\) | -| `apiKey` | string | Yes | GitHub Personal Access Token | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable workflow runs summary | -| `metadata` | object | Workflow runs metadata | - -### `github_get_workflow_run` - -Get detailed information about a specific workflow run by ID. Returns status, conclusion, timing, and links to the run. - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `owner` | string | Yes | Repository owner \(user or organization\) | -| `repo` | string | Yes | Repository name | -| `run_id` | number | Yes | Workflow run ID | -| `apiKey` | string | Yes | GitHub Personal Access Token | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable workflow run details | -| `metadata` | object | Workflow run metadata | - -### `github_cancel_workflow_run` - -Cancel a workflow run. Returns 202 Accepted if cancellation is initiated, or 409 Conflict if the run cannot be cancelled (already completed). - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `owner` | string | Yes | Repository owner \(user or organization\) | -| `repo` | string | Yes | Repository name | -| `run_id` | number | Yes | Workflow run ID to cancel | -| `apiKey` | string | Yes | GitHub Personal Access Token | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Cancellation status message | -| `metadata` | object | Cancellation metadata | - -### `github_rerun_workflow` - -Rerun a workflow run. Optionally enable debug logging for the rerun. Returns 201 Created on success. - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `owner` | string | Yes | Repository owner \(user or organization\) | -| `repo` | string | Yes | Repository name | -| `run_id` | number | Yes | Workflow run ID to rerun | -| `enable_debug_logging` | boolean | No | Enable debug logging for the rerun \(default: false\) | -| `apiKey` | string | Yes | GitHub Personal Access Token | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Rerun confirmation message | -| `metadata` | object | Rerun metadata | - -### `github_list_projects` - -List GitHub Projects V2 for an organization or user. Returns up to 20 projects with their details including ID, title, number, URL, and status. - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `owner_type` | string | Yes | Owner type: "org" for organization or "user" for user | -| `owner_login` | string | Yes | Organization or user login name | -| `apiKey` | string | Yes | GitHub Personal Access Token with project read permissions | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable list of projects | -| `metadata` | object | Projects metadata | - -### `github_get_project` - -Get detailed information about a specific GitHub Project V2 by its number. Returns project details including ID, title, description, URL, and status. - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `owner_type` | string | Yes | Owner type: "org" for organization or "user" for user | -| `owner_login` | string | Yes | Organization or user login name | -| `project_number` | number | Yes | Project number | -| `apiKey` | string | Yes | GitHub Personal Access Token with project read permissions | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable project details | -| `metadata` | object | Project metadata | - -### `github_create_project` - -Create a new GitHub Project V2. Requires the owner Node ID (not login name). Returns the created project with ID, title, and URL. - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `owner_id` | string | Yes | Owner Node ID \(format: PVT_... or MDQ6...\). Use GitHub GraphQL API to get this ID from organization or user login. | -| `title` | string | Yes | Project title | -| `apiKey` | string | Yes | GitHub Personal Access Token with project write permissions | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable confirmation message | -| `metadata` | object | Created project metadata | - -### `github_update_project` - -Update an existing GitHub Project V2. Can update title, description, visibility (public), or status (closed). Requires the project Node ID. - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `project_id` | string | Yes | Project Node ID \(format: PVT_...\) | -| `title` | string | No | New project title | -| `shortDescription` | string | No | New project short description | -| `project_public` | boolean | No | Set project visibility \(true = public, false = private\) | -| `closed` | boolean | No | Set project status \(true = closed, false = open\) | -| `apiKey` | string | Yes | GitHub Personal Access Token with project write permissions | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable confirmation message | -| `metadata` | object | Updated project metadata | - -### `github_delete_project` - -Delete a GitHub Project V2. This action is permanent and cannot be undone. Requires the project Node ID. - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `project_id` | string | Yes | Project Node ID \(format: PVT_...\) | -| `apiKey` | string | Yes | GitHub Personal Access Token with project admin permissions | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Human-readable confirmation message | -| `metadata` | object | Deleted project metadata | - - - -## Notes - -- Category: `tools` -- Type: `github` diff --git a/apps/docs/content/docs/en/tools/github_v2.mdx b/apps/docs/content/docs/en/tools/github_v2.mdx new file mode 100644 index 0000000000..35310362f6 --- /dev/null +++ b/apps/docs/content/docs/en/tools/github_v2.mdx @@ -0,0 +1,20 @@ +--- +title: GitHub +description: Operation result data (API-aligned) +--- + +import { BlockInfoCard } from "@/components/ui/block-info-card" + + + + + + + +## Notes + +- Category: `misc` +- Type: `github_v2` diff --git a/apps/docs/content/docs/en/tools/gmail.mdx b/apps/docs/content/docs/en/tools/gmail.mdx deleted file mode 100644 index 6b01273671..0000000000 --- a/apps/docs/content/docs/en/tools/gmail.mdx +++ /dev/null @@ -1,280 +0,0 @@ ---- -title: Gmail -description: Send, read, search, and move Gmail messages or trigger workflows from Gmail events ---- - -import { BlockInfoCard } from "@/components/ui/block-info-card" - - - -{/* MANUAL-CONTENT-START:intro */} -[Gmail](https://gmail.com) is Google's popular email service that provides a robust platform for sending, receiving, and managing email communications. With over 1.8 billion active users worldwide, Gmail offers a feature-rich experience with powerful search capabilities, organizational tools, and integration options. - -With Gmail, you can: - -- **Send and receive emails**: Communicate with contacts through a clean, intuitive interface -- **Organize messages**: Use labels, folders, and filters to keep your inbox organized -- **Search efficiently**: Find specific messages quickly with Google's powerful search technology -- **Automate workflows**: Create filters and rules to automatically process incoming emails -- **Access from anywhere**: Use Gmail across devices with synchronized content and settings -- **Integrate with other services**: Connect with Google Calendar, Drive, and other productivity tools - -In Sim, the Gmail integration enables your agents to fully manage emails programmatically with comprehensive automation capabilities. This allows for powerful automation scenarios such as sending notifications, processing incoming messages, extracting information from emails, and managing communication workflows at scale. Your agents can: - -- **Compose and send**: Create personalized emails with attachments and send to recipients -- **Read and search**: Find specific messages using Gmail's query syntax and extract content -- **Organize intelligently**: Mark messages as read/unread, archive or unarchive emails, and manage labels -- **Clean up inbox**: Delete messages, move emails between labels, and maintain inbox zero -- **Trigger workflows**: Listen for new emails in real-time, enabling responsive workflows that react to incoming messages - -This integration bridges the gap between your AI workflows and email communications, enabling seamless interaction with one of the world's most widely used communication platforms. Whether you're automating customer support responses, processing receipts, managing subscriptions, or coordinating team communications, the Gmail integration provides all the tools you need for comprehensive email automation. -{/* MANUAL-CONTENT-END */} - - -## Usage Instructions - -Integrate Gmail into the workflow. Can send, read, search, and move emails. Can be used in trigger mode to trigger a workflow when a new email is received. - - - -## Tools - -### `gmail_send` - -Send emails using Gmail - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `to` | string | Yes | Recipient email address | -| `subject` | string | No | Email subject | -| `body` | string | Yes | Email body content | -| `contentType` | string | No | Content type for the email body \(text or html\) | -| `threadId` | string | No | Thread ID to reply to \(for threading\) | -| `replyToMessageId` | string | No | Gmail message ID to reply to - use the "id" field from Gmail Read results \(not the RFC "messageId"\) | -| `cc` | string | No | CC recipients \(comma-separated\) | -| `bcc` | string | No | BCC recipients \(comma-separated\) | -| `attachments` | file[] | No | Files to attach to the email | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Success message | -| `metadata` | object | Email metadata | - -### `gmail_draft` - -Draft emails using Gmail - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `to` | string | Yes | Recipient email address | -| `subject` | string | No | Email subject | -| `body` | string | Yes | Email body content | -| `contentType` | string | No | Content type for the email body \(text or html\) | -| `threadId` | string | No | Thread ID to reply to \(for threading\) | -| `replyToMessageId` | string | No | Gmail message ID to reply to - use the "id" field from Gmail Read results \(not the RFC "messageId"\) | -| `cc` | string | No | CC recipients \(comma-separated\) | -| `bcc` | string | No | BCC recipients \(comma-separated\) | -| `attachments` | file[] | No | Files to attach to the email draft | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Success message | -| `metadata` | object | Draft metadata | - -### `gmail_read` - -Read emails from Gmail - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `messageId` | string | No | ID of the message to read | -| `folder` | string | No | Folder/label to read emails from | -| `unreadOnly` | boolean | No | Only retrieve unread messages | -| `maxResults` | number | No | Maximum number of messages to retrieve \(default: 1, max: 10\) | -| `includeAttachments` | boolean | No | Download and include email attachments | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Text content of the email | -| `metadata` | json | Metadata of the email | -| `attachments` | file[] | Attachments of the email | - -### `gmail_search` - -Search emails in Gmail - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `query` | string | Yes | Search query for emails | -| `maxResults` | number | No | Maximum number of results to return | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Search results summary | -| `metadata` | object | Search metadata | - -### `gmail_move` - -Move emails between Gmail labels/folders - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `messageId` | string | Yes | ID of the message to move | -| `addLabelIds` | string | Yes | Comma-separated label IDs to add \(e.g., INBOX, Label_123\) | -| `removeLabelIds` | string | No | Comma-separated label IDs to remove \(e.g., INBOX, SPAM\) | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Success message | -| `metadata` | object | Email metadata | - -### `gmail_mark_read` - -Mark a Gmail message as read - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `messageId` | string | Yes | ID of the message to mark as read | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Success message | -| `metadata` | object | Email metadata | - -### `gmail_mark_unread` - -Mark a Gmail message as unread - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `messageId` | string | Yes | ID of the message to mark as unread | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Success message | -| `metadata` | object | Email metadata | - -### `gmail_archive` - -Archive a Gmail message (remove from inbox) - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `messageId` | string | Yes | ID of the message to archive | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Success message | -| `metadata` | object | Email metadata | - -### `gmail_unarchive` - -Unarchive a Gmail message (move back to inbox) - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `messageId` | string | Yes | ID of the message to unarchive | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Success message | -| `metadata` | object | Email metadata | - -### `gmail_delete` - -Delete a Gmail message (move to trash) - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `messageId` | string | Yes | ID of the message to delete | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Success message | -| `metadata` | object | Email metadata | - -### `gmail_add_label` - -Add label(s) to a Gmail message - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `messageId` | string | Yes | ID of the message to add labels to | -| `labelIds` | string | Yes | Comma-separated label IDs to add \(e.g., INBOX, Label_123\) | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Success message | -| `metadata` | object | Email metadata | - -### `gmail_remove_label` - -Remove label(s) from a Gmail message - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `messageId` | string | Yes | ID of the message to remove labels from | -| `labelIds` | string | Yes | Comma-separated label IDs to remove \(e.g., INBOX, Label_123\) | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Success message | -| `metadata` | object | Email metadata | - - - -## Notes - -- Category: `tools` -- Type: `gmail` diff --git a/apps/docs/content/docs/en/tools/gmail_v2.mdx b/apps/docs/content/docs/en/tools/gmail_v2.mdx new file mode 100644 index 0000000000..a912bee4d4 --- /dev/null +++ b/apps/docs/content/docs/en/tools/gmail_v2.mdx @@ -0,0 +1,394 @@ +--- +title: Gmail +description: Gmail message ID +--- + +import { BlockInfoCard } from "@/components/ui/block-info-card" + + + + + +## Tools + +### `gmail_send_v2` + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `id` | string | Gmail message ID | +| `threadId` | string | Gmail thread ID | +| `labelIds` | array | Email label IDs | +| `from` | string | Sender | +| `to` | string | To | +| `subject` | string | Subject | +| `date` | string | Date | +| `body` | string | Email body text \(best-effort\) | +| `results` | json | Search/read summary results | +| `attachments` | json | Downloaded attachments \(if enabled\) | +| `email_id` | string | Gmail message ID | +| `thread_id` | string | Gmail thread ID | +| `cc` | string | CC recipients \(comma-separated\) | +| `body_text` | string | Plain text email body | +| `body_html` | string | HTML email body | +| `labels` | string | Email labels \(comma-separated\) | +| `has_attachments` | boolean | Whether email has attachments | +| `raw_email` | json | Complete raw email data from Gmail API \(if enabled\) | +| `timestamp` | string | Event timestamp | + +### `gmail_draft_v2` + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `id` | string | Gmail message ID | +| `threadId` | string | Gmail thread ID | +| `labelIds` | array | Email label IDs | +| `from` | string | Sender | +| `to` | string | To | +| `subject` | string | Subject | +| `date` | string | Date | +| `body` | string | Email body text \(best-effort\) | +| `results` | json | Search/read summary results | +| `attachments` | json | Downloaded attachments \(if enabled\) | +| `email_id` | string | Gmail message ID | +| `thread_id` | string | Gmail thread ID | +| `cc` | string | CC recipients \(comma-separated\) | +| `body_text` | string | Plain text email body | +| `body_html` | string | HTML email body | +| `labels` | string | Email labels \(comma-separated\) | +| `has_attachments` | boolean | Whether email has attachments | +| `raw_email` | json | Complete raw email data from Gmail API \(if enabled\) | +| `timestamp` | string | Event timestamp | + +### `gmail_read_v2` + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `id` | string | Gmail message ID | +| `threadId` | string | Gmail thread ID | +| `labelIds` | array | Email label IDs | +| `from` | string | Sender | +| `to` | string | To | +| `subject` | string | Subject | +| `date` | string | Date | +| `body` | string | Email body text \(best-effort\) | +| `results` | json | Search/read summary results | +| `attachments` | json | Downloaded attachments \(if enabled\) | +| `email_id` | string | Gmail message ID | +| `thread_id` | string | Gmail thread ID | +| `cc` | string | CC recipients \(comma-separated\) | +| `body_text` | string | Plain text email body | +| `body_html` | string | HTML email body | +| `labels` | string | Email labels \(comma-separated\) | +| `has_attachments` | boolean | Whether email has attachments | +| `raw_email` | json | Complete raw email data from Gmail API \(if enabled\) | +| `timestamp` | string | Event timestamp | + +### `gmail_search_v2` + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `id` | string | Gmail message ID | +| `threadId` | string | Gmail thread ID | +| `labelIds` | array | Email label IDs | +| `from` | string | Sender | +| `to` | string | To | +| `subject` | string | Subject | +| `date` | string | Date | +| `body` | string | Email body text \(best-effort\) | +| `results` | json | Search/read summary results | +| `attachments` | json | Downloaded attachments \(if enabled\) | +| `email_id` | string | Gmail message ID | +| `thread_id` | string | Gmail thread ID | +| `cc` | string | CC recipients \(comma-separated\) | +| `body_text` | string | Plain text email body | +| `body_html` | string | HTML email body | +| `labels` | string | Email labels \(comma-separated\) | +| `has_attachments` | boolean | Whether email has attachments | +| `raw_email` | json | Complete raw email data from Gmail API \(if enabled\) | +| `timestamp` | string | Event timestamp | + +### `gmail_move_v2` + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `id` | string | Gmail message ID | +| `threadId` | string | Gmail thread ID | +| `labelIds` | array | Email label IDs | +| `from` | string | Sender | +| `to` | string | To | +| `subject` | string | Subject | +| `date` | string | Date | +| `body` | string | Email body text \(best-effort\) | +| `results` | json | Search/read summary results | +| `attachments` | json | Downloaded attachments \(if enabled\) | +| `email_id` | string | Gmail message ID | +| `thread_id` | string | Gmail thread ID | +| `cc` | string | CC recipients \(comma-separated\) | +| `body_text` | string | Plain text email body | +| `body_html` | string | HTML email body | +| `labels` | string | Email labels \(comma-separated\) | +| `has_attachments` | boolean | Whether email has attachments | +| `raw_email` | json | Complete raw email data from Gmail API \(if enabled\) | +| `timestamp` | string | Event timestamp | + +### `gmail_mark_read_v2` + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `id` | string | Gmail message ID | +| `threadId` | string | Gmail thread ID | +| `labelIds` | array | Email label IDs | +| `from` | string | Sender | +| `to` | string | To | +| `subject` | string | Subject | +| `date` | string | Date | +| `body` | string | Email body text \(best-effort\) | +| `results` | json | Search/read summary results | +| `attachments` | json | Downloaded attachments \(if enabled\) | +| `email_id` | string | Gmail message ID | +| `thread_id` | string | Gmail thread ID | +| `cc` | string | CC recipients \(comma-separated\) | +| `body_text` | string | Plain text email body | +| `body_html` | string | HTML email body | +| `labels` | string | Email labels \(comma-separated\) | +| `has_attachments` | boolean | Whether email has attachments | +| `raw_email` | json | Complete raw email data from Gmail API \(if enabled\) | +| `timestamp` | string | Event timestamp | + +### `gmail_mark_unread_v2` + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `id` | string | Gmail message ID | +| `threadId` | string | Gmail thread ID | +| `labelIds` | array | Email label IDs | +| `from` | string | Sender | +| `to` | string | To | +| `subject` | string | Subject | +| `date` | string | Date | +| `body` | string | Email body text \(best-effort\) | +| `results` | json | Search/read summary results | +| `attachments` | json | Downloaded attachments \(if enabled\) | +| `email_id` | string | Gmail message ID | +| `thread_id` | string | Gmail thread ID | +| `cc` | string | CC recipients \(comma-separated\) | +| `body_text` | string | Plain text email body | +| `body_html` | string | HTML email body | +| `labels` | string | Email labels \(comma-separated\) | +| `has_attachments` | boolean | Whether email has attachments | +| `raw_email` | json | Complete raw email data from Gmail API \(if enabled\) | +| `timestamp` | string | Event timestamp | + +### `gmail_archive_v2` + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `id` | string | Gmail message ID | +| `threadId` | string | Gmail thread ID | +| `labelIds` | array | Email label IDs | +| `from` | string | Sender | +| `to` | string | To | +| `subject` | string | Subject | +| `date` | string | Date | +| `body` | string | Email body text \(best-effort\) | +| `results` | json | Search/read summary results | +| `attachments` | json | Downloaded attachments \(if enabled\) | +| `email_id` | string | Gmail message ID | +| `thread_id` | string | Gmail thread ID | +| `cc` | string | CC recipients \(comma-separated\) | +| `body_text` | string | Plain text email body | +| `body_html` | string | HTML email body | +| `labels` | string | Email labels \(comma-separated\) | +| `has_attachments` | boolean | Whether email has attachments | +| `raw_email` | json | Complete raw email data from Gmail API \(if enabled\) | +| `timestamp` | string | Event timestamp | + +### `gmail_unarchive_v2` + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `id` | string | Gmail message ID | +| `threadId` | string | Gmail thread ID | +| `labelIds` | array | Email label IDs | +| `from` | string | Sender | +| `to` | string | To | +| `subject` | string | Subject | +| `date` | string | Date | +| `body` | string | Email body text \(best-effort\) | +| `results` | json | Search/read summary results | +| `attachments` | json | Downloaded attachments \(if enabled\) | +| `email_id` | string | Gmail message ID | +| `thread_id` | string | Gmail thread ID | +| `cc` | string | CC recipients \(comma-separated\) | +| `body_text` | string | Plain text email body | +| `body_html` | string | HTML email body | +| `labels` | string | Email labels \(comma-separated\) | +| `has_attachments` | boolean | Whether email has attachments | +| `raw_email` | json | Complete raw email data from Gmail API \(if enabled\) | +| `timestamp` | string | Event timestamp | + +### `gmail_delete_v2` + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `id` | string | Gmail message ID | +| `threadId` | string | Gmail thread ID | +| `labelIds` | array | Email label IDs | +| `from` | string | Sender | +| `to` | string | To | +| `subject` | string | Subject | +| `date` | string | Date | +| `body` | string | Email body text \(best-effort\) | +| `results` | json | Search/read summary results | +| `attachments` | json | Downloaded attachments \(if enabled\) | +| `email_id` | string | Gmail message ID | +| `thread_id` | string | Gmail thread ID | +| `cc` | string | CC recipients \(comma-separated\) | +| `body_text` | string | Plain text email body | +| `body_html` | string | HTML email body | +| `labels` | string | Email labels \(comma-separated\) | +| `has_attachments` | boolean | Whether email has attachments | +| `raw_email` | json | Complete raw email data from Gmail API \(if enabled\) | +| `timestamp` | string | Event timestamp | + +### `gmail_add_label_v2` + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `id` | string | Gmail message ID | +| `threadId` | string | Gmail thread ID | +| `labelIds` | array | Email label IDs | +| `from` | string | Sender | +| `to` | string | To | +| `subject` | string | Subject | +| `date` | string | Date | +| `body` | string | Email body text \(best-effort\) | +| `results` | json | Search/read summary results | +| `attachments` | json | Downloaded attachments \(if enabled\) | +| `email_id` | string | Gmail message ID | +| `thread_id` | string | Gmail thread ID | +| `cc` | string | CC recipients \(comma-separated\) | +| `body_text` | string | Plain text email body | +| `body_html` | string | HTML email body | +| `labels` | string | Email labels \(comma-separated\) | +| `has_attachments` | boolean | Whether email has attachments | +| `raw_email` | json | Complete raw email data from Gmail API \(if enabled\) | +| `timestamp` | string | Event timestamp | + +### `gmail_remove_label_v2` + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `id` | string | Gmail message ID | +| `threadId` | string | Gmail thread ID | +| `labelIds` | array | Email label IDs | +| `from` | string | Sender | +| `to` | string | To | +| `subject` | string | Subject | +| `date` | string | Date | +| `body` | string | Email body text \(best-effort\) | +| `results` | json | Search/read summary results | +| `attachments` | json | Downloaded attachments \(if enabled\) | +| `email_id` | string | Gmail message ID | +| `thread_id` | string | Gmail thread ID | +| `cc` | string | CC recipients \(comma-separated\) | +| `body_text` | string | Plain text email body | +| `body_html` | string | HTML email body | +| `labels` | string | Email labels \(comma-separated\) | +| `has_attachments` | boolean | Whether email has attachments | +| `raw_email` | json | Complete raw email data from Gmail API \(if enabled\) | +| `timestamp` | string | Event timestamp | + + + +## Notes + +- Category: `misc` +- Type: `gmail_v2` diff --git a/apps/docs/content/docs/en/tools/google_calendar.mdx b/apps/docs/content/docs/en/tools/google_calendar.mdx deleted file mode 100644 index b38eb3d995..0000000000 --- a/apps/docs/content/docs/en/tools/google_calendar.mdx +++ /dev/null @@ -1,146 +0,0 @@ ---- -title: Google Calendar -description: Manage Google Calendar events ---- - -import { BlockInfoCard } from "@/components/ui/block-info-card" - - - -{/* MANUAL-CONTENT-START:intro */} -[Google Calendar](https://calendar.google.com) is Google's powerful calendar and scheduling service that provides a comprehensive platform for managing events, meetings, and appointments. With seamless integration across Google's ecosystem and widespread adoption, Google Calendar offers robust features for both personal and professional scheduling needs. - -With Google Calendar, you can: - -- **Create and manage events**: Schedule meetings, appointments, and reminders with detailed information -- **Send calendar invites**: Automatically notify and coordinate with attendees through email invitations -- **Natural language event creation**: Quickly add events using conversational language like "Meeting with John tomorrow at 3pm" -- **View and search events**: Easily find and access your scheduled events across multiple calendars -- **Manage multiple calendars**: Organize different types of events across various calendars - -In Sim, the Google Calendar integration enables your agents to programmatically create, read, and manage calendar events. This allows for powerful automation scenarios such as scheduling meetings, sending calendar invites, checking availability, and managing event details. Your agents can create events with natural language input, send automated calendar invitations to attendees, retrieve event information, and list upcoming events. This integration bridges the gap between your AI workflows and calendar management, enabling seamless scheduling automation and coordination with one of the world's most widely used calendar platforms. -{/* MANUAL-CONTENT-END */} - - -## Usage Instructions - -Integrate Google Calendar into the workflow. Can create, read, update, and list calendar events. - - - -## Tools - -### `google_calendar_create` - -Create a new event in Google Calendar - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `calendarId` | string | No | Calendar ID \(defaults to primary\) | -| `summary` | string | Yes | Event title/summary | -| `description` | string | No | Event description | -| `location` | string | No | Event location | -| `startDateTime` | string | Yes | Start date and time. MUST include timezone offset \(e.g., 2025-06-03T10:00:00-08:00\) OR provide timeZone parameter | -| `endDateTime` | string | Yes | End date and time. MUST include timezone offset \(e.g., 2025-06-03T11:00:00-08:00\) OR provide timeZone parameter | -| `timeZone` | string | No | Time zone \(e.g., America/Los_Angeles\). Required if datetime does not include offset. Defaults to America/Los_Angeles if not provided. | -| `attendees` | array | No | Array of attendee email addresses | -| `sendUpdates` | string | No | How to send updates to attendees: all, externalOnly, or none | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Event creation confirmation message | -| `metadata` | json | Created event metadata including ID, status, and details | - -### `google_calendar_list` - -List events from Google Calendar - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `calendarId` | string | No | Calendar ID \(defaults to primary\) | -| `timeMin` | string | No | Lower bound for events \(RFC3339 timestamp, e.g., 2025-06-03T00:00:00Z\) | -| `timeMax` | string | No | Upper bound for events \(RFC3339 timestamp, e.g., 2025-06-04T00:00:00Z\) | -| `orderBy` | string | No | Order of events returned \(startTime or updated\) | -| `showDeleted` | boolean | No | Include deleted events | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Summary of found events count | -| `metadata` | json | List of events with pagination tokens and event details | - -### `google_calendar_get` - -Get a specific event from Google Calendar - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `calendarId` | string | No | Calendar ID \(defaults to primary\) | -| `eventId` | string | Yes | Event ID to retrieve | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Event retrieval confirmation message | -| `metadata` | json | Event details including ID, status, times, and attendees | - -### `google_calendar_quick_add` - -Create events from natural language text - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `calendarId` | string | No | Calendar ID \(defaults to primary\) | -| `text` | string | Yes | Natural language text describing the event \(e.g., "Meeting with John tomorrow at 3pm"\) | -| `attendees` | array | No | Array of attendee email addresses \(comma-separated string also accepted\) | -| `sendUpdates` | string | No | How to send updates to attendees: all, externalOnly, or none | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Event creation confirmation message from natural language | -| `metadata` | json | Created event metadata including parsed details | - -### `google_calendar_invite` - -Invite attendees to an existing Google Calendar event - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `calendarId` | string | No | Calendar ID \(defaults to primary\) | -| `eventId` | string | Yes | Event ID to invite attendees to | -| `attendees` | array | Yes | Array of attendee email addresses to invite | -| `sendUpdates` | string | No | How to send updates to attendees: all, externalOnly, or none | -| `replaceExisting` | boolean | No | Whether to replace existing attendees or add to them \(defaults to false\) | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Attendee invitation confirmation message with email delivery status | -| `metadata` | json | Updated event metadata including attendee list and details | - - - -## Notes - -- Category: `tools` -- Type: `google_calendar` diff --git a/apps/docs/content/docs/en/tools/google_calendar_v2.mdx b/apps/docs/content/docs/en/tools/google_calendar_v2.mdx new file mode 100644 index 0000000000..6db202e10a --- /dev/null +++ b/apps/docs/content/docs/en/tools/google_calendar_v2.mdx @@ -0,0 +1,157 @@ +--- +title: Google Calendar +description: Event ID +--- + +import { BlockInfoCard } from "@/components/ui/block-info-card" + + + + + +## Tools + +### `google_calendar_create_v2` + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `id` | string | Event ID | +| `htmlLink` | string | Event link | +| `status` | string | Event status | +| `summary` | string | Event title | +| `description` | string | Event description | +| `location` | string | Event location | +| `start` | json | Event start | +| `end` | json | Event end | +| `attendees` | json | Event attendees | +| `creator` | json | Event creator | +| `organizer` | json | Event organizer | +| `events` | json | List of events \(list operation\) | +| `nextPageToken` | string | Next page token | +| `nextSyncToken` | string | Next sync token | +| `timeZone` | string | Calendar time zone | + +### `google_calendar_list_v2` + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `id` | string | Event ID | +| `htmlLink` | string | Event link | +| `status` | string | Event status | +| `summary` | string | Event title | +| `description` | string | Event description | +| `location` | string | Event location | +| `start` | json | Event start | +| `end` | json | Event end | +| `attendees` | json | Event attendees | +| `creator` | json | Event creator | +| `organizer` | json | Event organizer | +| `events` | json | List of events \(list operation\) | +| `nextPageToken` | string | Next page token | +| `nextSyncToken` | string | Next sync token | +| `timeZone` | string | Calendar time zone | + +### `google_calendar_get_v2` + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `id` | string | Event ID | +| `htmlLink` | string | Event link | +| `status` | string | Event status | +| `summary` | string | Event title | +| `description` | string | Event description | +| `location` | string | Event location | +| `start` | json | Event start | +| `end` | json | Event end | +| `attendees` | json | Event attendees | +| `creator` | json | Event creator | +| `organizer` | json | Event organizer | +| `events` | json | List of events \(list operation\) | +| `nextPageToken` | string | Next page token | +| `nextSyncToken` | string | Next sync token | +| `timeZone` | string | Calendar time zone | + +### `google_calendar_quick_add_v2` + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `id` | string | Event ID | +| `htmlLink` | string | Event link | +| `status` | string | Event status | +| `summary` | string | Event title | +| `description` | string | Event description | +| `location` | string | Event location | +| `start` | json | Event start | +| `end` | json | Event end | +| `attendees` | json | Event attendees | +| `creator` | json | Event creator | +| `organizer` | json | Event organizer | +| `events` | json | List of events \(list operation\) | +| `nextPageToken` | string | Next page token | +| `nextSyncToken` | string | Next sync token | +| `timeZone` | string | Calendar time zone | + +### `google_calendar_invite_v2` + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `id` | string | Event ID | +| `htmlLink` | string | Event link | +| `status` | string | Event status | +| `summary` | string | Event title | +| `description` | string | Event description | +| `location` | string | Event location | +| `start` | json | Event start | +| `end` | json | Event end | +| `attendees` | json | Event attendees | +| `creator` | json | Event creator | +| `organizer` | json | Event organizer | +| `events` | json | List of events \(list operation\) | +| `nextPageToken` | string | Next page token | +| `nextSyncToken` | string | Next sync token | +| `timeZone` | string | Calendar time zone | + + + +## Notes + +- Category: `misc` +- Type: `google_calendar_v2` diff --git a/apps/docs/content/docs/en/tools/google_drive.mdx b/apps/docs/content/docs/en/tools/google_drive.mdx index 54b3ed3bc3..3bb75fa16a 100644 --- a/apps/docs/content/docs/en/tools/google_drive.mdx +++ b/apps/docs/content/docs/en/tools/google_drive.mdx @@ -96,13 +96,13 @@ Download a file from Google Drive with complete metadata (exports Google Workspa | `fileId` | string | Yes | The ID of the file to download | | `mimeType` | string | No | The MIME type to export Google Workspace files to \(optional\) | | `fileName` | string | No | Optional filename override | -| `includeRevisions` | boolean | No | Whether to include revision history in the metadata \(default: true\) | +| `includeRevisions` | boolean | No | Whether to include revision history in the metadata \(default: true, returns first 100 revisions\) | #### Output | Parameter | Type | Description | | --------- | ---- | ----------- | -| `file` | object | Downloaded file stored in execution files | +| `file` | object | Downloaded file data | ### `google_drive_list` diff --git a/apps/docs/content/docs/en/tools/hubspot.mdx b/apps/docs/content/docs/en/tools/hubspot.mdx index a1e64a9cec..0732ab4d9d 100644 --- a/apps/docs/content/docs/en/tools/hubspot.mdx +++ b/apps/docs/content/docs/en/tools/hubspot.mdx @@ -51,7 +51,7 @@ Retrieve all users from HubSpot account | Parameter | Type | Description | | --------- | ---- | ----------- | | `users` | array | Array of HubSpot user objects | -| `metadata` | object | Operation metadata | +| `totalItems` | number | Total number of users returned | | `success` | boolean | Operation success status | ### `hubspot_list_contacts` @@ -73,7 +73,7 @@ Retrieve all contacts from HubSpot account with pagination support | --------- | ---- | ----------- | | `contacts` | array | Array of HubSpot contact objects | | `paging` | object | Pagination information | -| `metadata` | object | Operation metadata | +| `metadata` | object | Metadata with totalReturned and hasMore | | `success` | boolean | Operation success status | ### `hubspot_get_contact` @@ -94,7 +94,7 @@ Retrieve a single contact by ID or email from HubSpot | Parameter | Type | Description | | --------- | ---- | ----------- | | `contact` | object | HubSpot contact object with properties | -| `metadata` | object | Operation metadata | +| `contactId` | string | The retrieved contact ID | | `success` | boolean | Operation success status | ### `hubspot_create_contact` @@ -113,7 +113,7 @@ Create a new contact in HubSpot. Requires at least one of: email, firstname, or | Parameter | Type | Description | | --------- | ---- | ----------- | | `contact` | object | Created HubSpot contact object | -| `metadata` | object | Operation metadata | +| `contactId` | string | The created contact ID | | `success` | boolean | Operation success status | ### `hubspot_update_contact` @@ -133,7 +133,7 @@ Update an existing contact in HubSpot by ID or email | Parameter | Type | Description | | --------- | ---- | ----------- | | `contact` | object | Updated HubSpot contact object | -| `metadata` | object | Operation metadata | +| `contactId` | string | The updated contact ID | | `success` | boolean | Operation success status | ### `hubspot_search_contacts` @@ -158,7 +158,7 @@ Search for contacts in HubSpot using filters, sorting, and queries | `contacts` | array | Array of matching HubSpot contact objects | | `total` | number | Total number of matching contacts | | `paging` | object | Pagination information | -| `metadata` | object | Operation metadata | +| `metadata` | object | Metadata with totalReturned and hasMore | | `success` | boolean | Operation success status | ### `hubspot_list_companies` @@ -180,7 +180,7 @@ Retrieve all companies from HubSpot account with pagination support | --------- | ---- | ----------- | | `companies` | array | Array of HubSpot company objects | | `paging` | object | Pagination information | -| `metadata` | object | Operation metadata | +| `metadata` | object | Metadata with totalReturned and hasMore | | `success` | boolean | Operation success status | ### `hubspot_get_company` @@ -201,7 +201,7 @@ Retrieve a single company by ID or domain from HubSpot | Parameter | Type | Description | | --------- | ---- | ----------- | | `company` | object | HubSpot company object with properties | -| `metadata` | object | Operation metadata | +| `companyId` | string | The retrieved company ID | | `success` | boolean | Operation success status | ### `hubspot_create_company` @@ -220,7 +220,7 @@ Create a new company in HubSpot | Parameter | Type | Description | | --------- | ---- | ----------- | | `company` | object | Created HubSpot company object | -| `metadata` | object | Operation metadata | +| `companyId` | string | The created company ID | | `success` | boolean | Operation success status | ### `hubspot_update_company` @@ -240,7 +240,7 @@ Update an existing company in HubSpot by ID or domain | Parameter | Type | Description | | --------- | ---- | ----------- | | `company` | object | Updated HubSpot company object | -| `metadata` | object | Operation metadata | +| `companyId` | string | The updated company ID | | `success` | boolean | Operation success status | ### `hubspot_search_companies` @@ -265,7 +265,7 @@ Search for companies in HubSpot using filters, sorting, and queries | `companies` | array | Array of matching HubSpot company objects | | `total` | number | Total number of matching companies | | `paging` | object | Pagination information | -| `metadata` | object | Operation metadata | +| `metadata` | object | Metadata with totalReturned and hasMore | | `success` | boolean | Operation success status | ### `hubspot_list_deals` @@ -287,7 +287,7 @@ Retrieve all deals from HubSpot account with pagination support | --------- | ---- | ----------- | | `deals` | array | Array of HubSpot deal objects | | `paging` | object | Pagination information | -| `metadata` | object | Operation metadata | +| `metadata` | object | Metadata with totalReturned and hasMore | | `success` | boolean | Operation success status | diff --git a/apps/docs/content/docs/en/tools/intercom.mdx b/apps/docs/content/docs/en/tools/intercom.mdx deleted file mode 100644 index 760e4f46e1..0000000000 --- a/apps/docs/content/docs/en/tools/intercom.mdx +++ /dev/null @@ -1,365 +0,0 @@ ---- -title: Intercom -description: Manage contacts, companies, conversations, tickets, and messages in Intercom ---- - -import { BlockInfoCard } from "@/components/ui/block-info-card" - - - -{/* MANUAL-CONTENT-START:intro */} -[Intercom](https://www.intercom.com/) is a leading customer communications platform that enables you to manage and automate your interactions with contacts, companies, conversations, tickets, and messages—all in one place. The Intercom integration in Sim lets your agents programmatically manage customer relationships, support requests, and conversations directly from your automated workflows. - -With the Intercom tools, you can: - -- **Contacts Management:** Create, get, update, list, search, and delete contacts—automate your CRM processes and keep your customer records up-to-date. -- **Company Management:** Create new companies, retrieve company details, and list all companies related to your users or business clients. -- **Conversation Handling:** Get, list, reply to, and search through conversations—allowing agents to track ongoing support threads, provide answers, and automate follow-up actions. -- **Ticket Management:** Create and retrieve tickets programmatically, helping you automate customer service, support issue tracking, and workflow escalations. -- **Send Messages:** Trigger messages to users or leads for onboarding, support, or marketing, all from within your workflow automation. - -By integrating Intercom tools into Sim, you empower your workflows to communicate directly with your users, automate customer support processes, manage leads, and streamline communications at scale. Whether you need to create new contacts, keep customer data synchronized, manage support tickets, or send personalized engagement messages, the Intercom tools provide a comprehensive way to manage customer interactions as part of your intelligent automations. -{/* MANUAL-CONTENT-END */} - - -## Usage Instructions - -Integrate Intercom into the workflow. Can create, get, update, list, search, and delete contacts; create, get, and list companies; get, list, reply, and search conversations; create and get tickets; and create messages. - - - -## Tools - -### `intercom_create_contact` - -Create a new contact in Intercom with email, external_id, or role - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `role` | string | No | The role of the contact. Accepts 'user' or 'lead'. Defaults to 'lead' if not specified. | -| `email` | string | No | The contact's email address | -| `external_id` | string | No | A unique identifier for the contact provided by the client | -| `phone` | string | No | The contact's phone number | -| `name` | string | No | The contact's name | -| `avatar` | string | No | An avatar image URL for the contact | -| `signed_up_at` | number | No | The time the user signed up as a Unix timestamp | -| `last_seen_at` | number | No | The time the user was last seen as a Unix timestamp | -| `owner_id` | string | No | The id of an admin that has been assigned account ownership of the contact | -| `unsubscribed_from_emails` | boolean | No | Whether the contact is unsubscribed from emails | -| `custom_attributes` | string | No | Custom attributes as JSON object \(e.g., \{"attribute_name": "value"\}\) | -| `company_id` | string | No | Company ID to associate the contact with during creation | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `contact` | object | Created contact object | - -### `intercom_get_contact` - -Get a single contact by ID from Intercom - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `contactId` | string | Yes | Contact ID to retrieve | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `contact` | object | Contact object | - -### `intercom_update_contact` - -Update an existing contact in Intercom - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `contactId` | string | Yes | Contact ID to update | -| `role` | string | No | The role of the contact. Accepts 'user' or 'lead'. | -| `external_id` | string | No | A unique identifier for the contact provided by the client | -| `email` | string | No | The contact's email address | -| `phone` | string | No | The contact's phone number | -| `name` | string | No | The contact's name | -| `avatar` | string | No | An avatar image URL for the contact | -| `signed_up_at` | number | No | The time the user signed up as a Unix timestamp | -| `last_seen_at` | number | No | The time the user was last seen as a Unix timestamp | -| `owner_id` | string | No | The id of an admin that has been assigned account ownership of the contact | -| `unsubscribed_from_emails` | boolean | No | Whether the contact is unsubscribed from emails | -| `custom_attributes` | string | No | Custom attributes as JSON object \(e.g., \{"attribute_name": "value"\}\) | -| `company_id` | string | No | Company ID to associate the contact with | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `contact` | object | Updated contact object | - -### `intercom_list_contacts` - -List all contacts from Intercom with pagination support - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `per_page` | number | No | Number of results per page \(max: 150\) | -| `starting_after` | string | No | Cursor for pagination - ID to start after | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `contacts` | array | Array of contact objects | - -### `intercom_search_contacts` - -Search for contacts in Intercom using a query - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `query` | string | Yes | Search query \(e.g., \{"field":"email","operator":"=","value":"user@example.com"\}\) | -| `per_page` | number | No | Number of results per page \(max: 150\) | -| `starting_after` | string | No | Cursor for pagination | -| `sort_field` | string | No | Field to sort by \(e.g., "name", "created_at", "last_seen_at"\) | -| `sort_order` | string | No | Sort order: "ascending" or "descending" | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `contacts` | array | Array of matching contact objects | - -### `intercom_delete_contact` - -Delete a contact from Intercom by ID - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `contactId` | string | Yes | Contact ID to delete | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `id` | string | ID of deleted contact | -| `deleted` | boolean | Whether the contact was deleted | -| `metadata` | object | Operation metadata | - -### `intercom_create_company` - -Create or update a company in Intercom - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `company_id` | string | Yes | Your unique identifier for the company | -| `name` | string | No | The name of the company | -| `website` | string | No | The company website | -| `plan` | string | No | The company plan name | -| `size` | number | No | The number of employees in the company | -| `industry` | string | No | The industry the company operates in | -| `monthly_spend` | number | No | How much revenue the company generates for your business. Note: This field truncates floats to whole integers \(e.g., 155.98 becomes 155\) | -| `custom_attributes` | string | No | Custom attributes as JSON object | -| `remote_created_at` | number | No | The time the company was created by you as a Unix timestamp | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `company` | object | Created or updated company object | - -### `intercom_get_company` - -Retrieve a single company by ID from Intercom - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `companyId` | string | Yes | Company ID to retrieve | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `company` | object | Company object | - -### `intercom_list_companies` - -List all companies from Intercom with pagination support. Note: This endpoint has a limit of 10,000 companies that can be returned using pagination. For datasets larger than 10,000 companies, use the Scroll API instead. - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `per_page` | number | No | Number of results per page | -| `page` | number | No | Page number | -| `starting_after` | string | No | Cursor for pagination \(preferred over page-based pagination\) | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `companies` | array | Array of company objects | - -### `intercom_get_conversation` - -Retrieve a single conversation by ID from Intercom - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `conversationId` | string | Yes | Conversation ID to retrieve | -| `display_as` | string | No | Set to "plaintext" to retrieve messages in plain text | -| `include_translations` | boolean | No | When true, conversation parts will be translated to the detected language of the conversation | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `conversation` | object | Conversation object | - -### `intercom_list_conversations` - -List all conversations from Intercom with pagination support - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `per_page` | number | No | Number of results per page \(max: 150\) | -| `starting_after` | string | No | Cursor for pagination | -| `sort` | string | No | Field to sort by \(e.g., "waiting_since", "updated_at", "created_at"\) | -| `order` | string | No | Sort order: "asc" \(ascending\) or "desc" \(descending\) | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `conversations` | array | Array of conversation objects | - -### `intercom_reply_conversation` - -Reply to a conversation as an admin in Intercom - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `conversationId` | string | Yes | Conversation ID to reply to | -| `message_type` | string | Yes | Message type: "comment" or "note" | -| `body` | string | Yes | The text body of the reply | -| `admin_id` | string | No | The ID of the admin authoring the reply. If not provided, a default admin \(Operator/Fin\) will be used. | -| `attachment_urls` | string | No | Comma-separated list of image URLs \(max 10\) | -| `created_at` | number | No | Unix timestamp for when the reply was created. If not provided, current time is used. | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `conversation` | object | Updated conversation object | - -### `intercom_search_conversations` - -Search for conversations in Intercom using a query - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `query` | string | Yes | Search query as JSON object | -| `per_page` | number | No | Number of results per page \(max: 150\) | -| `starting_after` | string | No | Cursor for pagination | -| `sort_field` | string | No | Field to sort by \(e.g., "created_at", "updated_at"\) | -| `sort_order` | string | No | Sort order: "ascending" or "descending" | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `conversations` | array | Array of matching conversation objects | - -### `intercom_create_ticket` - -Create a new ticket in Intercom - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `ticket_type_id` | string | Yes | The ID of the ticket type | -| `contacts` | string | Yes | JSON array of contact identifiers \(e.g., \[\{"id": "contact_id"\}\]\) | -| `ticket_attributes` | string | Yes | JSON object with ticket attributes including _default_title_ and _default_description_ | -| `company_id` | string | No | Company ID to associate the ticket with | -| `created_at` | number | No | Unix timestamp for when the ticket was created. If not provided, current time is used. | -| `conversation_to_link_id` | string | No | ID of an existing conversation to link to this ticket | -| `disable_notifications` | boolean | No | When true, suppresses notifications when the ticket is created | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `ticket` | object | Created ticket object | - -### `intercom_get_ticket` - -Retrieve a single ticket by ID from Intercom - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `ticketId` | string | Yes | Ticket ID to retrieve | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `ticket` | object | Ticket object | - -### `intercom_create_message` - -Create and send a new admin-initiated message in Intercom - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `message_type` | string | Yes | Message type: "inapp" for in-app messages or "email" for email messages | -| `template` | string | Yes | Message template style: "plain" for plain text or "personal" for personalized style | -| `subject` | string | No | The subject of the message \(for email type\) | -| `body` | string | Yes | The body of the message | -| `from_type` | string | Yes | Sender type: "admin" | -| `from_id` | string | Yes | The ID of the admin sending the message | -| `to_type` | string | Yes | Recipient type: "contact" | -| `to_id` | string | Yes | The ID of the contact receiving the message | -| `created_at` | number | No | Unix timestamp for when the message was created. If not provided, current time is used. | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `message` | object | Created message object | - - - -## Notes - -- Category: `tools` -- Type: `intercom` diff --git a/apps/docs/content/docs/en/tools/intercom_v2.mdx b/apps/docs/content/docs/en/tools/intercom_v2.mdx new file mode 100644 index 0000000000..291ae02d45 --- /dev/null +++ b/apps/docs/content/docs/en/tools/intercom_v2.mdx @@ -0,0 +1,790 @@ +--- +title: Intercom +description: Contact object from contact operations +--- + +import { BlockInfoCard } from "@/components/ui/block-info-card" + + + + + +## Tools + +### `intercom_create_contact_v2` + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `contact` | object | Contact object from contact operations | +| `properties` | number | Current page number | +| `id` | string | ID of the deleted item \(for delete operations\) | +| `type` | string | Type of the message | +| `role` | string | Role of the contact \(user or lead\) | +| `email` | string | Email address of the contact | +| `phone` | string | Phone number of the contact | +| `name` | string | Name of the company | +| `external_id` | string | External identifier for the contact | +| `created_at` | number | Unix timestamp when contact was created | +| `updated_at` | number | Unix timestamp when contact was last updated | +| `contactId` | string | ID of the contact \(for create/update operations\) | +| `contacts` | array | Array of contacts \(for list/search operations\) | +| `company` | object | Company object from company operations | +| `company_id` | string | Your unique identifier for the company | +| `website` | string | Company website URL | +| `companyId` | string | ID of the company \(for create operations\) | +| `companies` | array | Array of companies \(for list operations\) | +| `conversation` | object | Conversation object from conversation operations | +| `title` | string | Title of the conversation | +| `state` | string | State of the conversation | +| `open` | boolean | Whether the conversation is open | +| `conversationId` | string | ID of the conversation \(for reply operations\) | +| `conversations` | array | Array of conversations \(for list/search operations\) | +| `ticket` | object | Ticket object from ticket operations | +| `ticket_id` | string | Ticket ID | +| `ticket_state` | string | State of the ticket | +| `ticketId` | string | ID of the ticket \(for create operations\) | +| `message` | object | Message object from message operations | +| `messageId` | string | ID of the message \(for create operations\) | +| `total_count` | number | Total count \(for list/search operations\) | +| `pages` | object | Pagination information | +| `page` | number | Current page number | +| `per_page` | number | Number of results per page | +| `total_pages` | number | Total number of pages | +| `deleted` | boolean | Whether the item was deleted \(for delete operations\) | + +### `intercom_get_contact_v2` + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `contact` | object | Contact object from contact operations | +| `properties` | number | Current page number | +| `id` | string | ID of the deleted item \(for delete operations\) | +| `type` | string | Type of the message | +| `role` | string | Role of the contact \(user or lead\) | +| `email` | string | Email address of the contact | +| `phone` | string | Phone number of the contact | +| `name` | string | Name of the company | +| `external_id` | string | External identifier for the contact | +| `created_at` | number | Unix timestamp when contact was created | +| `updated_at` | number | Unix timestamp when contact was last updated | +| `contactId` | string | ID of the contact \(for create/update operations\) | +| `contacts` | array | Array of contacts \(for list/search operations\) | +| `company` | object | Company object from company operations | +| `company_id` | string | Your unique identifier for the company | +| `website` | string | Company website URL | +| `companyId` | string | ID of the company \(for create operations\) | +| `companies` | array | Array of companies \(for list operations\) | +| `conversation` | object | Conversation object from conversation operations | +| `title` | string | Title of the conversation | +| `state` | string | State of the conversation | +| `open` | boolean | Whether the conversation is open | +| `conversationId` | string | ID of the conversation \(for reply operations\) | +| `conversations` | array | Array of conversations \(for list/search operations\) | +| `ticket` | object | Ticket object from ticket operations | +| `ticket_id` | string | Ticket ID | +| `ticket_state` | string | State of the ticket | +| `ticketId` | string | ID of the ticket \(for create operations\) | +| `message` | object | Message object from message operations | +| `messageId` | string | ID of the message \(for create operations\) | +| `total_count` | number | Total count \(for list/search operations\) | +| `pages` | object | Pagination information | +| `page` | number | Current page number | +| `per_page` | number | Number of results per page | +| `total_pages` | number | Total number of pages | +| `deleted` | boolean | Whether the item was deleted \(for delete operations\) | + +### `intercom_update_contact_v2` + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `contact` | object | Contact object from contact operations | +| `properties` | number | Current page number | +| `id` | string | ID of the deleted item \(for delete operations\) | +| `type` | string | Type of the message | +| `role` | string | Role of the contact \(user or lead\) | +| `email` | string | Email address of the contact | +| `phone` | string | Phone number of the contact | +| `name` | string | Name of the company | +| `external_id` | string | External identifier for the contact | +| `created_at` | number | Unix timestamp when contact was created | +| `updated_at` | number | Unix timestamp when contact was last updated | +| `contactId` | string | ID of the contact \(for create/update operations\) | +| `contacts` | array | Array of contacts \(for list/search operations\) | +| `company` | object | Company object from company operations | +| `company_id` | string | Your unique identifier for the company | +| `website` | string | Company website URL | +| `companyId` | string | ID of the company \(for create operations\) | +| `companies` | array | Array of companies \(for list operations\) | +| `conversation` | object | Conversation object from conversation operations | +| `title` | string | Title of the conversation | +| `state` | string | State of the conversation | +| `open` | boolean | Whether the conversation is open | +| `conversationId` | string | ID of the conversation \(for reply operations\) | +| `conversations` | array | Array of conversations \(for list/search operations\) | +| `ticket` | object | Ticket object from ticket operations | +| `ticket_id` | string | Ticket ID | +| `ticket_state` | string | State of the ticket | +| `ticketId` | string | ID of the ticket \(for create operations\) | +| `message` | object | Message object from message operations | +| `messageId` | string | ID of the message \(for create operations\) | +| `total_count` | number | Total count \(for list/search operations\) | +| `pages` | object | Pagination information | +| `page` | number | Current page number | +| `per_page` | number | Number of results per page | +| `total_pages` | number | Total number of pages | +| `deleted` | boolean | Whether the item was deleted \(for delete operations\) | + +### `intercom_list_contacts_v2` + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `contact` | object | Contact object from contact operations | +| `properties` | number | Current page number | +| `id` | string | ID of the deleted item \(for delete operations\) | +| `type` | string | Type of the message | +| `role` | string | Role of the contact \(user or lead\) | +| `email` | string | Email address of the contact | +| `phone` | string | Phone number of the contact | +| `name` | string | Name of the company | +| `external_id` | string | External identifier for the contact | +| `created_at` | number | Unix timestamp when contact was created | +| `updated_at` | number | Unix timestamp when contact was last updated | +| `contactId` | string | ID of the contact \(for create/update operations\) | +| `contacts` | array | Array of contacts \(for list/search operations\) | +| `company` | object | Company object from company operations | +| `company_id` | string | Your unique identifier for the company | +| `website` | string | Company website URL | +| `companyId` | string | ID of the company \(for create operations\) | +| `companies` | array | Array of companies \(for list operations\) | +| `conversation` | object | Conversation object from conversation operations | +| `title` | string | Title of the conversation | +| `state` | string | State of the conversation | +| `open` | boolean | Whether the conversation is open | +| `conversationId` | string | ID of the conversation \(for reply operations\) | +| `conversations` | array | Array of conversations \(for list/search operations\) | +| `ticket` | object | Ticket object from ticket operations | +| `ticket_id` | string | Ticket ID | +| `ticket_state` | string | State of the ticket | +| `ticketId` | string | ID of the ticket \(for create operations\) | +| `message` | object | Message object from message operations | +| `messageId` | string | ID of the message \(for create operations\) | +| `total_count` | number | Total count \(for list/search operations\) | +| `pages` | object | Pagination information | +| `page` | number | Current page number | +| `per_page` | number | Number of results per page | +| `total_pages` | number | Total number of pages | +| `deleted` | boolean | Whether the item was deleted \(for delete operations\) | + +### `intercom_search_contacts_v2` + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `contact` | object | Contact object from contact operations | +| `properties` | number | Current page number | +| `id` | string | ID of the deleted item \(for delete operations\) | +| `type` | string | Type of the message | +| `role` | string | Role of the contact \(user or lead\) | +| `email` | string | Email address of the contact | +| `phone` | string | Phone number of the contact | +| `name` | string | Name of the company | +| `external_id` | string | External identifier for the contact | +| `created_at` | number | Unix timestamp when contact was created | +| `updated_at` | number | Unix timestamp when contact was last updated | +| `contactId` | string | ID of the contact \(for create/update operations\) | +| `contacts` | array | Array of contacts \(for list/search operations\) | +| `company` | object | Company object from company operations | +| `company_id` | string | Your unique identifier for the company | +| `website` | string | Company website URL | +| `companyId` | string | ID of the company \(for create operations\) | +| `companies` | array | Array of companies \(for list operations\) | +| `conversation` | object | Conversation object from conversation operations | +| `title` | string | Title of the conversation | +| `state` | string | State of the conversation | +| `open` | boolean | Whether the conversation is open | +| `conversationId` | string | ID of the conversation \(for reply operations\) | +| `conversations` | array | Array of conversations \(for list/search operations\) | +| `ticket` | object | Ticket object from ticket operations | +| `ticket_id` | string | Ticket ID | +| `ticket_state` | string | State of the ticket | +| `ticketId` | string | ID of the ticket \(for create operations\) | +| `message` | object | Message object from message operations | +| `messageId` | string | ID of the message \(for create operations\) | +| `total_count` | number | Total count \(for list/search operations\) | +| `pages` | object | Pagination information | +| `page` | number | Current page number | +| `per_page` | number | Number of results per page | +| `total_pages` | number | Total number of pages | +| `deleted` | boolean | Whether the item was deleted \(for delete operations\) | + +### `intercom_delete_contact_v2` + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `contact` | object | Contact object from contact operations | +| `properties` | number | Current page number | +| `id` | string | ID of the deleted item \(for delete operations\) | +| `type` | string | Type of the message | +| `role` | string | Role of the contact \(user or lead\) | +| `email` | string | Email address of the contact | +| `phone` | string | Phone number of the contact | +| `name` | string | Name of the company | +| `external_id` | string | External identifier for the contact | +| `created_at` | number | Unix timestamp when contact was created | +| `updated_at` | number | Unix timestamp when contact was last updated | +| `contactId` | string | ID of the contact \(for create/update operations\) | +| `contacts` | array | Array of contacts \(for list/search operations\) | +| `company` | object | Company object from company operations | +| `company_id` | string | Your unique identifier for the company | +| `website` | string | Company website URL | +| `companyId` | string | ID of the company \(for create operations\) | +| `companies` | array | Array of companies \(for list operations\) | +| `conversation` | object | Conversation object from conversation operations | +| `title` | string | Title of the conversation | +| `state` | string | State of the conversation | +| `open` | boolean | Whether the conversation is open | +| `conversationId` | string | ID of the conversation \(for reply operations\) | +| `conversations` | array | Array of conversations \(for list/search operations\) | +| `ticket` | object | Ticket object from ticket operations | +| `ticket_id` | string | Ticket ID | +| `ticket_state` | string | State of the ticket | +| `ticketId` | string | ID of the ticket \(for create operations\) | +| `message` | object | Message object from message operations | +| `messageId` | string | ID of the message \(for create operations\) | +| `total_count` | number | Total count \(for list/search operations\) | +| `pages` | object | Pagination information | +| `page` | number | Current page number | +| `per_page` | number | Number of results per page | +| `total_pages` | number | Total number of pages | +| `deleted` | boolean | Whether the item was deleted \(for delete operations\) | + +### `intercom_create_company_v2` + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `contact` | object | Contact object from contact operations | +| `properties` | number | Current page number | +| `id` | string | ID of the deleted item \(for delete operations\) | +| `type` | string | Type of the message | +| `role` | string | Role of the contact \(user or lead\) | +| `email` | string | Email address of the contact | +| `phone` | string | Phone number of the contact | +| `name` | string | Name of the company | +| `external_id` | string | External identifier for the contact | +| `created_at` | number | Unix timestamp when contact was created | +| `updated_at` | number | Unix timestamp when contact was last updated | +| `contactId` | string | ID of the contact \(for create/update operations\) | +| `contacts` | array | Array of contacts \(for list/search operations\) | +| `company` | object | Company object from company operations | +| `company_id` | string | Your unique identifier for the company | +| `website` | string | Company website URL | +| `companyId` | string | ID of the company \(for create operations\) | +| `companies` | array | Array of companies \(for list operations\) | +| `conversation` | object | Conversation object from conversation operations | +| `title` | string | Title of the conversation | +| `state` | string | State of the conversation | +| `open` | boolean | Whether the conversation is open | +| `conversationId` | string | ID of the conversation \(for reply operations\) | +| `conversations` | array | Array of conversations \(for list/search operations\) | +| `ticket` | object | Ticket object from ticket operations | +| `ticket_id` | string | Ticket ID | +| `ticket_state` | string | State of the ticket | +| `ticketId` | string | ID of the ticket \(for create operations\) | +| `message` | object | Message object from message operations | +| `messageId` | string | ID of the message \(for create operations\) | +| `total_count` | number | Total count \(for list/search operations\) | +| `pages` | object | Pagination information | +| `page` | number | Current page number | +| `per_page` | number | Number of results per page | +| `total_pages` | number | Total number of pages | +| `deleted` | boolean | Whether the item was deleted \(for delete operations\) | + +### `intercom_get_company_v2` + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `contact` | object | Contact object from contact operations | +| `properties` | number | Current page number | +| `id` | string | ID of the deleted item \(for delete operations\) | +| `type` | string | Type of the message | +| `role` | string | Role of the contact \(user or lead\) | +| `email` | string | Email address of the contact | +| `phone` | string | Phone number of the contact | +| `name` | string | Name of the company | +| `external_id` | string | External identifier for the contact | +| `created_at` | number | Unix timestamp when contact was created | +| `updated_at` | number | Unix timestamp when contact was last updated | +| `contactId` | string | ID of the contact \(for create/update operations\) | +| `contacts` | array | Array of contacts \(for list/search operations\) | +| `company` | object | Company object from company operations | +| `company_id` | string | Your unique identifier for the company | +| `website` | string | Company website URL | +| `companyId` | string | ID of the company \(for create operations\) | +| `companies` | array | Array of companies \(for list operations\) | +| `conversation` | object | Conversation object from conversation operations | +| `title` | string | Title of the conversation | +| `state` | string | State of the conversation | +| `open` | boolean | Whether the conversation is open | +| `conversationId` | string | ID of the conversation \(for reply operations\) | +| `conversations` | array | Array of conversations \(for list/search operations\) | +| `ticket` | object | Ticket object from ticket operations | +| `ticket_id` | string | Ticket ID | +| `ticket_state` | string | State of the ticket | +| `ticketId` | string | ID of the ticket \(for create operations\) | +| `message` | object | Message object from message operations | +| `messageId` | string | ID of the message \(for create operations\) | +| `total_count` | number | Total count \(for list/search operations\) | +| `pages` | object | Pagination information | +| `page` | number | Current page number | +| `per_page` | number | Number of results per page | +| `total_pages` | number | Total number of pages | +| `deleted` | boolean | Whether the item was deleted \(for delete operations\) | + +### `intercom_list_companies_v2` + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `contact` | object | Contact object from contact operations | +| `properties` | number | Current page number | +| `id` | string | ID of the deleted item \(for delete operations\) | +| `type` | string | Type of the message | +| `role` | string | Role of the contact \(user or lead\) | +| `email` | string | Email address of the contact | +| `phone` | string | Phone number of the contact | +| `name` | string | Name of the company | +| `external_id` | string | External identifier for the contact | +| `created_at` | number | Unix timestamp when contact was created | +| `updated_at` | number | Unix timestamp when contact was last updated | +| `contactId` | string | ID of the contact \(for create/update operations\) | +| `contacts` | array | Array of contacts \(for list/search operations\) | +| `company` | object | Company object from company operations | +| `company_id` | string | Your unique identifier for the company | +| `website` | string | Company website URL | +| `companyId` | string | ID of the company \(for create operations\) | +| `companies` | array | Array of companies \(for list operations\) | +| `conversation` | object | Conversation object from conversation operations | +| `title` | string | Title of the conversation | +| `state` | string | State of the conversation | +| `open` | boolean | Whether the conversation is open | +| `conversationId` | string | ID of the conversation \(for reply operations\) | +| `conversations` | array | Array of conversations \(for list/search operations\) | +| `ticket` | object | Ticket object from ticket operations | +| `ticket_id` | string | Ticket ID | +| `ticket_state` | string | State of the ticket | +| `ticketId` | string | ID of the ticket \(for create operations\) | +| `message` | object | Message object from message operations | +| `messageId` | string | ID of the message \(for create operations\) | +| `total_count` | number | Total count \(for list/search operations\) | +| `pages` | object | Pagination information | +| `page` | number | Current page number | +| `per_page` | number | Number of results per page | +| `total_pages` | number | Total number of pages | +| `deleted` | boolean | Whether the item was deleted \(for delete operations\) | + +### `intercom_get_conversation_v2` + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `contact` | object | Contact object from contact operations | +| `properties` | number | Current page number | +| `id` | string | ID of the deleted item \(for delete operations\) | +| `type` | string | Type of the message | +| `role` | string | Role of the contact \(user or lead\) | +| `email` | string | Email address of the contact | +| `phone` | string | Phone number of the contact | +| `name` | string | Name of the company | +| `external_id` | string | External identifier for the contact | +| `created_at` | number | Unix timestamp when contact was created | +| `updated_at` | number | Unix timestamp when contact was last updated | +| `contactId` | string | ID of the contact \(for create/update operations\) | +| `contacts` | array | Array of contacts \(for list/search operations\) | +| `company` | object | Company object from company operations | +| `company_id` | string | Your unique identifier for the company | +| `website` | string | Company website URL | +| `companyId` | string | ID of the company \(for create operations\) | +| `companies` | array | Array of companies \(for list operations\) | +| `conversation` | object | Conversation object from conversation operations | +| `title` | string | Title of the conversation | +| `state` | string | State of the conversation | +| `open` | boolean | Whether the conversation is open | +| `conversationId` | string | ID of the conversation \(for reply operations\) | +| `conversations` | array | Array of conversations \(for list/search operations\) | +| `ticket` | object | Ticket object from ticket operations | +| `ticket_id` | string | Ticket ID | +| `ticket_state` | string | State of the ticket | +| `ticketId` | string | ID of the ticket \(for create operations\) | +| `message` | object | Message object from message operations | +| `messageId` | string | ID of the message \(for create operations\) | +| `total_count` | number | Total count \(for list/search operations\) | +| `pages` | object | Pagination information | +| `page` | number | Current page number | +| `per_page` | number | Number of results per page | +| `total_pages` | number | Total number of pages | +| `deleted` | boolean | Whether the item was deleted \(for delete operations\) | + +### `intercom_list_conversations_v2` + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `contact` | object | Contact object from contact operations | +| `properties` | number | Current page number | +| `id` | string | ID of the deleted item \(for delete operations\) | +| `type` | string | Type of the message | +| `role` | string | Role of the contact \(user or lead\) | +| `email` | string | Email address of the contact | +| `phone` | string | Phone number of the contact | +| `name` | string | Name of the company | +| `external_id` | string | External identifier for the contact | +| `created_at` | number | Unix timestamp when contact was created | +| `updated_at` | number | Unix timestamp when contact was last updated | +| `contactId` | string | ID of the contact \(for create/update operations\) | +| `contacts` | array | Array of contacts \(for list/search operations\) | +| `company` | object | Company object from company operations | +| `company_id` | string | Your unique identifier for the company | +| `website` | string | Company website URL | +| `companyId` | string | ID of the company \(for create operations\) | +| `companies` | array | Array of companies \(for list operations\) | +| `conversation` | object | Conversation object from conversation operations | +| `title` | string | Title of the conversation | +| `state` | string | State of the conversation | +| `open` | boolean | Whether the conversation is open | +| `conversationId` | string | ID of the conversation \(for reply operations\) | +| `conversations` | array | Array of conversations \(for list/search operations\) | +| `ticket` | object | Ticket object from ticket operations | +| `ticket_id` | string | Ticket ID | +| `ticket_state` | string | State of the ticket | +| `ticketId` | string | ID of the ticket \(for create operations\) | +| `message` | object | Message object from message operations | +| `messageId` | string | ID of the message \(for create operations\) | +| `total_count` | number | Total count \(for list/search operations\) | +| `pages` | object | Pagination information | +| `page` | number | Current page number | +| `per_page` | number | Number of results per page | +| `total_pages` | number | Total number of pages | +| `deleted` | boolean | Whether the item was deleted \(for delete operations\) | + +### `intercom_reply_conversation_v2` + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `contact` | object | Contact object from contact operations | +| `properties` | number | Current page number | +| `id` | string | ID of the deleted item \(for delete operations\) | +| `type` | string | Type of the message | +| `role` | string | Role of the contact \(user or lead\) | +| `email` | string | Email address of the contact | +| `phone` | string | Phone number of the contact | +| `name` | string | Name of the company | +| `external_id` | string | External identifier for the contact | +| `created_at` | number | Unix timestamp when contact was created | +| `updated_at` | number | Unix timestamp when contact was last updated | +| `contactId` | string | ID of the contact \(for create/update operations\) | +| `contacts` | array | Array of contacts \(for list/search operations\) | +| `company` | object | Company object from company operations | +| `company_id` | string | Your unique identifier for the company | +| `website` | string | Company website URL | +| `companyId` | string | ID of the company \(for create operations\) | +| `companies` | array | Array of companies \(for list operations\) | +| `conversation` | object | Conversation object from conversation operations | +| `title` | string | Title of the conversation | +| `state` | string | State of the conversation | +| `open` | boolean | Whether the conversation is open | +| `conversationId` | string | ID of the conversation \(for reply operations\) | +| `conversations` | array | Array of conversations \(for list/search operations\) | +| `ticket` | object | Ticket object from ticket operations | +| `ticket_id` | string | Ticket ID | +| `ticket_state` | string | State of the ticket | +| `ticketId` | string | ID of the ticket \(for create operations\) | +| `message` | object | Message object from message operations | +| `messageId` | string | ID of the message \(for create operations\) | +| `total_count` | number | Total count \(for list/search operations\) | +| `pages` | object | Pagination information | +| `page` | number | Current page number | +| `per_page` | number | Number of results per page | +| `total_pages` | number | Total number of pages | +| `deleted` | boolean | Whether the item was deleted \(for delete operations\) | + +### `intercom_search_conversations_v2` + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `contact` | object | Contact object from contact operations | +| `properties` | number | Current page number | +| `id` | string | ID of the deleted item \(for delete operations\) | +| `type` | string | Type of the message | +| `role` | string | Role of the contact \(user or lead\) | +| `email` | string | Email address of the contact | +| `phone` | string | Phone number of the contact | +| `name` | string | Name of the company | +| `external_id` | string | External identifier for the contact | +| `created_at` | number | Unix timestamp when contact was created | +| `updated_at` | number | Unix timestamp when contact was last updated | +| `contactId` | string | ID of the contact \(for create/update operations\) | +| `contacts` | array | Array of contacts \(for list/search operations\) | +| `company` | object | Company object from company operations | +| `company_id` | string | Your unique identifier for the company | +| `website` | string | Company website URL | +| `companyId` | string | ID of the company \(for create operations\) | +| `companies` | array | Array of companies \(for list operations\) | +| `conversation` | object | Conversation object from conversation operations | +| `title` | string | Title of the conversation | +| `state` | string | State of the conversation | +| `open` | boolean | Whether the conversation is open | +| `conversationId` | string | ID of the conversation \(for reply operations\) | +| `conversations` | array | Array of conversations \(for list/search operations\) | +| `ticket` | object | Ticket object from ticket operations | +| `ticket_id` | string | Ticket ID | +| `ticket_state` | string | State of the ticket | +| `ticketId` | string | ID of the ticket \(for create operations\) | +| `message` | object | Message object from message operations | +| `messageId` | string | ID of the message \(for create operations\) | +| `total_count` | number | Total count \(for list/search operations\) | +| `pages` | object | Pagination information | +| `page` | number | Current page number | +| `per_page` | number | Number of results per page | +| `total_pages` | number | Total number of pages | +| `deleted` | boolean | Whether the item was deleted \(for delete operations\) | + +### `intercom_create_ticket_v2` + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `contact` | object | Contact object from contact operations | +| `properties` | number | Current page number | +| `id` | string | ID of the deleted item \(for delete operations\) | +| `type` | string | Type of the message | +| `role` | string | Role of the contact \(user or lead\) | +| `email` | string | Email address of the contact | +| `phone` | string | Phone number of the contact | +| `name` | string | Name of the company | +| `external_id` | string | External identifier for the contact | +| `created_at` | number | Unix timestamp when contact was created | +| `updated_at` | number | Unix timestamp when contact was last updated | +| `contactId` | string | ID of the contact \(for create/update operations\) | +| `contacts` | array | Array of contacts \(for list/search operations\) | +| `company` | object | Company object from company operations | +| `company_id` | string | Your unique identifier for the company | +| `website` | string | Company website URL | +| `companyId` | string | ID of the company \(for create operations\) | +| `companies` | array | Array of companies \(for list operations\) | +| `conversation` | object | Conversation object from conversation operations | +| `title` | string | Title of the conversation | +| `state` | string | State of the conversation | +| `open` | boolean | Whether the conversation is open | +| `conversationId` | string | ID of the conversation \(for reply operations\) | +| `conversations` | array | Array of conversations \(for list/search operations\) | +| `ticket` | object | Ticket object from ticket operations | +| `ticket_id` | string | Ticket ID | +| `ticket_state` | string | State of the ticket | +| `ticketId` | string | ID of the ticket \(for create operations\) | +| `message` | object | Message object from message operations | +| `messageId` | string | ID of the message \(for create operations\) | +| `total_count` | number | Total count \(for list/search operations\) | +| `pages` | object | Pagination information | +| `page` | number | Current page number | +| `per_page` | number | Number of results per page | +| `total_pages` | number | Total number of pages | +| `deleted` | boolean | Whether the item was deleted \(for delete operations\) | + +### `intercom_get_ticket_v2` + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `contact` | object | Contact object from contact operations | +| `properties` | number | Current page number | +| `id` | string | ID of the deleted item \(for delete operations\) | +| `type` | string | Type of the message | +| `role` | string | Role of the contact \(user or lead\) | +| `email` | string | Email address of the contact | +| `phone` | string | Phone number of the contact | +| `name` | string | Name of the company | +| `external_id` | string | External identifier for the contact | +| `created_at` | number | Unix timestamp when contact was created | +| `updated_at` | number | Unix timestamp when contact was last updated | +| `contactId` | string | ID of the contact \(for create/update operations\) | +| `contacts` | array | Array of contacts \(for list/search operations\) | +| `company` | object | Company object from company operations | +| `company_id` | string | Your unique identifier for the company | +| `website` | string | Company website URL | +| `companyId` | string | ID of the company \(for create operations\) | +| `companies` | array | Array of companies \(for list operations\) | +| `conversation` | object | Conversation object from conversation operations | +| `title` | string | Title of the conversation | +| `state` | string | State of the conversation | +| `open` | boolean | Whether the conversation is open | +| `conversationId` | string | ID of the conversation \(for reply operations\) | +| `conversations` | array | Array of conversations \(for list/search operations\) | +| `ticket` | object | Ticket object from ticket operations | +| `ticket_id` | string | Ticket ID | +| `ticket_state` | string | State of the ticket | +| `ticketId` | string | ID of the ticket \(for create operations\) | +| `message` | object | Message object from message operations | +| `messageId` | string | ID of the message \(for create operations\) | +| `total_count` | number | Total count \(for list/search operations\) | +| `pages` | object | Pagination information | +| `page` | number | Current page number | +| `per_page` | number | Number of results per page | +| `total_pages` | number | Total number of pages | +| `deleted` | boolean | Whether the item was deleted \(for delete operations\) | + +### `intercom_create_message_v2` + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `contact` | object | Contact object from contact operations | +| `properties` | number | Current page number | +| `id` | string | ID of the deleted item \(for delete operations\) | +| `type` | string | Type of the message | +| `role` | string | Role of the contact \(user or lead\) | +| `email` | string | Email address of the contact | +| `phone` | string | Phone number of the contact | +| `name` | string | Name of the company | +| `external_id` | string | External identifier for the contact | +| `created_at` | number | Unix timestamp when contact was created | +| `updated_at` | number | Unix timestamp when contact was last updated | +| `contactId` | string | ID of the contact \(for create/update operations\) | +| `contacts` | array | Array of contacts \(for list/search operations\) | +| `company` | object | Company object from company operations | +| `company_id` | string | Your unique identifier for the company | +| `website` | string | Company website URL | +| `companyId` | string | ID of the company \(for create operations\) | +| `companies` | array | Array of companies \(for list operations\) | +| `conversation` | object | Conversation object from conversation operations | +| `title` | string | Title of the conversation | +| `state` | string | State of the conversation | +| `open` | boolean | Whether the conversation is open | +| `conversationId` | string | ID of the conversation \(for reply operations\) | +| `conversations` | array | Array of conversations \(for list/search operations\) | +| `ticket` | object | Ticket object from ticket operations | +| `ticket_id` | string | Ticket ID | +| `ticket_state` | string | State of the ticket | +| `ticketId` | string | ID of the ticket \(for create operations\) | +| `message` | object | Message object from message operations | +| `messageId` | string | ID of the message \(for create operations\) | +| `total_count` | number | Total count \(for list/search operations\) | +| `pages` | object | Pagination information | +| `page` | number | Current page number | +| `per_page` | number | Number of results per page | +| `total_pages` | number | Total number of pages | +| `deleted` | boolean | Whether the item was deleted \(for delete operations\) | + + + +## Notes + +- Category: `misc` +- Type: `intercom_v2` diff --git a/apps/docs/content/docs/en/tools/mailchimp.mdx b/apps/docs/content/docs/en/tools/mailchimp.mdx index 4a5efcb821..4b8a5e05a9 100644 --- a/apps/docs/content/docs/en/tools/mailchimp.mdx +++ b/apps/docs/content/docs/en/tools/mailchimp.mdx @@ -70,8 +70,8 @@ Retrieve a list of audiences (lists) from Mailchimp | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Audiences data and metadata | +| `success` | boolean | Whether the audiences were successfully retrieved | +| `output` | object | Audiences data | ### `mailchimp_get_audience` @@ -88,8 +88,8 @@ Retrieve details of a specific audience (list) from Mailchimp | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Audience data and metadata | +| `success` | boolean | Whether the audience was successfully retrieved | +| `output` | object | Audience data | ### `mailchimp_create_audience` @@ -150,8 +150,7 @@ Delete an audience (list) from Mailchimp | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Deletion confirmation | +| `success` | boolean | Whether the audience was successfully deleted | ### `mailchimp_get_members` @@ -171,8 +170,8 @@ Retrieve a list of members from a Mailchimp audience | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Members data and metadata | +| `success` | boolean | Whether the members were successfully retrieved | +| `output` | object | Members data | ### `mailchimp_get_member` @@ -190,8 +189,8 @@ Retrieve details of a specific member from a Mailchimp audience | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Member data and metadata | +| `success` | boolean | Whether the member was successfully retrieved | +| `output` | object | Member data | ### `mailchimp_add_member` @@ -277,8 +276,7 @@ Delete a member from a Mailchimp audience | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Deletion confirmation | +| `success` | boolean | Whether the member was successfully deleted | ### `mailchimp_archive_member` @@ -338,8 +336,8 @@ Retrieve a list of campaigns from Mailchimp | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Campaigns data and metadata | +| `success` | boolean | Whether the campaigns were successfully retrieved | +| `output` | object | Campaigns data | ### `mailchimp_get_campaign` @@ -356,8 +354,8 @@ Retrieve details of a specific campaign from Mailchimp | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Campaign data and metadata | +| `success` | boolean | Whether the campaign was successfully retrieved | +| `output` | object | Campaign data | ### `mailchimp_create_campaign` @@ -414,8 +412,7 @@ Delete a campaign from Mailchimp | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Deletion confirmation | +| `success` | boolean | Whether the campaign was successfully deleted | ### `mailchimp_send_campaign` @@ -451,8 +448,7 @@ Schedule a Mailchimp campaign to be sent at a specific time | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Schedule confirmation | +| `success` | boolean | Whether the campaign was successfully scheduled | ### `mailchimp_unschedule_campaign` @@ -505,7 +501,7 @@ Retrieve the HTML and plain-text content for a Mailchimp campaign | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | +| `success` | boolean | Whether the campaign content was successfully retrieved | | `output` | object | Campaign content data | ### `mailchimp_set_campaign_content` @@ -545,8 +541,8 @@ Retrieve a list of automations from Mailchimp | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Automations data and metadata | +| `success` | boolean | Whether the automations were successfully retrieved | +| `output` | object | Automations data | ### `mailchimp_get_automation` @@ -563,8 +559,8 @@ Retrieve details of a specific automation from Mailchimp | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Automation data and metadata | +| `success` | boolean | Whether the automation was successfully retrieved | +| `output` | object | Automation data | ### `mailchimp_start_automation` @@ -638,8 +634,8 @@ Retrieve a list of templates from Mailchimp | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Templates data and metadata | +| `success` | boolean | Whether the templates were successfully retrieved | +| `output` | object | Templates data | ### `mailchimp_get_template` @@ -656,8 +652,8 @@ Retrieve details of a specific template from Mailchimp | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Template data and metadata | +| `success` | boolean | Whether the template was successfully retrieved | +| `output` | object | Template data | ### `mailchimp_create_template` @@ -713,8 +709,7 @@ Delete a template from Mailchimp | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Deletion confirmation | +| `success` | boolean | Whether the template was successfully deleted | ### `mailchimp_get_campaign_reports` @@ -732,8 +727,8 @@ Retrieve a list of campaign reports from Mailchimp | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Campaign reports data and metadata | +| `success` | boolean | Whether the campaign reports were successfully retrieved | +| `output` | object | Campaign reports data | ### `mailchimp_get_campaign_report` @@ -750,8 +745,8 @@ Retrieve the report for a specific campaign from Mailchimp | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Campaign report data and metadata | +| `success` | boolean | Whether the campaign report was successfully retrieved | +| `output` | object | Campaign report data | ### `mailchimp_get_segments` @@ -770,8 +765,8 @@ Retrieve a list of segments from a Mailchimp audience | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Segments data and metadata | +| `success` | boolean | Whether the segments were successfully retrieved | +| `output` | object | Segments data | ### `mailchimp_get_segment` @@ -789,8 +784,8 @@ Retrieve details of a specific segment from a Mailchimp audience | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Segment data and metadata | +| `success` | boolean | Whether the segment was successfully retrieved | +| `output` | object | Segment data | ### `mailchimp_create_segment` @@ -849,8 +844,7 @@ Delete a segment from a Mailchimp audience | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Deletion confirmation | +| `success` | boolean | Whether the segment was successfully deleted | ### `mailchimp_get_segment_members` @@ -870,8 +864,8 @@ Retrieve members of a specific segment from a Mailchimp audience | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Segment members data and metadata | +| `success` | boolean | Whether the segment members were successfully retrieved | +| `output` | object | Segment members data | ### `mailchimp_add_segment_member` @@ -929,8 +923,8 @@ Retrieve tags associated with a member in a Mailchimp audience | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Member tags data and metadata | +| `success` | boolean | Whether the member tags were successfully retrieved | +| `output` | object | Member tags data | ### `mailchimp_add_member_tags` @@ -989,8 +983,8 @@ Retrieve a list of merge fields from a Mailchimp audience | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Merge fields data and metadata | +| `success` | boolean | Whether the merge fields were successfully retrieved | +| `output` | object | Merge fields data | ### `mailchimp_get_merge_field` @@ -1008,8 +1002,8 @@ Retrieve details of a specific merge field from a Mailchimp audience | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Merge field data and metadata | +| `success` | boolean | Whether the merge field was successfully retrieved | +| `output` | object | Merge field data | ### `mailchimp_create_merge_field` @@ -1067,8 +1061,7 @@ Delete a merge field from a Mailchimp audience | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Deletion confirmation | +| `success` | boolean | Whether the merge field was successfully deleted | ### `mailchimp_get_interest_categories` @@ -1087,8 +1080,8 @@ Retrieve a list of interest categories from a Mailchimp audience | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Interest categories data and metadata | +| `success` | boolean | Whether the interest categories were successfully retrieved | +| `output` | object | Interest categories data | ### `mailchimp_get_interest_category` @@ -1106,8 +1099,8 @@ Retrieve details of a specific interest category from a Mailchimp audience | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Interest category data and metadata | +| `success` | boolean | Whether the interest category was successfully retrieved | +| `output` | object | Interest category data | ### `mailchimp_create_interest_category` @@ -1165,8 +1158,7 @@ Delete an interest category from a Mailchimp audience | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Deletion confirmation | +| `success` | boolean | Whether the interest category was successfully deleted | ### `mailchimp_get_interests` @@ -1186,8 +1178,8 @@ Retrieve a list of interests from an interest category in a Mailchimp audience | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Interests data and metadata | +| `success` | boolean | Whether the interests were successfully retrieved | +| `output` | object | Interests data | ### `mailchimp_get_interest` @@ -1206,8 +1198,8 @@ Retrieve details of a specific interest from an interest category in a Mailchimp | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Interest data and metadata | +| `success` | boolean | Whether the interest was successfully retrieved | +| `output` | object | Interest data | ### `mailchimp_create_interest` @@ -1267,8 +1259,7 @@ Delete an interest from an interest category in a Mailchimp audience | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Deletion confirmation | +| `success` | boolean | Whether the interest was successfully deleted | ### `mailchimp_get_landing_pages` @@ -1286,8 +1277,8 @@ Retrieve a list of landing pages from Mailchimp | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Landing pages data and metadata | +| `success` | boolean | Whether the landing pages were successfully retrieved | +| `output` | object | Landing pages data | ### `mailchimp_get_landing_page` @@ -1304,8 +1295,8 @@ Retrieve details of a specific landing page from Mailchimp | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Landing page data and metadata | +| `success` | boolean | Whether the landing page was successfully retrieved | +| `output` | object | Landing page data | ### `mailchimp_create_landing_page` @@ -1360,8 +1351,7 @@ Delete a landing page from Mailchimp | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Deletion confirmation | +| `success` | boolean | Whether the landing page was successfully deleted | ### `mailchimp_publish_landing_page` @@ -1415,8 +1405,8 @@ Retrieve a list of batch operations from Mailchimp | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Batch operations data and metadata | +| `success` | boolean | Whether the batch operations were successfully retrieved | +| `output` | object | Batch operations data | ### `mailchimp_get_batch_operation` @@ -1433,8 +1423,8 @@ Retrieve details of a specific batch operation from Mailchimp | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Batch operation data and metadata | +| `success` | boolean | Whether the batch operation was successfully retrieved | +| `output` | object | Batch operation data | ### `mailchimp_create_batch_operation` @@ -1469,8 +1459,7 @@ Delete a batch operation from Mailchimp | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Operation success status | -| `output` | object | Deletion confirmation | +| `success` | boolean | Whether the batch operation was successfully deleted | diff --git a/apps/docs/content/docs/en/tools/meta.json b/apps/docs/content/docs/en/tools/meta.json index 8a2bca881a..63361506a5 100644 --- a/apps/docs/content/docs/en/tools/meta.json +++ b/apps/docs/content/docs/en/tools/meta.json @@ -12,7 +12,7 @@ "circleback", "clay", "confluence", - "cursor", + "cursor_v2", "datadog", "discord", "dropbox", @@ -24,10 +24,10 @@ "file", "firecrawl", "fireflies", - "github", + "github_v2", "gitlab", - "gmail", - "google_calendar", + "gmail_v2", + "google_calendar_v2", "google_docs", "google_drive", "google_forms", @@ -45,7 +45,7 @@ "image_generator", "imap", "incidentio", - "intercom", + "intercom_v2", "jina", "jira", "jira_service_management", @@ -65,7 +65,7 @@ "mongodb", "mysql", "neo4j", - "notion", + "notion_v2", "onedrive", "openai", "outlook", @@ -101,7 +101,6 @@ "supabase", "tavily", "telegram", - "thinking", "translate", "trello", "tts", diff --git a/apps/docs/content/docs/en/tools/notion.mdx b/apps/docs/content/docs/en/tools/notion.mdx deleted file mode 100644 index dd580a41da..0000000000 --- a/apps/docs/content/docs/en/tools/notion.mdx +++ /dev/null @@ -1,180 +0,0 @@ ---- -title: Notion -description: Manage Notion pages ---- - -import { BlockInfoCard } from "@/components/ui/block-info-card" - - - -{/* MANUAL-CONTENT-START:intro */} -[Notion](https://www.notion.so) is an all-in-one workspace that combines notes, documents, wikis, and project management tools into a single platform. It offers a flexible and customizable environment where users can create, organize, and collaborate on content in various formats. - -With Notion, you can: - -- **Create versatile content**: Build documents, wikis, databases, kanban boards, calendars, and more -- **Organize information**: Structure content hierarchically with nested pages and powerful databases -- **Collaborate seamlessly**: Share workspaces and pages with team members for real-time collaboration -- **Customize your workspace**: Design your ideal workflow with flexible templates and building blocks -- **Connect information**: Link between pages and databases to create a knowledge network -- **Access anywhere**: Use Notion across web, desktop, and mobile platforms with automatic syncing - -In Sim, the Notion integration enables your agents to interact directly with your Notion workspace programmatically. This allows for powerful automation scenarios such as knowledge management, content creation, and information retrieval. Your agents can: - -- **Read Notion pages**: Extract content and metadata from any Notion page. -- **Read Notion databases**: Retrieve database structure and information. -- **Write to pages**: Append new content to existing Notion pages. -- **Create new pages**: Generate new Notion pages under a parent page, with custom titles and content. -- **Query databases**: Search and filter database entries using advanced filter and sort criteria. -- **Search workspace**: Search across your entire Notion workspace for pages or databases matching specific queries. -- **Create new databases**: Programmatically create new databases with custom properties and structure. - -This integration bridges the gap between your AI workflows and your knowledge base, enabling seamless documentation and information management. By connecting Sim with Notion, you can automate documentation processes, maintain up-to-date information repositories, generate reports, and organize information intelligently—all through your intelligent agents. -{/* MANUAL-CONTENT-END */} - - -## Usage Instructions - -Integrate with Notion into the workflow. Can read page, read database, create page, create database, append content, query database, and search workspace. - - - -## Tools - -### `notion_read` - -Read content from a Notion page - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `pageId` | string | Yes | The ID of the Notion page to read | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Page content in markdown format with headers, paragraphs, lists, and todos | -| `metadata` | object | Page metadata including title, URL, and timestamps | - -### `notion_read_database` - -Read database information and structure from Notion - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `databaseId` | string | Yes | The ID of the Notion database to read | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Database information including title, properties schema, and metadata | -| `metadata` | object | Database metadata including title, ID, URL, timestamps, and properties schema | - -### `notion_write` - -Append content to a Notion page - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `pageId` | string | Yes | The ID of the Notion page to append content to | -| `content` | string | Yes | The content to append to the page | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Success message confirming content was appended to page | - -### `notion_create_page` - -Create a new page in Notion - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `parentId` | string | Yes | ID of the parent page | -| `title` | string | No | Title of the new page | -| `content` | string | No | Optional content to add to the page upon creation | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Success message confirming page creation | -| `metadata` | object | Page metadata including title, page ID, URL, and timestamps | - -### `notion_query_database` - -Query and filter Notion database entries with advanced filtering - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `databaseId` | string | Yes | The ID of the database to query | -| `filter` | string | No | Filter conditions as JSON \(optional\) | -| `sorts` | string | No | Sort criteria as JSON array \(optional\) | -| `pageSize` | number | No | Number of results to return \(default: 100, max: 100\) | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Formatted list of database entries with their properties | -| `metadata` | object | Query metadata including total results count, pagination info, and raw results array | - -### `notion_search` - -Search across all pages and databases in Notion workspace - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `query` | string | No | Search terms \(leave empty to get all pages\) | -| `filterType` | string | No | Filter by object type: page, database, or leave empty for all | -| `pageSize` | number | No | Number of results to return \(default: 100, max: 100\) | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Formatted list of search results including pages and databases | -| `metadata` | object | Search metadata including total results count, pagination info, and raw results array | - -### `notion_create_database` - -Create a new database in Notion with custom properties - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `parentId` | string | Yes | ID of the parent page where the database will be created | -| `title` | string | Yes | Title for the new database | -| `properties` | string | No | Database properties as JSON object \(optional, will create a default "Name" property if empty\) | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `content` | string | Success message with database details and properties list | -| `metadata` | object | Database metadata including ID, title, URL, creation time, and properties schema | - - - -## Notes - -- Category: `tools` -- Type: `notion` diff --git a/apps/docs/content/docs/en/tools/notion_v2.mdx b/apps/docs/content/docs/en/tools/notion_v2.mdx new file mode 100644 index 0000000000..adb212c2f4 --- /dev/null +++ b/apps/docs/content/docs/en/tools/notion_v2.mdx @@ -0,0 +1,194 @@ +--- +title: Notion +description: Manage Notion pages +--- + +import { BlockInfoCard } from "@/components/ui/block-info-card" + + + +## Usage Instructions + +Integrate with Notion into the workflow. Can read page, read database, create page, create database, append content, query database, and search workspace. + + + +## Tools + +### `notion_read_v2` + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `content` | string | Page content in markdown format | +| `title` | string | Page or database title | +| `url` | string | Notion URL | +| `id` | string | Page or database ID | +| `created_time` | string | Creation timestamp | +| `last_edited_time` | string | Last edit timestamp | +| `results` | array | Array of results from query or search | +| `has_more` | boolean | Whether more results are available | +| `next_cursor` | string | Cursor for pagination | +| `total_results` | number | Number of results returned | +| `properties` | json | Database properties schema | +| `appended` | boolean | Whether content was successfully appended | + +### `notion_read_database_v2` + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `content` | string | Page content in markdown format | +| `title` | string | Page or database title | +| `url` | string | Notion URL | +| `id` | string | Page or database ID | +| `created_time` | string | Creation timestamp | +| `last_edited_time` | string | Last edit timestamp | +| `results` | array | Array of results from query or search | +| `has_more` | boolean | Whether more results are available | +| `next_cursor` | string | Cursor for pagination | +| `total_results` | number | Number of results returned | +| `properties` | json | Database properties schema | +| `appended` | boolean | Whether content was successfully appended | + +### `notion_write_v2` + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `content` | string | Page content in markdown format | +| `title` | string | Page or database title | +| `url` | string | Notion URL | +| `id` | string | Page or database ID | +| `created_time` | string | Creation timestamp | +| `last_edited_time` | string | Last edit timestamp | +| `results` | array | Array of results from query or search | +| `has_more` | boolean | Whether more results are available | +| `next_cursor` | string | Cursor for pagination | +| `total_results` | number | Number of results returned | +| `properties` | json | Database properties schema | +| `appended` | boolean | Whether content was successfully appended | + +### `notion_create_page_v2` + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `content` | string | Page content in markdown format | +| `title` | string | Page or database title | +| `url` | string | Notion URL | +| `id` | string | Page or database ID | +| `created_time` | string | Creation timestamp | +| `last_edited_time` | string | Last edit timestamp | +| `results` | array | Array of results from query or search | +| `has_more` | boolean | Whether more results are available | +| `next_cursor` | string | Cursor for pagination | +| `total_results` | number | Number of results returned | +| `properties` | json | Database properties schema | +| `appended` | boolean | Whether content was successfully appended | + +### `notion_query_database_v2` + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `content` | string | Page content in markdown format | +| `title` | string | Page or database title | +| `url` | string | Notion URL | +| `id` | string | Page or database ID | +| `created_time` | string | Creation timestamp | +| `last_edited_time` | string | Last edit timestamp | +| `results` | array | Array of results from query or search | +| `has_more` | boolean | Whether more results are available | +| `next_cursor` | string | Cursor for pagination | +| `total_results` | number | Number of results returned | +| `properties` | json | Database properties schema | +| `appended` | boolean | Whether content was successfully appended | + +### `notion_search_v2` + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `content` | string | Page content in markdown format | +| `title` | string | Page or database title | +| `url` | string | Notion URL | +| `id` | string | Page or database ID | +| `created_time` | string | Creation timestamp | +| `last_edited_time` | string | Last edit timestamp | +| `results` | array | Array of results from query or search | +| `has_more` | boolean | Whether more results are available | +| `next_cursor` | string | Cursor for pagination | +| `total_results` | number | Number of results returned | +| `properties` | json | Database properties schema | +| `appended` | boolean | Whether content was successfully appended | + +### `notion_create_database_v2` + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `content` | string | Page content in markdown format | +| `title` | string | Page or database title | +| `url` | string | Notion URL | +| `id` | string | Page or database ID | +| `created_time` | string | Creation timestamp | +| `last_edited_time` | string | Last edit timestamp | +| `results` | array | Array of results from query or search | +| `has_more` | boolean | Whether more results are available | +| `next_cursor` | string | Cursor for pagination | +| `total_results` | number | Number of results returned | +| `properties` | json | Database properties schema | +| `appended` | boolean | Whether content was successfully appended | + + + +## Notes + +- Category: `tools` +- Type: `notion_v2` diff --git a/apps/docs/content/docs/en/tools/pipedrive.mdx b/apps/docs/content/docs/en/tools/pipedrive.mdx index 3f66973c8b..a0066ec3e9 100644 --- a/apps/docs/content/docs/en/tools/pipedrive.mdx +++ b/apps/docs/content/docs/en/tools/pipedrive.mdx @@ -55,7 +55,7 @@ Retrieve all deals from Pipedrive with optional filters | Parameter | Type | Description | | --------- | ---- | ----------- | | `deals` | array | Array of deal objects from Pipedrive | -| `metadata` | object | Operation metadata | +| `metadata` | object | Pagination metadata for the response | | `success` | boolean | Operation success status | ### `pipedrive_get_deal` @@ -73,7 +73,6 @@ Retrieve detailed information about a specific deal | Parameter | Type | Description | | --------- | ---- | ----------- | | `deal` | object | Deal object with full details | -| `metadata` | object | Operation metadata | | `success` | boolean | Operation success status | ### `pipedrive_create_deal` @@ -99,7 +98,6 @@ Create a new deal in Pipedrive | Parameter | Type | Description | | --------- | ---- | ----------- | | `deal` | object | The created deal object | -| `metadata` | object | Operation metadata | | `success` | boolean | Operation success status | ### `pipedrive_update_deal` @@ -122,7 +120,6 @@ Update an existing deal in Pipedrive | Parameter | Type | Description | | --------- | ---- | ----------- | | `deal` | object | The updated deal object | -| `metadata` | object | Operation metadata | | `success` | boolean | Operation success status | ### `pipedrive_get_files` @@ -143,7 +140,7 @@ Retrieve files from Pipedrive with optional filters | Parameter | Type | Description | | --------- | ---- | ----------- | | `files` | array | Array of file objects from Pipedrive | -| `metadata` | object | Operation metadata | +| `total_items` | number | Total number of files returned | | `success` | boolean | Operation success status | ### `pipedrive_get_mail_messages` @@ -162,7 +159,7 @@ Retrieve mail threads from Pipedrive mailbox | Parameter | Type | Description | | --------- | ---- | ----------- | | `messages` | array | Array of mail thread objects from Pipedrive mailbox | -| `metadata` | object | Operation metadata | +| `total_items` | number | Total number of mail threads returned | | `success` | boolean | Operation success status | ### `pipedrive_get_mail_thread` @@ -180,7 +177,7 @@ Retrieve all messages from a specific mail thread | Parameter | Type | Description | | --------- | ---- | ----------- | | `messages` | array | Array of mail message objects from the thread | -| `metadata` | object | Operation metadata including thread ID | +| `metadata` | object | Thread and pagination metadata | | `success` | boolean | Operation success status | ### `pipedrive_get_pipelines` @@ -201,7 +198,7 @@ Retrieve all pipelines from Pipedrive | Parameter | Type | Description | | --------- | ---- | ----------- | | `pipelines` | array | Array of pipeline objects from Pipedrive | -| `metadata` | object | Operation metadata | +| `total_items` | number | Total number of pipelines returned | | `success` | boolean | Operation success status | ### `pipedrive_get_pipeline_deals` @@ -222,7 +219,7 @@ Retrieve all deals in a specific pipeline | Parameter | Type | Description | | --------- | ---- | ----------- | | `deals` | array | Array of deal objects from the pipeline | -| `metadata` | object | Operation metadata including pipeline ID | +| `metadata` | object | Pipeline and pagination metadata | | `success` | boolean | Operation success status | ### `pipedrive_get_projects` @@ -243,7 +240,7 @@ Retrieve all projects or a specific project from Pipedrive | --------- | ---- | ----------- | | `projects` | array | Array of project objects \(when listing all\) | | `project` | object | Single project object \(when project_id is provided\) | -| `metadata` | object | Operation metadata | +| `total_items` | number | Total number of projects returned | | `success` | boolean | Operation success status | ### `pipedrive_create_project` @@ -264,7 +261,6 @@ Create a new project in Pipedrive | Parameter | Type | Description | | --------- | ---- | ----------- | | `project` | object | The created project object | -| `metadata` | object | Operation metadata | | `success` | boolean | Operation success status | ### `pipedrive_get_activities` @@ -287,7 +283,7 @@ Retrieve activities (tasks) from Pipedrive with optional filters | Parameter | Type | Description | | --------- | ---- | ----------- | | `activities` | array | Array of activity objects from Pipedrive | -| `metadata` | object | Operation metadata | +| `total_items` | number | Total number of activities returned | | `success` | boolean | Operation success status | ### `pipedrive_create_activity` @@ -313,7 +309,6 @@ Create a new activity (task) in Pipedrive | Parameter | Type | Description | | --------- | ---- | ----------- | | `activity` | object | The created activity object | -| `metadata` | object | Operation metadata | | `success` | boolean | Operation success status | ### `pipedrive_update_activity` @@ -337,7 +332,6 @@ Update an existing activity (task) in Pipedrive | Parameter | Type | Description | | --------- | ---- | ----------- | | `activity` | object | The updated activity object | -| `metadata` | object | Operation metadata | | `success` | boolean | Operation success status | ### `pipedrive_get_leads` @@ -361,7 +355,7 @@ Retrieve all leads or a specific lead from Pipedrive | --------- | ---- | ----------- | | `leads` | array | Array of lead objects \(when listing all\) | | `lead` | object | Single lead object \(when lead_id is provided\) | -| `metadata` | object | Operation metadata | +| `total_items` | number | Total number of leads returned | | `success` | boolean | Operation success status | ### `pipedrive_create_lead` @@ -386,7 +380,6 @@ Create a new lead in Pipedrive | Parameter | Type | Description | | --------- | ---- | ----------- | | `lead` | object | The created lead object | -| `metadata` | object | Operation metadata | | `success` | boolean | Operation success status | ### `pipedrive_update_lead` @@ -412,7 +405,6 @@ Update an existing lead in Pipedrive | Parameter | Type | Description | | --------- | ---- | ----------- | | `lead` | object | The updated lead object | -| `metadata` | object | Operation metadata | | `success` | boolean | Operation success status | ### `pipedrive_delete_lead` @@ -430,7 +422,6 @@ Delete a specific lead from Pipedrive | Parameter | Type | Description | | --------- | ---- | ----------- | | `data` | object | Deletion confirmation data | -| `metadata` | object | Operation metadata | | `success` | boolean | Operation success status | diff --git a/apps/docs/content/docs/en/tools/posthog.mdx b/apps/docs/content/docs/en/tools/posthog.mdx index c7acf1fdbe..86b0b7fbdc 100644 --- a/apps/docs/content/docs/en/tools/posthog.mdx +++ b/apps/docs/content/docs/en/tools/posthog.mdx @@ -77,7 +77,7 @@ Capture multiple events at once in PostHog. Use this for bulk event ingestion to | Parameter | Type | Description | | --------- | ---- | ----------- | | `status` | string | Status message indicating whether the batch was captured successfully | -| `eventsProcessed` | number | Number of events processed in the batch | +| `events_processed` | number | Number of events processed in the batch | ### `posthog_list_persons` @@ -600,9 +600,9 @@ Evaluate feature flags for a specific user or group. This is a public endpoint t | Parameter | Type | Description | | --------- | ---- | ----------- | -| `featureFlags` | object | Feature flag evaluations \(key-value pairs where values are boolean or string variants\) | -| `featureFlagPayloads` | object | Additional payloads attached to feature flags | -| `errorsWhileComputingFlags` | boolean | Whether there were errors while computing flags | +| `feature_flags` | object | Feature flag evaluations \(key-value pairs where values are boolean or string variants\) | +| `feature_flag_payloads` | object | Additional payloads attached to feature flags | +| `errors_while_computing_flags` | boolean | Whether there were errors while computing flags | ### `posthog_list_experiments` diff --git a/apps/docs/content/docs/en/tools/salesforce.mdx b/apps/docs/content/docs/en/tools/salesforce.mdx index 870c6161d2..0657cc22b8 100644 --- a/apps/docs/content/docs/en/tools/salesforce.mdx +++ b/apps/docs/content/docs/en/tools/salesforce.mdx @@ -259,7 +259,7 @@ Get lead(s) from Salesforce | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Success status | +| `success` | boolean | Operation success status | | `output` | object | Lead data | ### `salesforce_create_lead` @@ -286,8 +286,8 @@ Create a new lead | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Success | -| `output` | object | Created lead | +| `success` | boolean | Operation success status | +| `output` | object | Created lead data | ### `salesforce_update_lead` @@ -314,8 +314,8 @@ Update an existing lead | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Success | -| `output` | object | Updated lead | +| `success` | boolean | Operation success status | +| `output` | object | Updated lead data | ### `salesforce_delete_lead` @@ -333,8 +333,8 @@ Delete a lead | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Success | -| `output` | object | Deleted lead | +| `success` | boolean | Operation success status | +| `output` | object | Deleted lead data | ### `salesforce_get_opportunities` @@ -355,7 +355,7 @@ Get opportunity(ies) from Salesforce | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Success | +| `success` | boolean | Operation success status | | `output` | object | Opportunity data | ### `salesforce_create_opportunity` @@ -380,8 +380,8 @@ Create a new opportunity | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Success | -| `output` | object | Created opportunity | +| `success` | boolean | Operation success status | +| `output` | object | Created opportunity data | ### `salesforce_update_opportunity` @@ -406,8 +406,8 @@ Update an existing opportunity | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Success | -| `output` | object | Updated opportunity | +| `success` | boolean | Operation success status | +| `output` | object | Updated opportunity data | ### `salesforce_delete_opportunity` @@ -425,8 +425,8 @@ Delete an opportunity | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Success | -| `output` | object | Deleted opportunity | +| `success` | boolean | Operation success status | +| `output` | object | Deleted opportunity data | ### `salesforce_get_cases` @@ -447,7 +447,7 @@ Get case(s) from Salesforce | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Success | +| `success` | boolean | Operation success status | | `output` | object | Case data | ### `salesforce_create_case` @@ -472,8 +472,8 @@ Create a new case | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Success | -| `output` | object | Created case | +| `success` | boolean | Operation success status | +| `output` | object | Created case data | ### `salesforce_update_case` @@ -495,8 +495,8 @@ Update an existing case | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Success | -| `output` | object | Updated case | +| `success` | boolean | Operation success status | +| `output` | object | Updated case data | ### `salesforce_delete_case` @@ -514,8 +514,8 @@ Delete a case | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Success | -| `output` | object | Deleted case | +| `success` | boolean | Operation success status | +| `output` | object | Deleted case data | ### `salesforce_get_tasks` @@ -536,7 +536,7 @@ Get task(s) from Salesforce | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Success | +| `success` | boolean | Operation success status | | `output` | object | Task data | ### `salesforce_create_task` @@ -561,8 +561,8 @@ Create a new task | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Success | -| `output` | object | Created task | +| `success` | boolean | Operation success status | +| `output` | object | Created task data | ### `salesforce_update_task` @@ -585,8 +585,8 @@ Update an existing task | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Success | -| `output` | object | Updated task | +| `success` | boolean | Operation success status | +| `output` | object | Updated task data | ### `salesforce_delete_task` @@ -604,8 +604,8 @@ Delete a task | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Success | -| `output` | object | Deleted task | +| `success` | boolean | Operation success status | +| `output` | object | Deleted task data | ### `salesforce_list_reports` @@ -624,7 +624,7 @@ Get a list of reports accessible by the current user | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Success status | +| `success` | boolean | Operation success status | | `output` | object | Reports data | ### `salesforce_get_report` @@ -643,7 +643,7 @@ Get metadata and describe information for a specific report | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Success status | +| `success` | boolean | Operation success status | | `output` | object | Report metadata | ### `salesforce_run_report` @@ -664,7 +664,7 @@ Execute a report and retrieve the results | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Success status | +| `success` | boolean | Operation success status | | `output` | object | Report results | ### `salesforce_list_report_types` @@ -682,7 +682,7 @@ Get a list of available report types | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Success status | +| `success` | boolean | Operation success status | | `output` | object | Report types data | ### `salesforce_list_dashboards` @@ -701,7 +701,7 @@ Get a list of dashboards accessible by the current user | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Success status | +| `success` | boolean | Operation success status | | `output` | object | Dashboards data | ### `salesforce_get_dashboard` @@ -720,7 +720,7 @@ Get details and results for a specific dashboard | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Success status | +| `success` | boolean | Operation success status | | `output` | object | Dashboard data | ### `salesforce_refresh_dashboard` @@ -739,7 +739,7 @@ Refresh a dashboard to get the latest data | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Success status | +| `success` | boolean | Operation success status | | `output` | object | Refreshed dashboard data | ### `salesforce_query` @@ -758,7 +758,7 @@ Execute a custom SOQL query to retrieve data from Salesforce | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Success status | +| `success` | boolean | Operation success status | | `output` | object | Query results | ### `salesforce_query_more` @@ -777,7 +777,7 @@ Retrieve additional query results using the nextRecordsUrl from a previous query | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Success status | +| `success` | boolean | Operation success status | | `output` | object | Query results | ### `salesforce_describe_object` @@ -796,7 +796,7 @@ Get metadata and field information for a Salesforce object | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Success status | +| `success` | boolean | Operation success status | | `output` | object | Object metadata | ### `salesforce_list_objects` @@ -814,7 +814,7 @@ Get a list of all available Salesforce objects | Parameter | Type | Description | | --------- | ---- | ----------- | -| `success` | boolean | Success status | +| `success` | boolean | Operation success status | | `output` | object | Objects list | diff --git a/apps/docs/content/docs/en/tools/stripe.mdx b/apps/docs/content/docs/en/tools/stripe.mdx index 19c251647c..b842d3036f 100644 --- a/apps/docs/content/docs/en/tools/stripe.mdx +++ b/apps/docs/content/docs/en/tools/stripe.mdx @@ -282,7 +282,6 @@ Permanently delete a customer | --------- | ---- | ----------- | | `deleted` | boolean | Whether the customer was deleted | | `id` | string | The ID of the deleted customer | -| `metadata` | json | Deletion metadata | ### `stripe_list_customers` @@ -541,7 +540,6 @@ Permanently delete a draft invoice | --------- | ---- | ----------- | | `deleted` | boolean | Whether the invoice was deleted | | `id` | string | The ID of the deleted invoice | -| `metadata` | json | Deletion metadata | ### `stripe_finalize_invoice` @@ -856,7 +854,6 @@ Permanently delete a product | --------- | ---- | ----------- | | `deleted` | boolean | Whether the product was deleted | | `id` | string | The ID of the deleted product | -| `metadata` | json | Deletion metadata | ### `stripe_list_products` diff --git a/apps/docs/content/docs/en/tools/thinking.mdx b/apps/docs/content/docs/en/tools/thinking.mdx deleted file mode 100644 index 917f510327..0000000000 --- a/apps/docs/content/docs/en/tools/thinking.mdx +++ /dev/null @@ -1,56 +0,0 @@ ---- -title: Thinking -description: Forces model to outline its thought process. ---- - -import { BlockInfoCard } from "@/components/ui/block-info-card" - - - -{/* MANUAL-CONTENT-START:intro */} -The Thinking tool encourages AI models to engage in explicit reasoning before responding to complex queries. By providing a dedicated space for step-by-step analysis, this tool helps models break down problems, consider multiple perspectives, and arrive at more thoughtful conclusions. - -Research has shown that prompting language models to "think step by step" can significantly improve their reasoning capabilities. According to [Anthropic's research on Claude's Think tool](https://www.anthropic.com/engineering/claude-think-tool), when models are given space to work through their reasoning explicitly, they demonstrate: - -- **Improved problem-solving**: Breaking complex problems into manageable steps -- **Enhanced accuracy**: Reducing errors by carefully working through each component of a problem -- **Greater transparency**: Making the model's reasoning process visible and auditable -- **More nuanced responses**: Considering multiple angles before arriving at conclusions - -In Sim, the Thinking tool creates a structured opportunity for your agents to engage in this kind of deliberate reasoning. By incorporating thinking steps into your workflows, you can help your agents tackle complex tasks more effectively, avoid common reasoning pitfalls, and produce higher-quality outputs. This is particularly valuable for tasks involving multi-step reasoning, complex decision-making, or situations where accuracy is critical. -{/* MANUAL-CONTENT-END */} - - -## Usage Instructions - -Adds a step where the model explicitly outlines its thought process before proceeding. This can improve reasoning quality by encouraging step-by-step analysis. - - - -## Tools - -### `thinking_tool` - -Processes a provided thought/instruction, making it available for subsequent steps. - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `thought` | string | Yes | Your internal reasoning, analysis, or thought process. Use this to think through the problem step by step before responding. | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `acknowledgedThought` | string | The thought that was processed and acknowledged | - - - -## Notes - -- Category: `tools` -- Type: `thinking` diff --git a/apps/docs/content/docs/en/tools/zendesk.mdx b/apps/docs/content/docs/en/tools/zendesk.mdx index 3b826c0112..72f6febabd 100644 --- a/apps/docs/content/docs/en/tools/zendesk.mdx +++ b/apps/docs/content/docs/en/tools/zendesk.mdx @@ -78,7 +78,6 @@ Retrieve a list of tickets from Zendesk with optional filtering | --------- | ---- | ----------- | | `tickets` | array | Array of ticket objects | | `paging` | object | Pagination information | -| `metadata` | object | Operation metadata | ### `zendesk_get_ticket` @@ -98,7 +97,7 @@ Get a single ticket by ID from Zendesk | Parameter | Type | Description | | --------- | ---- | ----------- | | `ticket` | object | Ticket object | -| `metadata` | object | Operation metadata | +| `ticket_id` | number | The ticket ID | ### `zendesk_create_ticket` @@ -127,7 +126,7 @@ Create a new ticket in Zendesk with support for custom fields | Parameter | Type | Description | | --------- | ---- | ----------- | | `ticket` | object | Created ticket object | -| `metadata` | object | Operation metadata | +| `ticket_id` | number | The created ticket ID | ### `zendesk_create_tickets_bulk` @@ -146,8 +145,8 @@ Create multiple tickets in Zendesk at once (max 100) | Parameter | Type | Description | | --------- | ---- | ----------- | -| `jobStatus` | object | Job status object | -| `metadata` | object | Operation metadata | +| `job_status` | object | Job status object | +| `job_id` | string | The bulk operation job ID | ### `zendesk_update_ticket` @@ -176,7 +175,7 @@ Update an existing ticket in Zendesk with support for custom fields | Parameter | Type | Description | | --------- | ---- | ----------- | | `ticket` | object | Updated ticket object | -| `metadata` | object | Operation metadata | +| `ticket_id` | number | The updated ticket ID | ### `zendesk_update_tickets_bulk` @@ -200,8 +199,8 @@ Update multiple tickets in Zendesk at once (max 100) | Parameter | Type | Description | | --------- | ---- | ----------- | -| `jobStatus` | object | Job status object | -| `metadata` | object | Operation metadata | +| `job_status` | object | Job status object | +| `job_id` | string | The bulk operation job ID | ### `zendesk_delete_ticket` @@ -221,7 +220,7 @@ Delete a ticket from Zendesk | Parameter | Type | Description | | --------- | ---- | ----------- | | `deleted` | boolean | Deletion success | -| `metadata` | object | Operation metadata | +| `ticket_id` | string | The deleted ticket ID | ### `zendesk_merge_tickets` @@ -242,8 +241,9 @@ Merge multiple tickets into a target ticket | Parameter | Type | Description | | --------- | ---- | ----------- | -| `jobStatus` | object | Job status object | -| `metadata` | object | Operation metadata | +| `job_status` | object | Job status object | +| `job_id` | string | The merge job ID | +| `target_ticket_id` | string | The target ticket ID that tickets were merged into | ### `zendesk_get_users` @@ -267,7 +267,6 @@ Retrieve a list of users from Zendesk with optional filtering | --------- | ---- | ----------- | | `users` | array | Array of user objects | | `paging` | object | Pagination information | -| `metadata` | object | Operation metadata | ### `zendesk_get_user` @@ -287,7 +286,7 @@ Get a single user by ID from Zendesk | Parameter | Type | Description | | --------- | ---- | ----------- | | `user` | object | User object | -| `metadata` | object | Operation metadata | +| `user_id` | number | The user ID | ### `zendesk_get_current_user` @@ -306,7 +305,7 @@ Get the currently authenticated user from Zendesk | Parameter | Type | Description | | --------- | ---- | ----------- | | `user` | object | Current user object | -| `metadata` | object | Operation metadata | +| `user_id` | number | The current user ID | ### `zendesk_search_users` @@ -330,7 +329,6 @@ Search for users in Zendesk using a query string | --------- | ---- | ----------- | | `users` | array | Array of user objects | | `paging` | object | Pagination information | -| `metadata` | object | Operation metadata | ### `zendesk_create_user` @@ -357,7 +355,7 @@ Create a new user in Zendesk | Parameter | Type | Description | | --------- | ---- | ----------- | | `user` | object | Created user object | -| `metadata` | object | Operation metadata | +| `user_id` | number | The created user ID | ### `zendesk_create_users_bulk` @@ -376,8 +374,8 @@ Create multiple users in Zendesk using bulk import | Parameter | Type | Description | | --------- | ---- | ----------- | -| `jobStatus` | object | Job status object | -| `metadata` | object | Operation metadata | +| `job_status` | object | Job status object | +| `job_id` | string | The bulk operation job ID | ### `zendesk_update_user` @@ -404,8 +402,8 @@ Update an existing user in Zendesk | Parameter | Type | Description | | --------- | ---- | ----------- | -| `user` | object | Updated user object | -| `metadata` | object | Operation metadata | +| `user` | json | Updated user object | +| `user_id` | number | The updated user ID | ### `zendesk_update_users_bulk` @@ -424,8 +422,8 @@ Update multiple users in Zendesk using bulk update | Parameter | Type | Description | | --------- | ---- | ----------- | -| `jobStatus` | object | Job status object | -| `metadata` | object | Operation metadata | +| `job_status` | object | Job status object | +| `job_id` | string | The bulk operation job ID | ### `zendesk_delete_user` @@ -445,7 +443,7 @@ Delete a user from Zendesk | Parameter | Type | Description | | --------- | ---- | ----------- | | `deleted` | boolean | Deletion success | -| `metadata` | object | Operation metadata | +| `user_id` | string | The deleted user ID | ### `zendesk_get_organizations` @@ -467,7 +465,6 @@ Retrieve a list of organizations from Zendesk | --------- | ---- | ----------- | | `organizations` | array | Array of organization objects | | `paging` | object | Pagination information | -| `metadata` | object | Operation metadata | ### `zendesk_get_organization` @@ -486,8 +483,8 @@ Get a single organization by ID from Zendesk | Parameter | Type | Description | | --------- | ---- | ----------- | -| `organization` | object | Organization object | -| `metadata` | object | Operation metadata | +| `organization` | json | Organization object | +| `organization_id` | number | The organization ID | ### `zendesk_autocomplete_organizations` @@ -510,7 +507,6 @@ Autocomplete organizations in Zendesk by name prefix (for name matching/autocomp | --------- | ---- | ----------- | | `organizations` | array | Array of organization objects | | `paging` | object | Pagination information | -| `metadata` | object | Operation metadata | ### `zendesk_create_organization` @@ -534,8 +530,8 @@ Create a new organization in Zendesk | Parameter | Type | Description | | --------- | ---- | ----------- | -| `organization` | object | Created organization object | -| `metadata` | object | Operation metadata | +| `organization` | json | Created organization object | +| `organization_id` | number | The created organization ID | ### `zendesk_create_organizations_bulk` @@ -554,8 +550,8 @@ Create multiple organizations in Zendesk using bulk import | Parameter | Type | Description | | --------- | ---- | ----------- | -| `jobStatus` | object | Job status object | -| `metadata` | object | Operation metadata | +| `job_status` | object | Job status object | +| `job_id` | string | The bulk operation job ID | ### `zendesk_update_organization` @@ -580,8 +576,8 @@ Update an existing organization in Zendesk | Parameter | Type | Description | | --------- | ---- | ----------- | -| `organization` | object | Updated organization object | -| `metadata` | object | Operation metadata | +| `organization` | json | Updated organization object | +| `organization_id` | number | The updated organization ID | ### `zendesk_delete_organization` @@ -600,8 +596,8 @@ Delete an organization from Zendesk | Parameter | Type | Description | | --------- | ---- | ----------- | -| `deleted` | boolean | Deletion success | -| `metadata` | object | Operation metadata | +| `deleted` | boolean | Whether the organization was successfully deleted | +| `organization_id` | string | The deleted organization ID | ### `zendesk_search` @@ -626,7 +622,6 @@ Unified search across tickets, users, and organizations in Zendesk | --------- | ---- | ----------- | | `results` | array | Array of result objects | | `paging` | object | Pagination information | -| `metadata` | object | Operation metadata | ### `zendesk_search_count` @@ -646,7 +641,6 @@ Count the number of search results matching a query in Zendesk | Parameter | Type | Description | | --------- | ---- | ----------- | | `count` | number | Number of matching results | -| `metadata` | object | Operation metadata | diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tag-dropdown/tag-dropdown.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tag-dropdown/tag-dropdown.tsx index fd0c69277e..4d203d41bd 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tag-dropdown/tag-dropdown.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tag-dropdown/tag-dropdown.tsx @@ -240,7 +240,7 @@ const generateOutputPaths = (outputs: Record, prefix = ''): string[ } else if (typeof value === 'object' && value !== null) { if ('type' in value && typeof value.type === 'string') { const hasNestedProperties = - (value.type === 'object' && value.properties) || + ((value.type === 'object' || value.type === 'json') && value.properties) || (value.type === 'array' && value.items?.properties) || (value.type === 'array' && value.items && @@ -251,7 +251,7 @@ const generateOutputPaths = (outputs: Record, prefix = ''): string[ paths.push(currentPath) } - if (value.type === 'object' && value.properties) { + if ((value.type === 'object' || value.type === 'json') && value.properties) { paths.push(...generateOutputPaths(value.properties, currentPath)) } else if (value.type === 'array' && value.items?.properties) { paths.push(...generateOutputPaths(value.items.properties, currentPath)) diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/tool-input.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/tool-input.tsx index 46228def69..0413e694af 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/tool-input.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/tool-input/tool-input.tsx @@ -1016,6 +1016,7 @@ export function ToolInput({ const toolBlocks = useMemo(() => { const allToolBlocks = getAllBlocks().filter( (block) => + !block.hideFromToolbar && (block.category === 'tools' || block.type === 'api' || block.type === 'webhook_request' || diff --git a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/search-modal/search-modal.tsx b/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/search-modal/search-modal.tsx index ee43fefbf9..0d8fd312cc 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/search-modal/search-modal.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/search-modal/search-modal.tsx @@ -182,7 +182,7 @@ export function SearchModal({ const allBlocks = getAllBlocks() const filteredAllBlocks = filterBlocks(allBlocks) return filteredAllBlocks - .filter((block) => block.category === 'tools') + .filter((block) => !block.hideFromToolbar && block.category === 'tools') .map( (block): ToolItem => ({ id: block.type, @@ -225,7 +225,7 @@ export function SearchModal({ const docsItems: DocItem[] = [] allBlocks.forEach((block) => { - if (block.docsLink) { + if (block.docsLink && !block.hideFromToolbar) { docsItems.push({ id: `docs-${block.type}`, name: block.name, diff --git a/apps/sim/blocks/blocks/cursor.ts b/apps/sim/blocks/blocks/cursor.ts index a57856b1a9..3953549cd0 100644 --- a/apps/sim/blocks/blocks/cursor.ts +++ b/apps/sim/blocks/blocks/cursor.ts @@ -1,11 +1,12 @@ import { CursorIcon } from '@/components/icons' import type { BlockConfig } from '@/blocks/types' import { AuthMode } from '@/blocks/types' +import { createVersionedToolSelector } from '@/blocks/utils' import type { CursorResponse } from '@/tools/cursor/types' export const CursorBlock: BlockConfig = { type: 'cursor', - name: 'Cursor', + name: 'Cursor (Legacy)', description: 'Launch and manage Cursor cloud agents to work on GitHub repositories', longDescription: 'Interact with Cursor Cloud Agents API to launch AI agents that can work on your GitHub repositories. Supports launching agents, adding follow-up instructions, checking status, viewing conversations, and managing agent lifecycle.', @@ -14,6 +15,7 @@ export const CursorBlock: BlockConfig = { bgColor: '#1E1E1E', icon: CursorIcon, authMode: AuthMode.ApiKey, + hideFromToolbar: true, subBlocks: [ { id: 'operation', @@ -169,3 +171,42 @@ export const CursorBlock: BlockConfig = { metadata: { type: 'json', description: 'Response metadata' }, }, } + +export const CursorV2Block: BlockConfig = { + ...CursorBlock, + type: 'cursor_v2', + name: 'Cursor', + hideFromToolbar: false, + tools: { + ...CursorBlock.tools, + access: [ + 'cursor_list_agents_v2', + 'cursor_get_agent_v2', + 'cursor_get_conversation_v2', + 'cursor_launch_agent_v2', + 'cursor_add_followup_v2', + 'cursor_stop_agent_v2', + 'cursor_delete_agent_v2', + ], + config: { + tool: createVersionedToolSelector({ + baseToolSelector: (params) => params.operation || 'cursor_launch_agent', + suffix: '_v2', + fallbackToolId: 'cursor_launch_agent_v2', + }), + }, + }, + outputs: { + id: { type: 'string', description: 'Agent identifier' }, + url: { type: 'string', description: 'Agent URL (launch operation)' }, + name: { type: 'string', description: 'Agent name' }, + status: { type: 'string', description: 'Agent status' }, + source: { type: 'json', description: 'Agent source repository info' }, + target: { type: 'json', description: 'Agent target branch/PR info' }, + summary: { type: 'string', description: 'Agent summary' }, + createdAt: { type: 'string', description: 'Agent creation timestamp' }, + agents: { type: 'json', description: 'Array of agent objects (list operation)' }, + nextCursor: { type: 'string', description: 'Pagination cursor (list operation)' }, + messages: { type: 'json', description: 'Conversation messages (get conversation operation)' }, + }, +} diff --git a/apps/sim/blocks/blocks/github.ts b/apps/sim/blocks/blocks/github.ts index c0c44b4f38..524897a9db 100644 --- a/apps/sim/blocks/blocks/github.ts +++ b/apps/sim/blocks/blocks/github.ts @@ -6,7 +6,7 @@ import { getTrigger } from '@/triggers' export const GitHubBlock: BlockConfig = { type: 'github', - name: 'GitHub', + name: 'GitHub (Legacy)', description: 'Interact with GitHub or trigger workflows from GitHub events', authMode: AuthMode.ApiKey, longDescription: @@ -16,6 +16,7 @@ export const GitHubBlock: BlockConfig = { bgColor: '#181C1E', icon: GithubIcon, triggerAllowed: true, + hideFromToolbar: true, subBlocks: [ { id: 'operation', @@ -1335,3 +1336,44 @@ export const GitHubBlock: BlockConfig = { ], }, } + +export const GitHubV2Block: BlockConfig = { + ...GitHubBlock, + type: 'github_v2', + name: 'GitHub', + hideFromToolbar: false, + tools: { + ...GitHubBlock.tools, + access: (GitHubBlock.tools?.access || []).map((toolId) => `${toolId}_v2`), + config: { + ...GitHubBlock.tools?.config, + tool: (params) => { + const baseToolId = (GitHubBlock.tools?.config as any)?.tool(params) + return `${baseToolId}_v2` + }, + params: (GitHubBlock.tools?.config as any)?.params, + }, + }, + outputs: { + data: { type: 'json', description: 'Operation result data (API-aligned)' }, + + // Trigger outputs (unchanged) + action: { type: 'string', description: 'The action that was performed' }, + event_type: { type: 'string', description: 'Type of GitHub event' }, + repository: { type: 'string', description: 'Repository full name' }, + repository_name: { type: 'string', description: 'Repository name only' }, + repository_owner: { type: 'string', description: 'Repository owner username' }, + sender: { type: 'string', description: 'Username of the user who triggered the event' }, + sender_id: { type: 'string', description: 'User ID of the sender' }, + ref: { type: 'string', description: 'Git reference (for push events)' }, + before: { type: 'string', description: 'SHA of the commit before the push' }, + after: { type: 'string', description: 'SHA of the commit after the push' }, + commits: { type: 'string', description: 'Array of commit objects (for push events)' }, + pull_request: { type: 'string', description: 'Pull request object (for pull_request events)' }, + issue: { type: 'string', description: 'Issue object (for issues events)' }, + comment: { type: 'string', description: 'Comment object (for comment events)' }, + branch: { type: 'string', description: 'Branch name extracted from ref' }, + commit_message: { type: 'string', description: 'Latest commit message' }, + commit_author: { type: 'string', description: 'Author of the latest commit' }, + }, +} diff --git a/apps/sim/blocks/blocks/gmail.ts b/apps/sim/blocks/blocks/gmail.ts index a8b3453647..f5543b8351 100644 --- a/apps/sim/blocks/blocks/gmail.ts +++ b/apps/sim/blocks/blocks/gmail.ts @@ -1,12 +1,44 @@ import { GmailIcon } from '@/components/icons' import type { BlockConfig } from '@/blocks/types' import { AuthMode } from '@/blocks/types' +import { createVersionedToolSelector } from '@/blocks/utils' import type { GmailToolResponse } from '@/tools/gmail/types' import { getTrigger } from '@/triggers' +function selectGmailToolId(params: Record): string { + switch (params.operation) { + case 'send_gmail': + return 'gmail_send' + case 'draft_gmail': + return 'gmail_draft' + case 'search_gmail': + return 'gmail_search' + case 'read_gmail': + return 'gmail_read' + case 'move_gmail': + return 'gmail_move' + case 'mark_read_gmail': + return 'gmail_mark_read' + case 'mark_unread_gmail': + return 'gmail_mark_unread' + case 'archive_gmail': + return 'gmail_archive' + case 'unarchive_gmail': + return 'gmail_unarchive' + case 'delete_gmail': + return 'gmail_delete' + case 'add_label_gmail': + return 'gmail_add_label' + case 'remove_label_gmail': + return 'gmail_remove_label' + default: + throw new Error(`Invalid Gmail operation: ${params.operation}`) + } +} + export const GmailBlock: BlockConfig = { type: 'gmail', - name: 'Gmail', + name: 'Gmail (Legacy)', description: 'Send, read, search, and move Gmail messages or trigger workflows from Gmail events', authMode: AuthMode.OAuth, longDescription: @@ -15,6 +47,7 @@ export const GmailBlock: BlockConfig = { category: 'tools', bgColor: '#E0E0E0', icon: GmailIcon, + hideFromToolbar: true, triggerAllowed: true, subBlocks: [ // Operation selector @@ -376,36 +409,7 @@ Return ONLY the search query - no explanations, no extra text.`, 'gmail_remove_label', ], config: { - tool: (params) => { - switch (params.operation) { - case 'send_gmail': - return 'gmail_send' - case 'draft_gmail': - return 'gmail_draft' - case 'search_gmail': - return 'gmail_search' - case 'read_gmail': - return 'gmail_read' - case 'move_gmail': - return 'gmail_move' - case 'mark_read_gmail': - return 'gmail_mark_read' - case 'mark_unread_gmail': - return 'gmail_mark_unread' - case 'archive_gmail': - return 'gmail_archive' - case 'unarchive_gmail': - return 'gmail_unarchive' - case 'delete_gmail': - return 'gmail_delete' - case 'add_label_gmail': - return 'gmail_add_label' - case 'remove_label_gmail': - return 'gmail_remove_label' - default: - throw new Error(`Invalid Gmail operation: ${params.operation}`) - } - }, + tool: selectGmailToolId, params: (params) => { const { credential, @@ -539,3 +543,59 @@ Return ONLY the search query - no explanations, no extra text.`, available: ['gmail_poller'], }, } + +export const GmailV2Block: BlockConfig = { + ...GmailBlock, + type: 'gmail_v2', + name: 'Gmail', + hideFromToolbar: false, + tools: { + ...GmailBlock.tools, + access: [ + 'gmail_send_v2', + 'gmail_draft_v2', + 'gmail_read_v2', + 'gmail_search_v2', + 'gmail_move_v2', + 'gmail_mark_read_v2', + 'gmail_mark_unread_v2', + 'gmail_archive_v2', + 'gmail_unarchive_v2', + 'gmail_delete_v2', + 'gmail_add_label_v2', + 'gmail_remove_label_v2', + ], + config: { + ...GmailBlock.tools?.config, + tool: createVersionedToolSelector({ + baseToolSelector: selectGmailToolId, + suffix: '_v2', + fallbackToolId: 'gmail_send_v2', + }), + }, + }, + outputs: { + // V2 tool outputs (API-aligned) + id: { type: 'string', description: 'Gmail message ID' }, + threadId: { type: 'string', description: 'Gmail thread ID' }, + labelIds: { type: 'array', description: 'Email label IDs' }, + from: { type: 'string', description: 'Sender' }, + to: { type: 'string', description: 'To' }, + subject: { type: 'string', description: 'Subject' }, + date: { type: 'string', description: 'Date' }, + body: { type: 'string', description: 'Email body text (best-effort)' }, + results: { type: 'json', description: 'Search/read summary results' }, + attachments: { type: 'json', description: 'Downloaded attachments (if enabled)' }, + + // Trigger outputs (unchanged) + email_id: { type: 'string', description: 'Gmail message ID' }, + thread_id: { type: 'string', description: 'Gmail thread ID' }, + cc: { type: 'string', description: 'CC recipients (comma-separated)' }, + body_text: { type: 'string', description: 'Plain text email body' }, + body_html: { type: 'string', description: 'HTML email body' }, + labels: { type: 'string', description: 'Email labels (comma-separated)' }, + has_attachments: { type: 'boolean', description: 'Whether email has attachments' }, + raw_email: { type: 'json', description: 'Complete raw email data from Gmail API (if enabled)' }, + timestamp: { type: 'string', description: 'Event timestamp' }, + }, +} diff --git a/apps/sim/blocks/blocks/google_calendar.ts b/apps/sim/blocks/blocks/google_calendar.ts index 9d919f6b91..d5458a5047 100644 --- a/apps/sim/blocks/blocks/google_calendar.ts +++ b/apps/sim/blocks/blocks/google_calendar.ts @@ -5,7 +5,7 @@ import type { GoogleCalendarResponse } from '@/tools/google_calendar/types' export const GoogleCalendarBlock: BlockConfig = { type: 'google_calendar', - name: 'Google Calendar', + name: 'Google Calendar (Legacy)', description: 'Manage Google Calendar events', authMode: AuthMode.OAuth, longDescription: @@ -14,6 +14,7 @@ export const GoogleCalendarBlock: BlockConfig = { category: 'tools', bgColor: '#E0E0E0', icon: GoogleCalendarIcon, + hideFromToolbar: true, subBlocks: [ { id: 'operation', @@ -385,3 +386,54 @@ Return ONLY the natural language event text - no explanations.`, metadata: { type: 'json', description: 'Event metadata' }, }, } + +export const GoogleCalendarV2Block: BlockConfig = { + ...GoogleCalendarBlock, + type: 'google_calendar_v2', + name: 'Google Calendar', + hideFromToolbar: false, + tools: { + ...GoogleCalendarBlock.tools, + access: [ + 'google_calendar_create_v2', + 'google_calendar_list_v2', + 'google_calendar_get_v2', + 'google_calendar_quick_add_v2', + 'google_calendar_invite_v2', + ], + config: { + ...GoogleCalendarBlock.tools?.config, + tool: (params) => { + const operation = params.operation || 'create' + if ( + operation !== 'create' && + operation !== 'list' && + operation !== 'get' && + operation !== 'quick_add' && + operation !== 'invite' + ) { + throw new Error(`Invalid Google Calendar operation: ${operation}`) + } + return `google_calendar_${operation}_v2` + }, + params: GoogleCalendarBlock.tools?.config?.params, + }, + }, + outputs: { + id: { type: 'string', description: 'Event ID' }, + htmlLink: { type: 'string', description: 'Event link' }, + status: { type: 'string', description: 'Event status' }, + summary: { type: 'string', description: 'Event title' }, + description: { type: 'string', description: 'Event description' }, + location: { type: 'string', description: 'Event location' }, + start: { type: 'json', description: 'Event start' }, + end: { type: 'json', description: 'Event end' }, + attendees: { type: 'json', description: 'Event attendees' }, + creator: { type: 'json', description: 'Event creator' }, + organizer: { type: 'json', description: 'Event organizer' }, + events: { type: 'json', description: 'List of events (list operation)' }, + nextPageToken: { type: 'string', description: 'Next page token' }, + nextSyncToken: { type: 'string', description: 'Next sync token' }, + timeZone: { type: 'string', description: 'Calendar time zone' }, + }, +} diff --git a/apps/sim/blocks/blocks/intercom.ts b/apps/sim/blocks/blocks/intercom.ts index 1f9ad316d7..efbc8e876a 100644 --- a/apps/sim/blocks/blocks/intercom.ts +++ b/apps/sim/blocks/blocks/intercom.ts @@ -1,10 +1,12 @@ import { IntercomIcon } from '@/components/icons' import type { BlockConfig } from '@/blocks/types' import { AuthMode } from '@/blocks/types' +import { createVersionedToolSelector } from '@/blocks/utils' export const IntercomBlock: BlockConfig = { type: 'intercom', - name: 'Intercom', + name: 'Intercom (Legacy)', + hideFromToolbar: true, description: 'Manage contacts, companies, conversations, tickets, and messages in Intercom', longDescription: 'Integrate Intercom into the workflow. Can create, get, update, list, search, and delete contacts; create, get, and list companies; get, list, reply, and search conversations; create and get tickets; and create messages.', @@ -937,3 +939,108 @@ Return ONLY the numeric timestamp - no explanations, no quotes, no extra text.`, output: { type: 'json', description: 'Operation result data' }, }, } + +export const IntercomV2Block: BlockConfig = { + ...IntercomBlock, + type: 'intercom_v2', + name: 'Intercom', + hideFromToolbar: false, + tools: { + ...IntercomBlock.tools, + access: [ + 'intercom_create_contact_v2', + 'intercom_get_contact_v2', + 'intercom_update_contact_v2', + 'intercom_list_contacts_v2', + 'intercom_search_contacts_v2', + 'intercom_delete_contact_v2', + 'intercom_create_company_v2', + 'intercom_get_company_v2', + 'intercom_list_companies_v2', + 'intercom_get_conversation_v2', + 'intercom_list_conversations_v2', + 'intercom_reply_conversation_v2', + 'intercom_search_conversations_v2', + 'intercom_create_ticket_v2', + 'intercom_get_ticket_v2', + 'intercom_create_message_v2', + ], + config: { + tool: createVersionedToolSelector({ + baseToolSelector: (params) => { + switch (params.operation) { + case 'create_contact': + return 'intercom_create_contact' + case 'get_contact': + return 'intercom_get_contact' + case 'update_contact': + return 'intercom_update_contact' + case 'list_contacts': + return 'intercom_list_contacts' + case 'search_contacts': + return 'intercom_search_contacts' + case 'delete_contact': + return 'intercom_delete_contact' + case 'create_company': + return 'intercom_create_company' + case 'get_company': + return 'intercom_get_company' + case 'list_companies': + return 'intercom_list_companies' + case 'get_conversation': + return 'intercom_get_conversation' + case 'list_conversations': + return 'intercom_list_conversations' + case 'reply_conversation': + return 'intercom_reply_conversation' + case 'search_conversations': + return 'intercom_search_conversations' + case 'create_ticket': + return 'intercom_create_ticket' + case 'get_ticket': + return 'intercom_get_ticket' + case 'create_message': + return 'intercom_create_message' + default: + return 'intercom_create_contact' + } + }, + suffix: '_v2', + fallbackToolId: 'intercom_create_contact_v2', + }), + params: IntercomBlock.tools!.config!.params, + }, + }, + outputs: { + contact: { + type: 'json', + description: + 'Contact object with id, type, role, email, phone, name, external_id, created_at, updated_at', + }, + contactId: { type: 'string', description: 'ID of the contact (for create/update operations)' }, + contacts: { type: 'array', description: 'Array of contacts (for list/search operations)' }, + company: { type: 'json', description: 'Company object with id, company_id, name, website' }, + companyId: { type: 'string', description: 'ID of the company (for create operations)' }, + companies: { type: 'array', description: 'Array of companies (for list operations)' }, + conversation: { type: 'json', description: 'Conversation object with id, title, state, open' }, + conversationId: { + type: 'string', + description: 'ID of the conversation (for reply operations)', + }, + conversations: { + type: 'array', + description: 'Array of conversations (for list/search operations)', + }, + ticket: { type: 'json', description: 'Ticket object with id, ticket_id, ticket_state' }, + ticketId: { type: 'string', description: 'ID of the ticket (for create operations)' }, + message: { type: 'json', description: 'Message object with id, type' }, + messageId: { type: 'string', description: 'ID of the message (for create operations)' }, + total_count: { type: 'number', description: 'Total count (for list/search operations)' }, + pages: { type: 'json', description: 'Pagination info with page, per_page, total_pages' }, + id: { type: 'string', description: 'ID of the deleted item (for delete operations)' }, + deleted: { + type: 'boolean', + description: 'Whether the item was deleted (for delete operations)', + }, + }, +} diff --git a/apps/sim/blocks/blocks/notion.ts b/apps/sim/blocks/blocks/notion.ts index 29e493b037..04fc56fc8e 100644 --- a/apps/sim/blocks/blocks/notion.ts +++ b/apps/sim/blocks/blocks/notion.ts @@ -3,9 +3,11 @@ import type { BlockConfig } from '@/blocks/types' import { AuthMode } from '@/blocks/types' import type { NotionResponse } from '@/tools/notion/types' +// Legacy block - hidden from toolbar export const NotionBlock: BlockConfig = { type: 'notion', - name: 'Notion', + name: 'Notion (Legacy)', + hideFromToolbar: true, description: 'Manage Notion pages', authMode: AuthMode.OAuth, longDescription: @@ -357,3 +359,124 @@ export const NotionBlock: BlockConfig = { }, }, } + +// V2 Block with API-aligned outputs +export const NotionV2Block: BlockConfig = { + type: 'notion_v2', + name: 'Notion', + description: 'Manage Notion pages', + authMode: AuthMode.OAuth, + longDescription: + 'Integrate with Notion into the workflow. Can read page, read database, create page, create database, append content, query database, and search workspace.', + docsLink: 'https://docs.sim.ai/tools/notion', + category: 'tools', + bgColor: '#181C1E', + icon: NotionIcon, + hideFromToolbar: false, + subBlocks: NotionBlock.subBlocks, + tools: { + access: [ + 'notion_read_v2', + 'notion_read_database_v2', + 'notion_write_v2', + 'notion_create_page_v2', + 'notion_query_database_v2', + 'notion_search_v2', + 'notion_create_database_v2', + ], + config: { + tool: (params) => { + switch (params.operation) { + case 'notion_read': + return 'notion_read_v2' + case 'notion_read_database': + return 'notion_read_database_v2' + case 'notion_write': + return 'notion_write_v2' + case 'notion_create_page': + return 'notion_create_page_v2' + case 'notion_query_database': + return 'notion_query_database_v2' + case 'notion_search': + return 'notion_search_v2' + case 'notion_create_database': + return 'notion_create_database_v2' + default: + return 'notion_read_v2' + } + }, + params: NotionBlock.tools?.config?.params, + }, + }, + inputs: NotionBlock.inputs, + outputs: { + // Read page outputs + content: { + type: 'string', + description: 'Page content in markdown format', + condition: { field: 'operation', value: 'notion_read' }, + }, + title: { + type: 'string', + description: 'Page or database title', + }, + url: { + type: 'string', + description: 'Notion URL', + }, + id: { + type: 'string', + description: 'Page or database ID', + condition: { + field: 'operation', + value: [ + 'notion_create_page', + 'notion_create_database', + 'notion_read_database', + 'notion_update_page', + ], + }, + }, + created_time: { + type: 'string', + description: 'Creation timestamp', + }, + last_edited_time: { + type: 'string', + description: 'Last edit timestamp', + }, + // Database query/search outputs + results: { + type: 'array', + description: 'Array of results from query or search', + condition: { field: 'operation', value: ['notion_query_database', 'notion_search'] }, + }, + has_more: { + type: 'boolean', + description: 'Whether more results are available', + condition: { field: 'operation', value: ['notion_query_database', 'notion_search'] }, + }, + next_cursor: { + type: 'string', + description: 'Cursor for pagination', + condition: { field: 'operation', value: ['notion_query_database', 'notion_search'] }, + }, + total_results: { + type: 'number', + description: 'Number of results returned', + condition: { field: 'operation', value: ['notion_query_database', 'notion_search'] }, + }, + // Database schema + properties: { + type: 'json', + description: 'Database properties schema', + condition: { field: 'operation', value: ['notion_read_database', 'notion_create_database'] }, + }, + // Write output + appended: { + type: 'boolean', + description: 'Whether content was successfully appended', + condition: { field: 'operation', value: 'notion_write' }, + }, + }, +} diff --git a/apps/sim/blocks/blocks/wealthbox.ts b/apps/sim/blocks/blocks/wealthbox.ts index 3346c6ede2..7a1eacd3df 100644 --- a/apps/sim/blocks/blocks/wealthbox.ts +++ b/apps/sim/blocks/blocks/wealthbox.ts @@ -250,7 +250,7 @@ Return ONLY the date/time string - no explanations, no quotes, no extra text.`, tasks: { type: 'json', description: 'Array of task objects from bulk read operations' }, metadata: { type: 'json', - description: 'Operation metadata including item IDs, types, and operation details', + description: 'Operation metadata with itemId, noteId, contactId, taskId, itemType', }, success: { type: 'boolean', diff --git a/apps/sim/blocks/registry.ts b/apps/sim/blocks/registry.ts index 8a4d75121f..e3ad607250 100644 --- a/apps/sim/blocks/registry.ts +++ b/apps/sim/blocks/registry.ts @@ -15,7 +15,7 @@ import { CirclebackBlock } from '@/blocks/blocks/circleback' import { ClayBlock } from '@/blocks/blocks/clay' import { ConditionBlock } from '@/blocks/blocks/condition' import { ConfluenceBlock } from '@/blocks/blocks/confluence' -import { CursorBlock } from '@/blocks/blocks/cursor' +import { CursorBlock, CursorV2Block } from '@/blocks/blocks/cursor' import { DatadogBlock } from '@/blocks/blocks/datadog' import { DiscordBlock } from '@/blocks/blocks/discord' import { DropboxBlock } from '@/blocks/blocks/dropbox' @@ -30,11 +30,11 @@ import { FirecrawlBlock } from '@/blocks/blocks/firecrawl' import { FirefliesBlock } from '@/blocks/blocks/fireflies' import { FunctionBlock } from '@/blocks/blocks/function' import { GenericWebhookBlock } from '@/blocks/blocks/generic_webhook' -import { GitHubBlock } from '@/blocks/blocks/github' +import { GitHubBlock, GitHubV2Block } from '@/blocks/blocks/github' import { GitLabBlock } from '@/blocks/blocks/gitlab' -import { GmailBlock } from '@/blocks/blocks/gmail' +import { GmailBlock, GmailV2Block } from '@/blocks/blocks/gmail' import { GoogleSearchBlock } from '@/blocks/blocks/google' -import { GoogleCalendarBlock } from '@/blocks/blocks/google_calendar' +import { GoogleCalendarBlock, GoogleCalendarV2Block } from '@/blocks/blocks/google_calendar' import { GoogleDocsBlock } from '@/blocks/blocks/google_docs' import { GoogleDriveBlock } from '@/blocks/blocks/google_drive' import { GoogleFormsBlock } from '@/blocks/blocks/google_form' @@ -54,7 +54,7 @@ import { ImageGeneratorBlock } from '@/blocks/blocks/image_generator' import { ImapBlock } from '@/blocks/blocks/imap' import { IncidentioBlock } from '@/blocks/blocks/incidentio' import { InputTriggerBlock } from '@/blocks/blocks/input_trigger' -import { IntercomBlock } from '@/blocks/blocks/intercom' +import { IntercomBlock, IntercomV2Block } from '@/blocks/blocks/intercom' import { JinaBlock } from '@/blocks/blocks/jina' import { JiraBlock } from '@/blocks/blocks/jira' import { JiraServiceManagementBlock } from '@/blocks/blocks/jira_service_management' @@ -77,7 +77,7 @@ import { MongoDBBlock } from '@/blocks/blocks/mongodb' import { MySQLBlock } from '@/blocks/blocks/mysql' import { Neo4jBlock } from '@/blocks/blocks/neo4j' import { NoteBlock } from '@/blocks/blocks/note' -import { NotionBlock } from '@/blocks/blocks/notion' +import { NotionBlock, NotionV2Block } from '@/blocks/blocks/notion' import { OneDriveBlock } from '@/blocks/blocks/onedrive' import { OpenAIBlock } from '@/blocks/blocks/openai' import { OutlookBlock } from '@/blocks/blocks/outlook' @@ -165,6 +165,7 @@ export const registry: Record = { condition: ConditionBlock, confluence: ConfluenceBlock, cursor: CursorBlock, + cursor_v2: CursorV2Block, datadog: DatadogBlock, discord: DiscordBlock, dropbox: DropboxBlock, @@ -179,13 +180,16 @@ export const registry: Record = { function: FunctionBlock, generic_webhook: GenericWebhookBlock, github: GitHubBlock, + github_v2: GitHubV2Block, gitlab: GitLabBlock, gmail: GmailBlock, + gmail_v2: GmailV2Block, grain: GrainBlock, grafana: GrafanaBlock, greptile: GreptileBlock, guardrails: GuardrailsBlock, google_calendar: GoogleCalendarBlock, + google_calendar_v2: GoogleCalendarV2Block, google_docs: GoogleDocsBlock, google_drive: GoogleDriveBlock, google_forms: GoogleFormsBlock, @@ -203,6 +207,7 @@ export const registry: Record = { incidentio: IncidentioBlock, input_trigger: InputTriggerBlock, intercom: IntercomBlock, + intercom_v2: IntercomV2Block, jina: JinaBlock, jira: JiraBlock, jira_service_management: JiraServiceManagementBlock, @@ -226,6 +231,7 @@ export const registry: Record = { neo4j: Neo4jBlock, note: NoteBlock, notion: NotionBlock, + notion_v2: NotionV2Block, onedrive: OneDriveBlock, openai: OpenAIBlock, outlook: OutlookBlock, diff --git a/apps/sim/blocks/utils.ts b/apps/sim/blocks/utils.ts index 6d75c58619..52ddbf3b93 100644 --- a/apps/sim/blocks/utils.ts +++ b/apps/sim/blocks/utils.ts @@ -214,3 +214,38 @@ export const PROVIDER_CREDENTIAL_INPUTS = { bedrockSecretKey: { type: 'string', description: 'AWS Secret Access Key for Bedrock' }, bedrockRegion: { type: 'string', description: 'AWS region for Bedrock' }, } as const + +/** + * Create a versioned tool selector from an existing tool selector. + * + * This is useful for `*_v2` blocks where the operation UI remains the same, but + * the underlying tool IDs are suffixed (e.g. `cursor_launch_agent` -> `cursor_launch_agent_v2`). + * + * @example + * tools: { + * config: { + * tool: createVersionedToolSelector({ + * baseToolSelector: (params) => params.operation, + * suffix: '_v2', + * fallbackToolId: 'cursor_launch_agent_v2', + * }), + * }, + * } + */ +export function createVersionedToolSelector>(args: { + baseToolSelector: (params: TParams) => string + suffix: `_${string}` + fallbackToolId: string +}): (params: TParams) => string { + const { baseToolSelector, suffix, fallbackToolId } = args + + return (params: TParams) => { + try { + const baseToolId = baseToolSelector(params) + if (!baseToolId || typeof baseToolId !== 'string') return fallbackToolId + return baseToolId.endsWith(suffix) ? baseToolId : `${baseToolId}${suffix}` + } catch { + return fallbackToolId + } + } +} diff --git a/apps/sim/tools/apollo/account_bulk_create.ts b/apps/sim/tools/apollo/account_bulk_create.ts index 6bcaefecc5..6b8cc45f4d 100644 --- a/apps/sim/tools/apollo/account_bulk_create.ts +++ b/apps/sim/tools/apollo/account_bulk_create.ts @@ -56,11 +56,9 @@ export const apolloAccountBulkCreateTool: ToolConfig< output: { created_accounts: data.accounts || data.created_accounts || [], failed_accounts: data.failed_accounts || [], - metadata: { - total_submitted: data.accounts?.length || 0, - created: data.created_accounts?.length || data.accounts?.length || 0, - failed: data.failed_accounts?.length || 0, - }, + total_submitted: data.accounts?.length || 0, + created: data.created_accounts?.length || data.accounts?.length || 0, + failed: data.failed_accounts?.length || 0, }, } }, @@ -74,9 +72,17 @@ export const apolloAccountBulkCreateTool: ToolConfig< type: 'json', description: 'Array of accounts that failed to create', }, - metadata: { - type: 'json', - description: 'Bulk creation metadata including counts of created and failed accounts', + total_submitted: { + type: 'number', + description: 'Total number of accounts submitted', + }, + created: { + type: 'number', + description: 'Number of accounts successfully created', + }, + failed: { + type: 'number', + description: 'Number of accounts that failed to create', }, }, } diff --git a/apps/sim/tools/apollo/account_bulk_update.ts b/apps/sim/tools/apollo/account_bulk_update.ts index 7d20d20956..a78d4f8c45 100644 --- a/apps/sim/tools/apollo/account_bulk_update.ts +++ b/apps/sim/tools/apollo/account_bulk_update.ts @@ -56,11 +56,9 @@ export const apolloAccountBulkUpdateTool: ToolConfig< output: { updated_accounts: data.accounts || data.updated_accounts || [], failed_accounts: data.failed_accounts || [], - metadata: { - total_submitted: data.accounts?.length || 0, - updated: data.updated_accounts?.length || data.accounts?.length || 0, - failed: data.failed_accounts?.length || 0, - }, + total_submitted: data.accounts?.length || 0, + updated: data.updated_accounts?.length || data.accounts?.length || 0, + failed: data.failed_accounts?.length || 0, }, } }, @@ -74,9 +72,17 @@ export const apolloAccountBulkUpdateTool: ToolConfig< type: 'json', description: 'Array of accounts that failed to update', }, - metadata: { - type: 'json', - description: 'Bulk update metadata including counts of updated and failed accounts', + total_submitted: { + type: 'number', + description: 'Total number of accounts submitted', + }, + updated: { + type: 'number', + description: 'Number of accounts successfully updated', + }, + failed: { + type: 'number', + description: 'Number of accounts that failed to update', }, }, } diff --git a/apps/sim/tools/apollo/account_create.ts b/apps/sim/tools/apollo/account_create.ts index dac3203d66..2e3aca53fa 100644 --- a/apps/sim/tools/apollo/account_create.ts +++ b/apps/sim/tools/apollo/account_create.ts @@ -72,15 +72,13 @@ export const apolloAccountCreateTool: ToolConfig< success: true, output: { account: data.account || {}, - metadata: { - created: !!data.account, - }, + created: !!data.account, }, } }, outputs: { account: { type: 'json', description: 'Created account data from Apollo' }, - metadata: { type: 'json', description: 'Creation metadata including created status' }, + created: { type: 'boolean', description: 'Whether the account was successfully created' }, }, } diff --git a/apps/sim/tools/apollo/account_search.ts b/apps/sim/tools/apollo/account_search.ts index 9b2a870606..516d1221bf 100644 --- a/apps/sim/tools/apollo/account_search.ts +++ b/apps/sim/tools/apollo/account_search.ts @@ -84,20 +84,17 @@ export const apolloAccountSearchTool: ToolConfig< success: true, output: { accounts: data.accounts || [], - metadata: { - page: data.pagination?.page || 1, - per_page: data.pagination?.per_page || 25, - total_entries: data.pagination?.total_entries || 0, - }, + page: data.pagination?.page || 1, + per_page: data.pagination?.per_page || 25, + total_entries: data.pagination?.total_entries || 0, }, } }, outputs: { accounts: { type: 'json', description: 'Array of accounts matching the search criteria' }, - metadata: { - type: 'json', - description: 'Pagination information including page, per_page, and total_entries', - }, + page: { type: 'number', description: 'Current page number' }, + per_page: { type: 'number', description: 'Results per page' }, + total_entries: { type: 'number', description: 'Total matching entries' }, }, } diff --git a/apps/sim/tools/apollo/account_update.ts b/apps/sim/tools/apollo/account_update.ts index f49555318f..e10154566e 100644 --- a/apps/sim/tools/apollo/account_update.ts +++ b/apps/sim/tools/apollo/account_update.ts @@ -80,15 +80,13 @@ export const apolloAccountUpdateTool: ToolConfig< success: true, output: { account: data.account || {}, - metadata: { - updated: !!data.account, - }, + updated: !!data.account, }, } }, outputs: { account: { type: 'json', description: 'Updated account data from Apollo' }, - metadata: { type: 'json', description: 'Update metadata including updated status' }, + updated: { type: 'boolean', description: 'Whether the account was successfully updated' }, }, } diff --git a/apps/sim/tools/apollo/contact_bulk_create.ts b/apps/sim/tools/apollo/contact_bulk_create.ts index 3b6a74089d..b16a4e94c1 100644 --- a/apps/sim/tools/apollo/contact_bulk_create.ts +++ b/apps/sim/tools/apollo/contact_bulk_create.ts @@ -69,11 +69,9 @@ export const apolloContactBulkCreateTool: ToolConfig< output: { created_contacts: data.contacts || data.created_contacts || [], existing_contacts: data.existing_contacts || [], - metadata: { - total_submitted: data.contacts?.length || 0, - created: data.created_contacts?.length || data.contacts?.length || 0, - existing: data.existing_contacts?.length || 0, - }, + total_submitted: data.contacts?.length || 0, + created: data.created_contacts?.length || data.contacts?.length || 0, + existing: data.existing_contacts?.length || 0, }, } }, @@ -87,9 +85,17 @@ export const apolloContactBulkCreateTool: ToolConfig< type: 'json', description: 'Array of existing contacts (when deduplication is enabled)', }, - metadata: { - type: 'json', - description: 'Bulk creation metadata including counts of created and existing contacts', + total_submitted: { + type: 'number', + description: 'Total number of contacts submitted', + }, + created: { + type: 'number', + description: 'Number of contacts successfully created', + }, + existing: { + type: 'number', + description: 'Number of existing contacts found', }, }, } diff --git a/apps/sim/tools/apollo/contact_bulk_update.ts b/apps/sim/tools/apollo/contact_bulk_update.ts index 8aec17f56e..4f254cfc1f 100644 --- a/apps/sim/tools/apollo/contact_bulk_update.ts +++ b/apps/sim/tools/apollo/contact_bulk_update.ts @@ -56,11 +56,9 @@ export const apolloContactBulkUpdateTool: ToolConfig< output: { updated_contacts: data.contacts || data.updated_contacts || [], failed_contacts: data.failed_contacts || [], - metadata: { - total_submitted: data.contacts?.length || 0, - updated: data.updated_contacts?.length || data.contacts?.length || 0, - failed: data.failed_contacts?.length || 0, - }, + total_submitted: data.contacts?.length || 0, + updated: data.updated_contacts?.length || data.contacts?.length || 0, + failed: data.failed_contacts?.length || 0, }, } }, @@ -74,9 +72,17 @@ export const apolloContactBulkUpdateTool: ToolConfig< type: 'json', description: 'Array of contacts that failed to update', }, - metadata: { - type: 'json', - description: 'Bulk update metadata including counts of updated and failed contacts', + total_submitted: { + type: 'number', + description: 'Total number of contacts submitted', + }, + updated: { + type: 'number', + description: 'Number of contacts successfully updated', + }, + failed: { + type: 'number', + description: 'Number of contacts that failed to update', }, }, } diff --git a/apps/sim/tools/apollo/contact_create.ts b/apps/sim/tools/apollo/contact_create.ts index efc806f0ad..5724744b45 100644 --- a/apps/sim/tools/apollo/contact_create.ts +++ b/apps/sim/tools/apollo/contact_create.ts @@ -88,15 +88,13 @@ export const apolloContactCreateTool: ToolConfig< success: true, output: { contact: data.contact || {}, - metadata: { - created: !!data.contact, - }, + created: !!data.contact, }, } }, outputs: { contact: { type: 'json', description: 'Created contact data from Apollo' }, - metadata: { type: 'json', description: 'Creation metadata including created status' }, + created: { type: 'boolean', description: 'Whether the contact was successfully created' }, }, } diff --git a/apps/sim/tools/apollo/contact_search.ts b/apps/sim/tools/apollo/contact_search.ts index 6a6ee9a151..d59071258e 100644 --- a/apps/sim/tools/apollo/contact_search.ts +++ b/apps/sim/tools/apollo/contact_search.ts @@ -76,20 +76,17 @@ export const apolloContactSearchTool: ToolConfig< success: true, output: { contacts: data.contacts || [], - metadata: { - page: data.pagination?.page || 1, - per_page: data.pagination?.per_page || 25, - total_entries: data.pagination?.total_entries || 0, - }, + page: data.pagination?.page || 1, + per_page: data.pagination?.per_page || 25, + total_entries: data.pagination?.total_entries || 0, }, } }, outputs: { contacts: { type: 'json', description: 'Array of contacts matching the search criteria' }, - metadata: { - type: 'json', - description: 'Pagination information including page, per_page, and total_entries', - }, + page: { type: 'number', description: 'Current page number' }, + per_page: { type: 'number', description: 'Results per page' }, + total_entries: { type: 'number', description: 'Total matching entries' }, }, } diff --git a/apps/sim/tools/apollo/contact_update.ts b/apps/sim/tools/apollo/contact_update.ts index c7c6041cf4..11c9e6a07b 100644 --- a/apps/sim/tools/apollo/contact_update.ts +++ b/apps/sim/tools/apollo/contact_update.ts @@ -94,15 +94,13 @@ export const apolloContactUpdateTool: ToolConfig< success: true, output: { contact: data.contact || {}, - metadata: { - updated: !!data.contact, - }, + updated: !!data.contact, }, } }, outputs: { contact: { type: 'json', description: 'Updated contact data from Apollo' }, - metadata: { type: 'json', description: 'Update metadata including updated status' }, + updated: { type: 'boolean', description: 'Whether the contact was successfully updated' }, }, } diff --git a/apps/sim/tools/apollo/email_accounts.ts b/apps/sim/tools/apollo/email_accounts.ts index bf865f0578..ceb854a602 100644 --- a/apps/sim/tools/apollo/email_accounts.ts +++ b/apps/sim/tools/apollo/email_accounts.ts @@ -41,15 +41,13 @@ export const apolloEmailAccountsTool: ToolConfig< success: true, output: { email_accounts: data.email_accounts || [], - metadata: { - total: data.email_accounts?.length || 0, - }, + total: data.email_accounts?.length || 0, }, } }, outputs: { email_accounts: { type: 'json', description: 'Array of team email accounts linked in Apollo' }, - metadata: { type: 'json', description: 'Metadata including total count of email accounts' }, + total: { type: 'number', description: 'Total count of email accounts' }, }, } diff --git a/apps/sim/tools/apollo/opportunity_create.ts b/apps/sim/tools/apollo/opportunity_create.ts index 5c329fd7b8..d8cd02b2c1 100644 --- a/apps/sim/tools/apollo/opportunity_create.ts +++ b/apps/sim/tools/apollo/opportunity_create.ts @@ -98,15 +98,13 @@ export const apolloOpportunityCreateTool: ToolConfig< success: true, output: { opportunity: data.opportunity || {}, - metadata: { - created: !!data.opportunity, - }, + created: !!data.opportunity, }, } }, outputs: { opportunity: { type: 'json', description: 'Created opportunity data from Apollo' }, - metadata: { type: 'json', description: 'Creation metadata including created status' }, + created: { type: 'boolean', description: 'Whether the opportunity was successfully created' }, }, } diff --git a/apps/sim/tools/apollo/opportunity_get.ts b/apps/sim/tools/apollo/opportunity_get.ts index e6a3912b32..4fb9c2cc7c 100644 --- a/apps/sim/tools/apollo/opportunity_get.ts +++ b/apps/sim/tools/apollo/opportunity_get.ts @@ -48,15 +48,13 @@ export const apolloOpportunityGetTool: ToolConfig< success: true, output: { opportunity: data.opportunity || {}, - metadata: { - found: !!data.opportunity, - }, + found: !!data.opportunity, }, } }, outputs: { opportunity: { type: 'json', description: 'Complete opportunity data from Apollo' }, - metadata: { type: 'json', description: 'Retrieval metadata including found status' }, + found: { type: 'boolean', description: 'Whether the opportunity was found' }, }, } diff --git a/apps/sim/tools/apollo/opportunity_search.ts b/apps/sim/tools/apollo/opportunity_search.ts index 2ad8782419..3a317feda0 100644 --- a/apps/sim/tools/apollo/opportunity_search.ts +++ b/apps/sim/tools/apollo/opportunity_search.ts @@ -91,11 +91,9 @@ export const apolloOpportunitySearchTool: ToolConfig< success: true, output: { opportunities: data.opportunities || [], - metadata: { - page: data.pagination?.page || 1, - per_page: data.pagination?.per_page || 25, - total_entries: data.pagination?.total_entries || 0, - }, + page: data.pagination?.page || 1, + per_page: data.pagination?.per_page || 25, + total_entries: data.pagination?.total_entries || 0, }, } }, @@ -105,9 +103,8 @@ export const apolloOpportunitySearchTool: ToolConfig< type: 'json', description: 'Array of opportunities matching the search criteria', }, - metadata: { - type: 'json', - description: 'Pagination information including page, per_page, and total_entries', - }, + page: { type: 'number', description: 'Current page number' }, + per_page: { type: 'number', description: 'Results per page' }, + total_entries: { type: 'number', description: 'Total matching entries' }, }, } diff --git a/apps/sim/tools/apollo/opportunity_update.ts b/apps/sim/tools/apollo/opportunity_update.ts index 8f19fcaf22..eee16aed72 100644 --- a/apps/sim/tools/apollo/opportunity_update.ts +++ b/apps/sim/tools/apollo/opportunity_update.ts @@ -97,15 +97,13 @@ export const apolloOpportunityUpdateTool: ToolConfig< success: true, output: { opportunity: data.opportunity || {}, - metadata: { - updated: !!data.opportunity, - }, + updated: !!data.opportunity, }, } }, outputs: { opportunity: { type: 'json', description: 'Updated opportunity data from Apollo' }, - metadata: { type: 'json', description: 'Update metadata including updated status' }, + updated: { type: 'boolean', description: 'Whether the opportunity was successfully updated' }, }, } diff --git a/apps/sim/tools/apollo/organization_bulk_enrich.ts b/apps/sim/tools/apollo/organization_bulk_enrich.ts index cdb06e0e1b..c72d31a0e8 100644 --- a/apps/sim/tools/apollo/organization_bulk_enrich.ts +++ b/apps/sim/tools/apollo/organization_bulk_enrich.ts @@ -53,19 +53,15 @@ export const apolloOrganizationBulkEnrichTool: ToolConfig< success: true, output: { organizations: data.matches || [], - metadata: { - total: data.matches?.length || 0, - enriched: data.matches?.filter((o: any) => o).length || 0, - }, + total: data.matches?.length || 0, + enriched: data.matches?.filter((o: any) => o).length || 0, }, } }, outputs: { organizations: { type: 'json', description: 'Array of enriched organization data' }, - metadata: { - type: 'json', - description: 'Bulk enrichment metadata including total and enriched counts', - }, + total: { type: 'number', description: 'Total number of organizations processed' }, + enriched: { type: 'number', description: 'Number of organizations successfully enriched' }, }, } diff --git a/apps/sim/tools/apollo/organization_enrich.ts b/apps/sim/tools/apollo/organization_enrich.ts index ded4f89629..093048b94e 100644 --- a/apps/sim/tools/apollo/organization_enrich.ts +++ b/apps/sim/tools/apollo/organization_enrich.ts @@ -71,15 +71,16 @@ export const apolloOrganizationEnrichTool: ToolConfig< success: true, output: { organization: data.organization || {}, - metadata: { - enriched: !!data.organization, - }, + enriched: !!data.organization, }, } }, outputs: { organization: { type: 'json', description: 'Enriched organization data from Apollo' }, - metadata: { type: 'json', description: 'Enrichment metadata including enriched status' }, + enriched: { + type: 'boolean', + description: 'Whether the organization was successfully enriched', + }, }, } diff --git a/apps/sim/tools/apollo/organization_search.ts b/apps/sim/tools/apollo/organization_search.ts index 3d94f80d91..96b08990ba 100644 --- a/apps/sim/tools/apollo/organization_search.ts +++ b/apps/sim/tools/apollo/organization_search.ts @@ -101,11 +101,9 @@ export const apolloOrganizationSearchTool: ToolConfig< success: true, output: { organizations: data.organizations || [], - metadata: { - page: data.pagination?.page || 1, - per_page: data.pagination?.per_page || 25, - total_entries: data.pagination?.total_entries || 0, - }, + page: data.pagination?.page || 1, + per_page: data.pagination?.per_page || 25, + total_entries: data.pagination?.total_entries || 0, }, } }, @@ -115,9 +113,8 @@ export const apolloOrganizationSearchTool: ToolConfig< type: 'json', description: 'Array of organizations matching the search criteria', }, - metadata: { - type: 'json', - description: 'Pagination information including page, per_page, and total_entries', - }, + page: { type: 'number', description: 'Current page number' }, + per_page: { type: 'number', description: 'Results per page' }, + total_entries: { type: 'number', description: 'Total matching entries' }, }, } diff --git a/apps/sim/tools/apollo/people_bulk_enrich.ts b/apps/sim/tools/apollo/people_bulk_enrich.ts index afc965ece9..cb6c35aa8e 100644 --- a/apps/sim/tools/apollo/people_bulk_enrich.ts +++ b/apps/sim/tools/apollo/people_bulk_enrich.ts @@ -67,19 +67,15 @@ export const apolloPeopleBulkEnrichTool: ToolConfig< success: true, output: { people: data.matches || [], - metadata: { - total: data.matches?.length || 0, - enriched: data.matches?.filter((p: any) => p).length || 0, - }, + total: data.matches?.length || 0, + enriched: data.matches?.filter((p: any) => p).length || 0, }, } }, outputs: { people: { type: 'json', description: 'Array of enriched people data' }, - metadata: { - type: 'json', - description: 'Bulk enrichment metadata including total and enriched counts', - }, + total: { type: 'number', description: 'Total number of people processed' }, + enriched: { type: 'number', description: 'Number of people successfully enriched' }, }, } diff --git a/apps/sim/tools/apollo/people_enrich.ts b/apps/sim/tools/apollo/people_enrich.ts index e10e474abd..7e48034af0 100644 --- a/apps/sim/tools/apollo/people_enrich.ts +++ b/apps/sim/tools/apollo/people_enrich.ts @@ -107,15 +107,13 @@ export const apolloPeopleEnrichTool: ToolConfig< success: true, output: { person: data.person || {}, - metadata: { - enriched: !!data.person, - }, + enriched: !!data.person, }, } }, outputs: { person: { type: 'json', description: 'Enriched person data from Apollo' }, - metadata: { type: 'json', description: 'Enrichment metadata including enriched status' }, + enriched: { type: 'boolean', description: 'Whether the person was successfully enriched' }, }, } diff --git a/apps/sim/tools/apollo/people_search.ts b/apps/sim/tools/apollo/people_search.ts index f4b14d51c2..f32a59ba6f 100644 --- a/apps/sim/tools/apollo/people_search.ts +++ b/apps/sim/tools/apollo/people_search.ts @@ -107,20 +107,17 @@ export const apolloPeopleSearchTool: ToolConfig< success: true, output: { people: data.people || [], - metadata: { - page: data.pagination?.page || 1, - per_page: data.pagination?.per_page || 25, - total_entries: data.pagination?.total_entries || 0, - }, + page: data.pagination?.page || 1, + per_page: data.pagination?.per_page || 25, + total_entries: data.pagination?.total_entries || 0, }, } }, outputs: { people: { type: 'json', description: 'Array of people matching the search criteria' }, - metadata: { - type: 'json', - description: 'Pagination information including page, per_page, and total_entries', - }, + page: { type: 'number', description: 'Current page number' }, + per_page: { type: 'number', description: 'Results per page' }, + total_entries: { type: 'number', description: 'Total matching entries' }, }, } diff --git a/apps/sim/tools/apollo/sequence_add_contacts.ts b/apps/sim/tools/apollo/sequence_add_contacts.ts index b87a69f77e..3dd5f83f40 100644 --- a/apps/sim/tools/apollo/sequence_add_contacts.ts +++ b/apps/sim/tools/apollo/sequence_add_contacts.ts @@ -81,19 +81,15 @@ export const apolloSequenceAddContactsTool: ToolConfig< success: true, output: { contacts_added: data.contacts || params?.contact_ids || [], - metadata: { - sequence_id: params?.sequence_id || '', - total_added: data.contacts?.length || params?.contact_ids?.length || 0, - }, + sequence_id: params?.sequence_id || '', + total_added: data.contacts?.length || params?.contact_ids?.length || 0, }, } }, outputs: { contacts_added: { type: 'json', description: 'Array of contact IDs added to the sequence' }, - metadata: { - type: 'json', - description: 'Sequence metadata including sequence_id and total_added count', - }, + sequence_id: { type: 'string', description: 'ID of the sequence contacts were added to' }, + total_added: { type: 'number', description: 'Total number of contacts added' }, }, } diff --git a/apps/sim/tools/apollo/sequence_search.ts b/apps/sim/tools/apollo/sequence_search.ts index d358acd2a0..449bb5939e 100644 --- a/apps/sim/tools/apollo/sequence_search.ts +++ b/apps/sim/tools/apollo/sequence_search.ts @@ -74,11 +74,9 @@ export const apolloSequenceSearchTool: ToolConfig< success: true, output: { sequences: data.emailer_campaigns || [], - metadata: { - page: data.pagination?.page || 1, - per_page: data.pagination?.per_page || 25, - total_entries: data.pagination?.total_entries || 0, - }, + page: data.pagination?.page || 1, + per_page: data.pagination?.per_page || 25, + total_entries: data.pagination?.total_entries || 0, }, } }, @@ -88,9 +86,8 @@ export const apolloSequenceSearchTool: ToolConfig< type: 'json', description: 'Array of sequences/campaigns matching the search criteria', }, - metadata: { - type: 'json', - description: 'Pagination information including page, per_page, and total_entries', - }, + page: { type: 'number', description: 'Current page number' }, + per_page: { type: 'number', description: 'Results per page' }, + total_entries: { type: 'number', description: 'Total matching entries' }, }, } diff --git a/apps/sim/tools/apollo/task_create.ts b/apps/sim/tools/apollo/task_create.ts index 50f6dc017b..462a59616e 100644 --- a/apps/sim/tools/apollo/task_create.ts +++ b/apps/sim/tools/apollo/task_create.ts @@ -89,15 +89,13 @@ export const apolloTaskCreateTool: ToolConfig - metadata: { - total_submitted: number - updated: number - failed: number - } + total_submitted: number + updated: number + failed: number } } @@ -295,11 +275,9 @@ export interface ApolloContactSearchParams extends ApolloBaseParams { export interface ApolloContactSearchResponse extends ToolResponse { output: { contacts: ApolloContact[] - metadata: { - page: number - per_page: number - total_entries: number - } + page: number + per_page: number + total_entries: number } } @@ -314,9 +292,7 @@ export interface ApolloAccountCreateParams extends ApolloBaseParams { export interface ApolloAccountCreateResponse extends ToolResponse { output: { account: ApolloAccount - metadata: { - created: boolean - } + created: boolean } } @@ -332,9 +308,7 @@ export interface ApolloAccountUpdateParams extends ApolloBaseParams { export interface ApolloAccountUpdateResponse extends ToolResponse { output: { account: ApolloAccount - metadata: { - updated: boolean - } + updated: boolean } } @@ -350,11 +324,9 @@ export interface ApolloAccountSearchParams extends ApolloBaseParams { export interface ApolloAccountSearchResponse extends ToolResponse { output: { accounts: ApolloAccount[] - metadata: { - page: number - per_page: number - total_entries: number - } + page: number + per_page: number + total_entries: number } } @@ -372,11 +344,9 @@ export interface ApolloAccountBulkCreateResponse extends ToolResponse { output: { created_accounts: ApolloAccount[] failed_accounts: Array<{ name: string; error: string }> - metadata: { - total_submitted: number - created: number - failed: number - } + total_submitted: number + created: number + failed: number } } @@ -395,11 +365,9 @@ export interface ApolloAccountBulkUpdateResponse extends ToolResponse { output: { updated_accounts: ApolloAccount[] failed_accounts: Array<{ id: string; error: string }> - metadata: { - total_submitted: number - updated: number - failed: number - } + total_submitted: number + updated: number + failed: number } } @@ -414,10 +382,8 @@ export interface ApolloSequenceAddContactsParams extends ApolloBaseParams { export interface ApolloSequenceAddContactsResponse extends ToolResponse { output: { contacts_added: string[] - metadata: { - sequence_id: string - total_added: number - } + sequence_id: string + total_added: number } } @@ -434,9 +400,7 @@ export interface ApolloTaskCreateParams extends ApolloBaseParams { export interface ApolloTaskCreateResponse extends ToolResponse { output: { task: ApolloTask - metadata: { - created: boolean - } + created: boolean } } @@ -452,11 +416,9 @@ export interface ApolloTaskSearchParams extends ApolloBaseParams { export interface ApolloTaskSearchResponse extends ToolResponse { output: { tasks: ApolloTask[] - metadata: { - page: number - per_page: number - total_entries: number - } + page: number + per_page: number + total_entries: number } } @@ -470,9 +432,7 @@ export interface ApolloEmailAccountsResponse extends ToolResponse { email: string active: boolean }> - metadata: { - total: number - } + total: number } } @@ -490,9 +450,7 @@ export interface ApolloOpportunityCreateParams extends ApolloBaseParams { export interface ApolloOpportunityCreateResponse extends ToolResponse { output: { opportunity: ApolloOpportunity - metadata: { - created: boolean - } + created: boolean } } @@ -509,11 +467,9 @@ export interface ApolloOpportunitySearchParams extends ApolloBaseParams { export interface ApolloOpportunitySearchResponse extends ToolResponse { output: { opportunities: ApolloOpportunity[] - metadata: { - page: number - per_page: number - total_entries: number - } + page: number + per_page: number + total_entries: number } } @@ -525,9 +481,7 @@ export interface ApolloOpportunityGetParams extends ApolloBaseParams { export interface ApolloOpportunityGetResponse extends ToolResponse { output: { opportunity: ApolloOpportunity - metadata: { - found: boolean - } + found: boolean } } @@ -545,9 +499,7 @@ export interface ApolloOpportunityUpdateParams extends ApolloBaseParams { export interface ApolloOpportunityUpdateResponse extends ToolResponse { output: { opportunity: ApolloOpportunity - metadata: { - updated: boolean - } + updated: boolean } } @@ -575,11 +527,9 @@ export interface ApolloSequenceSearchParams extends ApolloBaseParams { export interface ApolloSequenceSearchResponse extends ToolResponse { output: { sequences: ApolloSequence[] - metadata: { - page: number - per_page: number - total_entries: number - } + page: number + per_page: number + total_entries: number } } diff --git a/apps/sim/tools/cursor/add_followup.ts b/apps/sim/tools/cursor/add_followup.ts index 5291d57ade..5e161fc27f 100644 --- a/apps/sim/tools/cursor/add_followup.ts +++ b/apps/sim/tools/cursor/add_followup.ts @@ -1,12 +1,7 @@ import type { AddFollowupParams, AddFollowupResponse } from '@/tools/cursor/types' import type { ToolConfig } from '@/tools/types' -export const addFollowupTool: ToolConfig = { - id: 'cursor_add_followup', - name: 'Cursor Add Follow-up', - description: 'Add a follow-up instruction to an existing cloud agent.', - version: '1.0.0', - +const addFollowupBase = { params: { apiKey: { type: 'string', @@ -33,15 +28,15 @@ export const addFollowupTool: ToolConfig description: 'JSON array of image objects with base64 data and dimensions (max 5)', }, }, - request: { - url: (params) => `https://api.cursor.com/v0/agents/${params.agentId}/followup`, + url: (params: AddFollowupParams) => + `https://api.cursor.com/v0/agents/${params.agentId}/followup`, method: 'POST', - headers: (params) => ({ + headers: (params: AddFollowupParams) => ({ 'Content-Type': 'application/json', Authorization: `Basic ${Buffer.from(`${params.apiKey}:`).toString('base64')}`, }), - body: (params) => { + body: (params: AddFollowupParams) => { const body: Record = { prompt: { text: params.followupPromptText, @@ -59,6 +54,15 @@ export const addFollowupTool: ToolConfig return body }, }, +} satisfies Pick, 'params' | 'request'> + +export const addFollowupTool: ToolConfig = { + id: 'cursor_add_followup', + name: 'Cursor Add Follow-up', + description: 'Add a follow-up instruction to an existing cloud agent.', + version: '1.0.0', + + ...addFollowupBase, transformResponse: async (response) => { const data = await response.json() @@ -87,3 +91,32 @@ export const addFollowupTool: ToolConfig }, }, } + +interface AddFollowupV2Response { + success: boolean + output: { + id: string + } +} + +export const addFollowupV2Tool: ToolConfig = { + ...addFollowupBase, + id: 'cursor_add_followup_v2', + name: 'Cursor Add Follow-up', + description: + 'Add a follow-up instruction to an existing cloud agent. Returns API-aligned fields only.', + version: '2.0.0', + transformResponse: async (response) => { + const data = await response.json() + + return { + success: true, + output: { + id: data.id, + }, + } + }, + outputs: { + id: { type: 'string', description: 'Agent ID' }, + }, +} diff --git a/apps/sim/tools/cursor/delete_agent.ts b/apps/sim/tools/cursor/delete_agent.ts index ba6d10f7bb..2acf9ea0de 100644 --- a/apps/sim/tools/cursor/delete_agent.ts +++ b/apps/sim/tools/cursor/delete_agent.ts @@ -1,12 +1,7 @@ import type { DeleteAgentParams, DeleteAgentResponse } from '@/tools/cursor/types' import type { ToolConfig } from '@/tools/types' -export const deleteAgentTool: ToolConfig = { - id: 'cursor_delete_agent', - name: 'Cursor Delete Agent', - description: 'Permanently delete a cloud agent. This action cannot be undone.', - version: '1.0.0', - +const deleteAgentBase = { params: { apiKey: { type: 'string', @@ -21,14 +16,22 @@ export const deleteAgentTool: ToolConfig description: 'Unique identifier for the cloud agent (e.g., bc_abc123)', }, }, - request: { - url: (params) => `https://api.cursor.com/v0/agents/${params.agentId}`, + url: (params: DeleteAgentParams) => `https://api.cursor.com/v0/agents/${params.agentId}`, method: 'DELETE', - headers: (params) => ({ + headers: (params: DeleteAgentParams) => ({ Authorization: `Basic ${Buffer.from(`${params.apiKey}:`).toString('base64')}`, }), }, +} satisfies Pick, 'params' | 'request'> + +export const deleteAgentTool: ToolConfig = { + id: 'cursor_delete_agent', + name: 'Cursor Delete Agent', + description: 'Permanently delete a cloud agent. This action cannot be undone.', + version: '1.0.0', + + ...deleteAgentBase, transformResponse: async (response) => { const data = await response.json() @@ -57,3 +60,31 @@ export const deleteAgentTool: ToolConfig }, }, } + +interface DeleteAgentV2Response { + success: boolean + output: { + id: string + } +} + +export const deleteAgentV2Tool: ToolConfig = { + ...deleteAgentBase, + id: 'cursor_delete_agent_v2', + name: 'Cursor Delete Agent', + description: 'Permanently delete a cloud agent. Returns API-aligned fields only.', + version: '2.0.0', + transformResponse: async (response) => { + const data = await response.json() + + return { + success: true, + output: { + id: data.id, + }, + } + }, + outputs: { + id: { type: 'string', description: 'Agent ID' }, + }, +} diff --git a/apps/sim/tools/cursor/get_agent.ts b/apps/sim/tools/cursor/get_agent.ts index 7dd62ff24b..c313e1b213 100644 --- a/apps/sim/tools/cursor/get_agent.ts +++ b/apps/sim/tools/cursor/get_agent.ts @@ -1,12 +1,7 @@ import type { GetAgentParams, GetAgentResponse } from '@/tools/cursor/types' import type { ToolConfig } from '@/tools/types' -export const getAgentTool: ToolConfig = { - id: 'cursor_get_agent', - name: 'Cursor Get Agent', - description: 'Retrieve the current status and results of a cloud agent.', - version: '1.0.0', - +const getAgentBase = { params: { apiKey: { type: 'string', @@ -21,14 +16,22 @@ export const getAgentTool: ToolConfig = { description: 'Unique identifier for the cloud agent (e.g., bc_abc123)', }, }, - request: { - url: (params) => `https://api.cursor.com/v0/agents/${params.agentId}`, + url: (params: GetAgentParams) => `https://api.cursor.com/v0/agents/${params.agentId}`, method: 'GET', - headers: (params) => ({ + headers: (params: GetAgentParams) => ({ Authorization: `Basic ${Buffer.from(`${params.apiKey}:`).toString('base64')}`, }), }, +} satisfies Pick, 'params' | 'request'> + +export const getAgentTool: ToolConfig = { + id: 'cursor_get_agent', + name: 'Cursor Get Agent', + description: 'Retrieve the current status and results of a cloud agent.', + version: '1.0.0', + + ...getAgentBase, transformResponse: async (response) => { const data = await response.json() @@ -59,3 +62,50 @@ export const getAgentTool: ToolConfig = { }, }, } + +interface GetAgentV2Response { + success: boolean + output: { + id: string + name: string + status: string + source: Record + target: Record + summary?: string + createdAt: string + } +} + +export const getAgentV2Tool: ToolConfig = { + ...getAgentBase, + id: 'cursor_get_agent_v2', + name: 'Cursor Get Agent', + description: + 'Retrieve the current status and results of a cloud agent. Returns API-aligned fields only.', + version: '2.0.0', + transformResponse: async (response) => { + const data = await response.json() + + return { + success: true, + output: { + id: data.id, + name: data.name, + status: data.status, + source: data.source, + target: data.target, + summary: data.summary, + createdAt: data.createdAt, + }, + } + }, + outputs: { + id: { type: 'string', description: 'Agent ID' }, + name: { type: 'string', description: 'Agent name' }, + status: { type: 'string', description: 'Agent status' }, + source: { type: 'json', description: 'Source repository info' }, + target: { type: 'json', description: 'Target branch/PR info' }, + summary: { type: 'string', description: 'Agent summary', optional: true }, + createdAt: { type: 'string', description: 'Creation timestamp' }, + }, +} diff --git a/apps/sim/tools/cursor/get_conversation.ts b/apps/sim/tools/cursor/get_conversation.ts index f9c231f656..32752ea7b3 100644 --- a/apps/sim/tools/cursor/get_conversation.ts +++ b/apps/sim/tools/cursor/get_conversation.ts @@ -1,13 +1,7 @@ import type { GetConversationParams, GetConversationResponse } from '@/tools/cursor/types' import type { ToolConfig } from '@/tools/types' -export const getConversationTool: ToolConfig = { - id: 'cursor_get_conversation', - name: 'Cursor Get Conversation', - description: - 'Retrieve the conversation history of a cloud agent, including all user prompts and assistant responses.', - version: '1.0.0', - +const getConversationBase = { params: { apiKey: { type: 'string', @@ -22,14 +16,24 @@ export const getConversationTool: ToolConfig `https://api.cursor.com/v0/agents/${params.agentId}/conversation`, + url: (params: GetConversationParams) => + `https://api.cursor.com/v0/agents/${params.agentId}/conversation`, method: 'GET', - headers: (params) => ({ + headers: (params: GetConversationParams) => ({ Authorization: `Basic ${Buffer.from(`${params.apiKey}:`).toString('base64')}`, }), }, +} satisfies Pick, 'params' | 'request'> + +export const getConversationTool: ToolConfig = { + id: 'cursor_get_conversation', + name: 'Cursor Get Conversation', + description: + 'Retrieve the conversation history of a cloud agent, including all user prompts and assistant responses.', + version: '1.0.0', + + ...getConversationBase, transformResponse: async (response) => { const data = await response.json() @@ -61,3 +65,35 @@ export const getConversationTool: ToolConfig = { + ...getConversationBase, + id: 'cursor_get_conversation_v2', + name: 'Cursor Get Conversation', + description: + 'Retrieve the conversation history of a cloud agent, including all user prompts and assistant responses. Returns API-aligned fields only.', + version: '2.0.0', + transformResponse: async (response) => { + const data = await response.json() + + return { + success: true, + output: { + id: data.id, + messages: data.messages, + }, + } + }, + outputs: { + id: { type: 'string', description: 'Agent ID' }, + messages: { type: 'array', description: 'Array of conversation messages' }, + }, +} diff --git a/apps/sim/tools/cursor/index.ts b/apps/sim/tools/cursor/index.ts index 009eaec6c5..2ec9cebfd1 100644 --- a/apps/sim/tools/cursor/index.ts +++ b/apps/sim/tools/cursor/index.ts @@ -1,10 +1,10 @@ -import { addFollowupTool } from '@/tools/cursor/add_followup' -import { deleteAgentTool } from '@/tools/cursor/delete_agent' -import { getAgentTool } from '@/tools/cursor/get_agent' -import { getConversationTool } from '@/tools/cursor/get_conversation' -import { launchAgentTool } from '@/tools/cursor/launch_agent' -import { listAgentsTool } from '@/tools/cursor/list_agents' -import { stopAgentTool } from '@/tools/cursor/stop_agent' +import { addFollowupTool, addFollowupV2Tool } from '@/tools/cursor/add_followup' +import { deleteAgentTool, deleteAgentV2Tool } from '@/tools/cursor/delete_agent' +import { getAgentTool, getAgentV2Tool } from '@/tools/cursor/get_agent' +import { getConversationTool, getConversationV2Tool } from '@/tools/cursor/get_conversation' +import { launchAgentTool, launchAgentV2Tool } from '@/tools/cursor/launch_agent' +import { listAgentsTool, listAgentsV2Tool } from '@/tools/cursor/list_agents' +import { stopAgentTool, stopAgentV2Tool } from '@/tools/cursor/stop_agent' export const cursorListAgentsTool = listAgentsTool export const cursorGetAgentTool = getAgentTool @@ -13,3 +13,11 @@ export const cursorLaunchAgentTool = launchAgentTool export const cursorAddFollowupTool = addFollowupTool export const cursorStopAgentTool = stopAgentTool export const cursorDeleteAgentTool = deleteAgentTool + +export const cursorListAgentsV2Tool = listAgentsV2Tool +export const cursorGetAgentV2Tool = getAgentV2Tool +export const cursorGetConversationV2Tool = getConversationV2Tool +export const cursorLaunchAgentV2Tool = launchAgentV2Tool +export const cursorAddFollowupV2Tool = addFollowupV2Tool +export const cursorStopAgentV2Tool = stopAgentV2Tool +export const cursorDeleteAgentV2Tool = deleteAgentV2Tool diff --git a/apps/sim/tools/cursor/launch_agent.ts b/apps/sim/tools/cursor/launch_agent.ts index 87a4887610..c4fbb030a9 100644 --- a/apps/sim/tools/cursor/launch_agent.ts +++ b/apps/sim/tools/cursor/launch_agent.ts @@ -1,13 +1,7 @@ import type { LaunchAgentParams, LaunchAgentResponse } from '@/tools/cursor/types' import type { ToolConfig } from '@/tools/types' -export const launchAgentTool: ToolConfig = { - id: 'cursor_launch_agent', - name: 'Cursor Launch Agent', - description: - 'Start a new cloud agent to work on a GitHub repository with the given instructions.', - version: '1.0.0', - +const launchAgentBase = { params: { apiKey: { type: 'string', @@ -70,15 +64,14 @@ export const launchAgentTool: ToolConfig description: 'Skip requesting reviewers on the PR', }, }, - request: { url: () => 'https://api.cursor.com/v0/agents', method: 'POST', - headers: (params) => ({ + headers: (params: LaunchAgentParams) => ({ 'Content-Type': 'application/json', Authorization: `Basic ${Buffer.from(`${params.apiKey}:`).toString('base64')}`, }), - body: (params) => { + body: (params: LaunchAgentParams) => { const body: Record = { source: { repository: params.repository, @@ -119,6 +112,16 @@ export const launchAgentTool: ToolConfig return body }, }, +} satisfies Pick, 'params' | 'request'> + +export const launchAgentTool: ToolConfig = { + id: 'cursor_launch_agent', + name: 'Cursor Launch Agent', + description: + 'Start a new cloud agent to work on a GitHub repository with the given instructions.', + version: '1.0.0', + + ...launchAgentBase, transformResponse: async (response) => { const data = await response.json() @@ -148,3 +151,36 @@ export const launchAgentTool: ToolConfig }, }, } + +interface LaunchAgentV2Response { + success: boolean + output: { + id: string + url: string + } +} + +export const launchAgentV2Tool: ToolConfig = { + ...launchAgentBase, + id: 'cursor_launch_agent_v2', + name: 'Cursor Launch Agent', + description: + 'Start a new cloud agent to work on a GitHub repository with the given instructions. Returns API-aligned fields only.', + version: '2.0.0', + transformResponse: async (response) => { + const data = await response.json() + const agentUrl = `https://cursor.com/agents?selectedBcId=${data.id}` + + return { + success: true, + output: { + id: data.id, + url: agentUrl, + }, + } + }, + outputs: { + id: { type: 'string', description: 'Agent ID' }, + url: { type: 'string', description: 'Agent URL' }, + }, +} diff --git a/apps/sim/tools/cursor/list_agents.ts b/apps/sim/tools/cursor/list_agents.ts index 7f96f67812..2739d4d73a 100644 --- a/apps/sim/tools/cursor/list_agents.ts +++ b/apps/sim/tools/cursor/list_agents.ts @@ -1,12 +1,7 @@ import type { ListAgentsParams, ListAgentsResponse } from '@/tools/cursor/types' import type { ToolConfig } from '@/tools/types' -export const listAgentsTool: ToolConfig = { - id: 'cursor_list_agents', - name: 'Cursor List Agents', - description: 'List all cloud agents for the authenticated user with optional pagination.', - version: '1.0.0', - +const listAgentsBase = { params: { apiKey: { type: 'string', @@ -27,19 +22,27 @@ export const listAgentsTool: ToolConfig = description: 'Pagination cursor from previous response', }, }, - request: { - url: (params) => { + url: (params: ListAgentsParams) => { const url = new URL('https://api.cursor.com/v0/agents') if (params.limit) url.searchParams.set('limit', String(params.limit)) if (params.cursor) url.searchParams.set('cursor', params.cursor) return url.toString() }, method: 'GET', - headers: (params) => ({ + headers: (params: ListAgentsParams) => ({ Authorization: `Basic ${Buffer.from(`${params.apiKey}:`).toString('base64')}`, }), }, +} satisfies Pick, 'params' | 'request'> + +export const listAgentsTool: ToolConfig = { + id: 'cursor_list_agents', + name: 'Cursor List Agents', + description: 'List all cloud agents for the authenticated user with optional pagination.', + version: '1.0.0', + + ...listAgentsBase, transformResponse: async (response) => { const data = await response.json() @@ -75,3 +78,35 @@ export const listAgentsTool: ToolConfig = }, }, } + +interface ListAgentsV2Response { + success: boolean + output: { + agents: unknown[] + nextCursor?: string + } +} + +export const listAgentsV2Tool: ToolConfig = { + ...listAgentsBase, + id: 'cursor_list_agents_v2', + name: 'Cursor List Agents', + description: + 'List all cloud agents for the authenticated user with optional pagination. Returns API-aligned fields only.', + version: '2.0.0', + transformResponse: async (response) => { + const data = await response.json() + + return { + success: true, + output: { + agents: data.agents, + nextCursor: data.nextCursor, + }, + } + }, + outputs: { + agents: { type: 'array', description: 'Array of agent objects' }, + nextCursor: { type: 'string', description: 'Pagination cursor for next page', optional: true }, + }, +} diff --git a/apps/sim/tools/cursor/stop_agent.ts b/apps/sim/tools/cursor/stop_agent.ts index 6680bb681f..728ca9af60 100644 --- a/apps/sim/tools/cursor/stop_agent.ts +++ b/apps/sim/tools/cursor/stop_agent.ts @@ -1,12 +1,7 @@ import type { StopAgentParams, StopAgentResponse } from '@/tools/cursor/types' import type { ToolConfig } from '@/tools/types' -export const stopAgentTool: ToolConfig = { - id: 'cursor_stop_agent', - name: 'Cursor Stop Agent', - description: 'Stop a running cloud agent. This pauses the agent without deleting it.', - version: '1.0.0', - +const stopAgentBase = { params: { apiKey: { type: 'string', @@ -21,14 +16,22 @@ export const stopAgentTool: ToolConfig = { description: 'Unique identifier for the cloud agent (e.g., bc_abc123)', }, }, - request: { - url: (params) => `https://api.cursor.com/v0/agents/${params.agentId}/stop`, + url: (params: StopAgentParams) => `https://api.cursor.com/v0/agents/${params.agentId}/stop`, method: 'POST', - headers: (params) => ({ + headers: (params: StopAgentParams) => ({ Authorization: `Basic ${Buffer.from(`${params.apiKey}:`).toString('base64')}`, }), }, +} satisfies Pick, 'params' | 'request'> + +export const stopAgentTool: ToolConfig = { + id: 'cursor_stop_agent', + name: 'Cursor Stop Agent', + description: 'Stop a running cloud agent. This pauses the agent without deleting it.', + version: '1.0.0', + + ...stopAgentBase, transformResponse: async (response) => { const data = await response.json() @@ -57,3 +60,31 @@ export const stopAgentTool: ToolConfig = { }, }, } + +interface StopAgentV2Response { + success: boolean + output: { + id: string + } +} + +export const stopAgentV2Tool: ToolConfig = { + ...stopAgentBase, + id: 'cursor_stop_agent_v2', + name: 'Cursor Stop Agent', + description: 'Stop a running cloud agent. Returns API-aligned fields only.', + version: '2.0.0', + transformResponse: async (response) => { + const data = await response.json() + + return { + success: true, + output: { + id: data.id, + }, + } + }, + outputs: { + id: { type: 'string', description: 'Agent ID' }, + }, +} diff --git a/apps/sim/tools/github/add_assignees.ts b/apps/sim/tools/github/add_assignees.ts index 21c031bde9..db0164e604 100644 --- a/apps/sim/tools/github/add_assignees.ts +++ b/apps/sim/tools/github/add_assignees.ts @@ -106,3 +106,46 @@ URL: ${issue.html_url}` }, }, } + +export const addAssigneesV2Tool: ToolConfig = { + id: 'github_add_assignees_v2', + name: addAssigneesTool.name, + description: addAssigneesTool.description, + version: '2.0.0', + params: addAssigneesTool.params, + request: addAssigneesTool.request, + + transformResponse: async (response: Response) => { + const issue = await response.json() + return { + success: true, + output: { + id: issue.id, + number: issue.number, + title: issue.title, + state: issue.state, + html_url: issue.html_url, + body: issue.body, + user: issue.user, + labels: issue.labels, + assignees: issue.assignees, + created_at: issue.created_at, + updated_at: issue.updated_at, + }, + } + }, + + outputs: { + id: { type: 'number', description: 'Issue ID' }, + number: { type: 'number', description: 'Issue number' }, + title: { type: 'string', description: 'Issue title' }, + state: { type: 'string', description: 'Issue state' }, + html_url: { type: 'string', description: 'GitHub web URL' }, + body: { type: 'string', description: 'Issue body' }, + user: { type: 'json', description: 'Issue creator' }, + labels: { type: 'array', description: 'Array of label objects' }, + assignees: { type: 'array', description: 'Array of assignee objects' }, + created_at: { type: 'string', description: 'Creation timestamp' }, + updated_at: { type: 'string', description: 'Last update timestamp' }, + }, +} diff --git a/apps/sim/tools/github/add_labels.ts b/apps/sim/tools/github/add_labels.ts index 9feee76c0e..f3df83f0f3 100644 --- a/apps/sim/tools/github/add_labels.ts +++ b/apps/sim/tools/github/add_labels.ts @@ -94,3 +94,40 @@ All labels on issue: ${labels.join(', ')}` }, }, } + +export const addLabelsV2Tool: ToolConfig = { + id: 'github_add_labels_v2', + name: addLabelsTool.name, + description: addLabelsTool.description, + version: '2.0.0', + params: addLabelsTool.params, + request: addLabelsTool.request, + + transformResponse: async (response: Response) => { + const labels = await response.json() + return { + success: true, + output: { + items: labels, + count: labels.length, + }, + } + }, + + outputs: { + items: { + type: 'array', + description: 'Array of label objects on the issue', + items: { + type: 'object', + properties: { + id: { type: 'number', description: 'Label ID' }, + name: { type: 'string', description: 'Label name' }, + color: { type: 'string', description: 'Label color' }, + description: { type: 'string', description: 'Label description' }, + }, + }, + }, + count: { type: 'number', description: 'Number of labels' }, + }, +} diff --git a/apps/sim/tools/github/cancel_workflow_run.ts b/apps/sim/tools/github/cancel_workflow_run.ts index 24f813c2e6..34acc21da7 100644 --- a/apps/sim/tools/github/cancel_workflow_run.ts +++ b/apps/sim/tools/github/cancel_workflow_run.ts @@ -122,3 +122,26 @@ The run may have already completed or been cancelled.` }, }, } + +export const cancelWorkflowRunV2Tool: ToolConfig = { + id: 'github_cancel_workflow_run_v2', + name: cancelWorkflowRunTool.name, + description: cancelWorkflowRunTool.description, + version: '2.0.0', + params: cancelWorkflowRunTool.params, + request: cancelWorkflowRunTool.request, + oauth: cancelWorkflowRunTool.oauth, + transformResponse: async (response: Response, params) => { + return { + success: true, + output: { + cancelled: response.status === 202, + run_id: params?.run_id || 0, + }, + } + }, + outputs: { + cancelled: { type: 'boolean', description: 'Whether cancellation was initiated' }, + run_id: { type: 'number', description: 'Workflow run ID' }, + }, +} diff --git a/apps/sim/tools/github/close_issue.ts b/apps/sim/tools/github/close_issue.ts index 2db0bb7090..646eb1bb71 100644 --- a/apps/sim/tools/github/close_issue.ts +++ b/apps/sim/tools/github/close_issue.ts @@ -113,3 +113,50 @@ URL: ${issue.html_url}` }, }, } + +export const closeIssueV2Tool: ToolConfig = { + id: 'github_close_issue_v2', + name: closeIssueTool.name, + description: closeIssueTool.description, + version: '2.0.0', + params: closeIssueTool.params, + request: closeIssueTool.request, + + transformResponse: async (response: Response) => { + const issue = await response.json() + return { + success: true, + output: { + id: issue.id, + number: issue.number, + title: issue.title, + state: issue.state, + state_reason: issue.state_reason, + html_url: issue.html_url, + body: issue.body, + user: issue.user, + labels: issue.labels, + assignees: issue.assignees, + closed_at: issue.closed_at, + created_at: issue.created_at, + updated_at: issue.updated_at, + }, + } + }, + + outputs: { + id: { type: 'number', description: 'Issue ID' }, + number: { type: 'number', description: 'Issue number' }, + title: { type: 'string', description: 'Issue title' }, + state: { type: 'string', description: 'Issue state (closed)' }, + state_reason: { type: 'string', description: 'Reason for closing' }, + html_url: { type: 'string', description: 'GitHub web URL' }, + body: { type: 'string', description: 'Issue body' }, + user: { type: 'json', description: 'User who created the issue' }, + labels: { type: 'array', description: 'Array of label objects' }, + assignees: { type: 'array', description: 'Array of assignee objects' }, + closed_at: { type: 'string', description: 'Close timestamp' }, + created_at: { type: 'string', description: 'Creation timestamp' }, + updated_at: { type: 'string', description: 'Last update timestamp' }, + }, +} diff --git a/apps/sim/tools/github/close_pr.ts b/apps/sim/tools/github/close_pr.ts index 2cf3615772..b24ff51faa 100644 --- a/apps/sim/tools/github/close_pr.ts +++ b/apps/sim/tools/github/close_pr.ts @@ -90,3 +90,52 @@ URL: ${pr.html_url}` }, }, } + +export const closePRV2Tool: ToolConfig = { + id: 'github_close_pr_v2', + name: closePRTool.name, + description: closePRTool.description, + version: '2.0.0', + params: closePRTool.params, + request: closePRTool.request, + + transformResponse: async (response: Response) => { + const pr = await response.json() + return { + success: true, + output: { + id: pr.id, + number: pr.number, + title: pr.title, + state: pr.state, + html_url: pr.html_url, + body: pr.body, + user: pr.user, + head: pr.head, + base: pr.base, + draft: pr.draft, + merged: pr.merged, + closed_at: pr.closed_at, + created_at: pr.created_at, + updated_at: pr.updated_at, + }, + } + }, + + outputs: { + id: { type: 'number', description: 'PR ID' }, + number: { type: 'number', description: 'PR number' }, + title: { type: 'string', description: 'PR title' }, + state: { type: 'string', description: 'PR state (closed)' }, + html_url: { type: 'string', description: 'GitHub web URL' }, + body: { type: 'string', description: 'PR description' }, + user: { type: 'json', description: 'User who created the PR' }, + head: { type: 'json', description: 'Head branch info' }, + base: { type: 'json', description: 'Base branch info' }, + draft: { type: 'boolean', description: 'Whether PR is a draft' }, + merged: { type: 'boolean', description: 'Whether PR is merged' }, + closed_at: { type: 'string', description: 'Close timestamp' }, + created_at: { type: 'string', description: 'Creation timestamp' }, + updated_at: { type: 'string', description: 'Last update timestamp' }, + }, +} diff --git a/apps/sim/tools/github/comment.ts b/apps/sim/tools/github/comment.ts index f5efef8bfd..e1214d8486 100644 --- a/apps/sim/tools/github/comment.ts +++ b/apps/sim/tools/github/comment.ts @@ -139,3 +139,42 @@ export const commentTool: ToolConfig }, }, } + +export const commentV2Tool: ToolConfig = { + id: 'github_comment_v2', + name: commentTool.name, + description: commentTool.description, + version: '2.0.0', + params: commentTool.params, + request: commentTool.request, + transformResponse: async (response: Response) => { + const data = await response.json() + return { + success: true, + output: { + id: data.id, + body: data.body, + html_url: data.html_url, + user: data.user, + path: data.path, + line: data.line || data.position, + side: data.side, + commit_id: data.commit_id, + created_at: data.created_at, + updated_at: data.updated_at, + }, + } + }, + outputs: { + id: { type: 'number', description: 'Comment ID' }, + body: { type: 'string', description: 'Comment body' }, + html_url: { type: 'string', description: 'GitHub web URL' }, + user: { type: 'json', description: 'User who created the comment' }, + path: { type: 'string', description: 'File path (if file comment)' }, + line: { type: 'number', description: 'Line number' }, + side: { type: 'string', description: 'Diff side' }, + commit_id: { type: 'string', description: 'Commit ID' }, + created_at: { type: 'string', description: 'Creation timestamp' }, + updated_at: { type: 'string', description: 'Last update timestamp' }, + }, +} diff --git a/apps/sim/tools/github/create_branch.ts b/apps/sim/tools/github/create_branch.ts index 08e45cf8a6..43c5d7d26a 100644 --- a/apps/sim/tools/github/create_branch.ts +++ b/apps/sim/tools/github/create_branch.ts @@ -91,3 +91,32 @@ URL: ${ref.url}` }, }, } + +export const createBranchV2Tool: ToolConfig = { + id: 'github_create_branch_v2', + name: createBranchTool.name, + description: createBranchTool.description, + version: '2.0.0', + params: createBranchTool.params, + request: createBranchTool.request, + + transformResponse: async (response: Response) => { + const ref = await response.json() + return { + success: true, + output: { + ref: ref.ref, + node_id: ref.node_id, + url: ref.url, + object: ref.object, + }, + } + }, + + outputs: { + ref: { type: 'string', description: 'Full reference name (refs/heads/branch)' }, + node_id: { type: 'string', description: 'Git ref node ID' }, + url: { type: 'string', description: 'API URL for the reference' }, + object: { type: 'json', description: 'Git object with type and sha' }, + }, +} diff --git a/apps/sim/tools/github/create_file.ts b/apps/sim/tools/github/create_file.ts index c2d66f9d2d..803c6e3d77 100644 --- a/apps/sim/tools/github/create_file.ts +++ b/apps/sim/tools/github/create_file.ts @@ -170,3 +170,27 @@ View file: ${data.content.html_url}` }, }, } + +export const createFileV2Tool: ToolConfig = { + id: 'github_create_file_v2', + name: createFileTool.name, + description: createFileTool.description, + version: '2.0.0', + params: createFileTool.params, + request: createFileTool.request, + oauth: createFileTool.oauth, + transformResponse: async (response: Response) => { + const data = await response.json() + return { + success: true, + output: { + content: data.content, + commit: data.commit, + }, + } + }, + outputs: { + content: { type: 'json', description: 'Created file content info' }, + commit: { type: 'json', description: 'Commit information' }, + }, +} diff --git a/apps/sim/tools/github/create_issue.ts b/apps/sim/tools/github/create_issue.ts index 041d6dac0d..fd0b165168 100644 --- a/apps/sim/tools/github/create_issue.ts +++ b/apps/sim/tools/github/create_issue.ts @@ -141,3 +141,50 @@ ${assignees.length > 0 ? `Assignees: ${assignees.join(', ')}` : ''}` }, }, } + +export const createIssueV2Tool: ToolConfig = { + id: 'github_create_issue_v2', + name: createIssueTool.name, + description: createIssueTool.description, + version: '2.0.0', + params: createIssueTool.params, + request: createIssueTool.request, + + transformResponse: async (response: Response) => { + const issue = await response.json() + return { + success: true, + output: { + id: issue.id, + number: issue.number, + title: issue.title, + state: issue.state, + html_url: issue.html_url, + body: issue.body, + user: issue.user, + labels: issue.labels, + assignees: issue.assignees, + milestone: issue.milestone, + created_at: issue.created_at, + updated_at: issue.updated_at, + closed_at: issue.closed_at, + }, + } + }, + + outputs: { + id: { type: 'number', description: 'Issue ID' }, + number: { type: 'number', description: 'Issue number' }, + title: { type: 'string', description: 'Issue title' }, + state: { type: 'string', description: 'Issue state (open/closed)' }, + html_url: { type: 'string', description: 'GitHub web URL' }, + body: { type: 'string', description: 'Issue body/description' }, + user: { type: 'json', description: 'User who created the issue' }, + labels: { type: 'array', description: 'Array of label objects' }, + assignees: { type: 'array', description: 'Array of assignee objects' }, + milestone: { type: 'json', description: 'Milestone object' }, + created_at: { type: 'string', description: 'Creation timestamp' }, + updated_at: { type: 'string', description: 'Last update timestamp' }, + closed_at: { type: 'string', description: 'Close timestamp' }, + }, +} diff --git a/apps/sim/tools/github/create_pr.ts b/apps/sim/tools/github/create_pr.ts index 4c1a8b7c72..6388aa4a77 100644 --- a/apps/sim/tools/github/create_pr.ts +++ b/apps/sim/tools/github/create_pr.ts @@ -118,3 +118,52 @@ URL: ${pr.html_url}` }, }, } + +export const createPRV2Tool: ToolConfig = { + id: 'github_create_pr_v2', + name: createPRTool.name, + description: createPRTool.description, + version: '2.0.0', + params: createPRTool.params, + request: createPRTool.request, + + transformResponse: async (response: Response) => { + const pr = await response.json() + return { + success: true, + output: { + id: pr.id, + number: pr.number, + title: pr.title, + state: pr.state, + html_url: pr.html_url, + body: pr.body, + user: pr.user, + head: pr.head, + base: pr.base, + draft: pr.draft, + merged: pr.merged, + mergeable: pr.mergeable, + created_at: pr.created_at, + updated_at: pr.updated_at, + }, + } + }, + + outputs: { + id: { type: 'number', description: 'Pull request ID' }, + number: { type: 'number', description: 'Pull request number' }, + title: { type: 'string', description: 'PR title' }, + state: { type: 'string', description: 'PR state' }, + html_url: { type: 'string', description: 'GitHub web URL' }, + body: { type: 'string', description: 'PR description' }, + user: { type: 'json', description: 'User who created the PR' }, + head: { type: 'json', description: 'Head branch info' }, + base: { type: 'json', description: 'Base branch info' }, + draft: { type: 'boolean', description: 'Whether PR is a draft' }, + merged: { type: 'boolean', description: 'Whether PR is merged' }, + mergeable: { type: 'boolean', description: 'Whether PR is mergeable' }, + created_at: { type: 'string', description: 'Creation timestamp' }, + updated_at: { type: 'string', description: 'Last update timestamp' }, + }, +} diff --git a/apps/sim/tools/github/create_project.ts b/apps/sim/tools/github/create_project.ts index f86fffab6f..aa8c135864 100644 --- a/apps/sim/tools/github/create_project.ts +++ b/apps/sim/tools/github/create_project.ts @@ -146,3 +146,45 @@ export const createProjectTool: ToolConfig }, }, } + +export const createProjectV2Tool: ToolConfig = { + id: 'github_create_project_v2', + name: createProjectTool.name, + description: createProjectTool.description, + version: '2.0.0', + params: createProjectTool.params, + request: createProjectTool.request, + oauth: createProjectTool.oauth, + transformResponse: async (response: Response) => { + const data = await response.json() + if (data.errors) { + return { + success: false, + output: { id: '', title: '', number: 0, url: '' }, + error: data.errors[0].message, + } + } + const project = data.data?.createProjectV2?.projectV2 || {} + return { + success: true, + output: { + id: project.id, + title: project.title, + number: project.number, + url: project.url, + closed: project.closed, + public: project.public, + shortDescription: project.shortDescription, + }, + } + }, + outputs: { + id: { type: 'string', description: 'Project node ID' }, + title: { type: 'string', description: 'Project title' }, + number: { type: 'number', description: 'Project number' }, + url: { type: 'string', description: 'Project URL' }, + closed: { type: 'boolean', description: 'Whether project is closed' }, + public: { type: 'boolean', description: 'Whether project is public' }, + shortDescription: { type: 'string', description: 'Short description' }, + }, +} diff --git a/apps/sim/tools/github/create_release.ts b/apps/sim/tools/github/create_release.ts index 9f9396f8dd..e1d53e9b97 100644 --- a/apps/sim/tools/github/create_release.ts +++ b/apps/sim/tools/github/create_release.ts @@ -155,3 +155,49 @@ Download URLs: }, }, } + +export const createReleaseV2Tool: ToolConfig = { + id: 'github_create_release_v2', + name: createReleaseTool.name, + description: createReleaseTool.description, + version: '2.0.0', + params: createReleaseTool.params, + request: createReleaseTool.request, + oauth: createReleaseTool.oauth, + transformResponse: async (response: Response) => { + const data = await response.json() + return { + success: true, + output: { + id: data.id, + tag_name: data.tag_name, + name: data.name, + body: data.body, + html_url: data.html_url, + tarball_url: data.tarball_url, + zipball_url: data.zipball_url, + draft: data.draft, + prerelease: data.prerelease, + author: data.author, + assets: data.assets, + created_at: data.created_at, + published_at: data.published_at, + }, + } + }, + outputs: { + id: { type: 'number', description: 'Release ID' }, + tag_name: { type: 'string', description: 'Git tag name' }, + name: { type: 'string', description: 'Release name' }, + body: { type: 'string', description: 'Release description' }, + html_url: { type: 'string', description: 'GitHub web URL' }, + tarball_url: { type: 'string', description: 'Tarball download URL' }, + zipball_url: { type: 'string', description: 'Zipball download URL' }, + draft: { type: 'boolean', description: 'Whether this is a draft' }, + prerelease: { type: 'boolean', description: 'Whether this is a prerelease' }, + author: { type: 'json', description: 'Release author' }, + assets: { type: 'array', description: 'Release assets' }, + created_at: { type: 'string', description: 'Creation timestamp' }, + published_at: { type: 'string', description: 'Publication timestamp' }, + }, +} diff --git a/apps/sim/tools/github/delete_branch.ts b/apps/sim/tools/github/delete_branch.ts index d218dc59e8..e61b5113a6 100644 --- a/apps/sim/tools/github/delete_branch.ts +++ b/apps/sim/tools/github/delete_branch.ts @@ -87,3 +87,28 @@ export const deleteBranchTool: ToolConfig = { + id: 'github_delete_branch_v2', + name: deleteBranchTool.name, + description: deleteBranchTool.description, + version: '2.0.0', + params: deleteBranchTool.params, + request: deleteBranchTool.request, + + transformResponse: async (response: Response, params) => { + // DELETE returns 204 No Content on success + return { + success: true, + output: { + deleted: response.status === 204, + branch: params?.branch || '', + }, + } + }, + + outputs: { + deleted: { type: 'boolean', description: 'Whether the branch was deleted' }, + branch: { type: 'string', description: 'Name of the deleted branch' }, + }, +} diff --git a/apps/sim/tools/github/delete_comment.ts b/apps/sim/tools/github/delete_comment.ts index 05ae139bec..6b49cfa07e 100644 --- a/apps/sim/tools/github/delete_comment.ts +++ b/apps/sim/tools/github/delete_comment.ts @@ -72,3 +72,27 @@ export const deleteCommentTool: ToolConfig = { + id: 'github_delete_comment_v2', + name: deleteCommentTool.name, + description: deleteCommentTool.description, + version: '2.0.0', + params: deleteCommentTool.params, + request: deleteCommentTool.request, + + transformResponse: async (response: Response, params) => { + return { + success: true, + output: { + deleted: response.status === 204, + comment_id: params?.comment_id || 0, + }, + } + }, + + outputs: { + deleted: { type: 'boolean', description: 'Whether deletion was successful' }, + comment_id: { type: 'number', description: 'Deleted comment ID' }, + }, +} diff --git a/apps/sim/tools/github/delete_file.ts b/apps/sim/tools/github/delete_file.ts index c759510530..0465f8073c 100644 --- a/apps/sim/tools/github/delete_file.ts +++ b/apps/sim/tools/github/delete_file.ts @@ -147,3 +147,28 @@ View commit: ${data.commit.html_url || 'N/A'}` }, }, } + +export const deleteFileV2Tool: ToolConfig = { + id: 'github_delete_file_v2', + name: deleteFileTool.name, + description: deleteFileTool.description, + version: '2.0.0', + params: deleteFileTool.params, + request: deleteFileTool.request, + + transformResponse: async (response: Response) => { + const data = await response.json() + return { + success: true, + output: { + content: data.content, + commit: data.commit, + }, + } + }, + + outputs: { + content: { type: 'json', description: 'File content info (null for delete)' }, + commit: { type: 'json', description: 'Commit information' }, + }, +} diff --git a/apps/sim/tools/github/delete_project.ts b/apps/sim/tools/github/delete_project.ts index c39e2806ff..e3698b255d 100644 --- a/apps/sim/tools/github/delete_project.ts +++ b/apps/sim/tools/github/delete_project.ts @@ -126,3 +126,42 @@ export const deleteProjectTool: ToolConfig }, }, } + +export const deleteProjectV2Tool: ToolConfig = { + id: 'github_delete_project_v2', + name: deleteProjectTool.name, + description: deleteProjectTool.description, + version: '2.0.0', + params: deleteProjectTool.params, + request: deleteProjectTool.request, + + transformResponse: async (response: Response) => { + const data = await response.json() + + if (data.errors) { + return { + success: false, + output: { id: '', title: '', number: 0, url: '' }, + error: data.errors[0].message, + } + } + + const project = data.data?.deleteProjectV2?.projectV2 || {} + return { + success: true, + output: { + id: project.id, + title: project.title, + number: project.number, + url: project.url, + }, + } + }, + + outputs: { + id: { type: 'string', description: 'Deleted project node ID' }, + title: { type: 'string', description: 'Deleted project title' }, + number: { type: 'number', description: 'Deleted project number' }, + url: { type: 'string', description: 'Deleted project URL' }, + }, +} diff --git a/apps/sim/tools/github/delete_release.ts b/apps/sim/tools/github/delete_release.ts index 579c6a1e2e..bc7891d02e 100644 --- a/apps/sim/tools/github/delete_release.ts +++ b/apps/sim/tools/github/delete_release.ts @@ -96,3 +96,27 @@ Note: The associated Git tag has not been deleted and remains in the repository. }, }, } + +export const deleteReleaseV2Tool: ToolConfig = { + id: 'github_delete_release_v2', + name: deleteReleaseTool.name, + description: deleteReleaseTool.description, + version: '2.0.0', + params: deleteReleaseTool.params, + request: deleteReleaseTool.request, + + transformResponse: async (response: Response, params) => { + return { + success: true, + output: { + deleted: response.status === 204, + release_id: params?.release_id || 0, + }, + } + }, + + outputs: { + deleted: { type: 'boolean', description: 'Whether the release was deleted' }, + release_id: { type: 'number', description: 'ID of the deleted release' }, + }, +} diff --git a/apps/sim/tools/github/get_branch.ts b/apps/sim/tools/github/get_branch.ts index bbafee5cfd..6da3544ad7 100644 --- a/apps/sim/tools/github/get_branch.ts +++ b/apps/sim/tools/github/get_branch.ts @@ -90,3 +90,34 @@ Protected: ${branch.protected ? 'Yes' : 'No'}` }, }, } + +export const getBranchV2Tool: ToolConfig = { + id: 'github_get_branch_v2', + name: getBranchTool.name, + description: getBranchTool.description, + version: '2.0.0', + params: getBranchTool.params, + request: getBranchTool.request, + + transformResponse: async (response: Response) => { + const branch = await response.json() + return { + success: true, + output: { + name: branch.name, + commit: branch.commit, + protected: branch.protected, + protection: branch.protection, + protection_url: branch.protection_url, + }, + } + }, + + outputs: { + name: { type: 'string', description: 'Branch name' }, + commit: { type: 'json', description: 'Commit object with sha, url, etc.' }, + protected: { type: 'boolean', description: 'Whether branch is protected' }, + protection: { type: 'json', description: 'Protection settings object' }, + protection_url: { type: 'string', description: 'URL to protection settings' }, + }, +} diff --git a/apps/sim/tools/github/get_branch_protection.ts b/apps/sim/tools/github/get_branch_protection.ts index de583986ab..465c876c12 100644 --- a/apps/sim/tools/github/get_branch_protection.ts +++ b/apps/sim/tools/github/get_branch_protection.ts @@ -181,3 +181,49 @@ Enforce Admins: ${protection.enforce_admins?.enabled ? 'Yes' : 'No'}` }, }, } + +export const getBranchProtectionV2Tool: ToolConfig = { + id: 'github_get_branch_protection_v2', + name: getBranchProtectionTool.name, + description: getBranchProtectionTool.description, + version: '2.0.0', + params: getBranchProtectionTool.params, + request: getBranchProtectionTool.request, + + transformResponse: async (response: Response) => { + const protection = await response.json() + return { + success: true, + output: { + url: protection.url, + required_status_checks: protection.required_status_checks, + enforce_admins: protection.enforce_admins, + required_pull_request_reviews: protection.required_pull_request_reviews, + restrictions: protection.restrictions, + required_linear_history: protection.required_linear_history, + allow_force_pushes: protection.allow_force_pushes, + allow_deletions: protection.allow_deletions, + block_creations: protection.block_creations, + required_conversation_resolution: protection.required_conversation_resolution, + required_signatures: protection.required_signatures, + }, + } + }, + + outputs: { + url: { type: 'string', description: 'Protection settings URL' }, + required_status_checks: { type: 'json', description: 'Status check requirements' }, + enforce_admins: { type: 'json', description: 'Admin enforcement settings' }, + required_pull_request_reviews: { type: 'json', description: 'PR review requirements' }, + restrictions: { type: 'json', description: 'Push restrictions' }, + required_linear_history: { type: 'json', description: 'Linear history requirement' }, + allow_force_pushes: { type: 'json', description: 'Force push settings' }, + allow_deletions: { type: 'json', description: 'Deletion settings' }, + block_creations: { type: 'json', description: 'Creation blocking settings' }, + required_conversation_resolution: { + type: 'json', + description: 'Conversation resolution requirement', + }, + required_signatures: { type: 'json', description: 'Signature requirements' }, + }, +} diff --git a/apps/sim/tools/github/get_file_content.ts b/apps/sim/tools/github/get_file_content.ts index a5956d6655..b40d63b51b 100644 --- a/apps/sim/tools/github/get_file_content.ts +++ b/apps/sim/tools/github/get_file_content.ts @@ -136,3 +136,57 @@ ${contentPreview}` }, }, } + +export const getFileContentV2Tool: ToolConfig = { + id: 'github_get_file_content_v2', + name: getFileContentTool.name, + description: getFileContentTool.description, + version: '2.0.0', + params: getFileContentTool.params, + request: getFileContentTool.request, + + transformResponse: async (response: Response) => { + const data = await response.json() + + // Decode base64 content if present + let decodedContent = '' + if (data.content && data.encoding === 'base64') { + try { + decodedContent = Buffer.from(data.content, 'base64').toString('utf-8') + } catch { + decodedContent = data.content + } + } + + return { + success: true, + output: { + name: data.name, + path: data.path, + sha: data.sha, + size: data.size, + type: data.type, + content: decodedContent || data.content, + encoding: data.encoding, + html_url: data.html_url, + download_url: data.download_url, + git_url: data.git_url, + _links: data._links, + }, + } + }, + + outputs: { + name: { type: 'string', description: 'File name' }, + path: { type: 'string', description: 'Full path in repository' }, + sha: { type: 'string', description: 'Git blob SHA' }, + size: { type: 'number', description: 'File size in bytes' }, + type: { type: 'string', description: 'Content type (file/dir/symlink/submodule)' }, + content: { type: 'string', description: 'Decoded file content' }, + encoding: { type: 'string', description: 'Content encoding' }, + html_url: { type: 'string', description: 'GitHub web URL' }, + download_url: { type: 'string', description: 'Direct download URL' }, + git_url: { type: 'string', description: 'Git blob API URL' }, + _links: { type: 'json', description: 'Related links' }, + }, +} diff --git a/apps/sim/tools/github/get_issue.ts b/apps/sim/tools/github/get_issue.ts index e08fa82257..c6893335fc 100644 --- a/apps/sim/tools/github/get_issue.ts +++ b/apps/sim/tools/github/get_issue.ts @@ -104,3 +104,54 @@ ${issue.body || 'No description provided'}` }, }, } + +export const getIssueV2Tool: ToolConfig = { + id: 'github_get_issue_v2', + name: getIssueTool.name, + description: getIssueTool.description, + version: '2.0.0', + params: getIssueTool.params, + request: getIssueTool.request, + + transformResponse: async (response: Response) => { + const issue = await response.json() + return { + success: true, + output: { + id: issue.id, + number: issue.number, + title: issue.title, + state: issue.state, + html_url: issue.html_url, + body: issue.body, + user: issue.user, + labels: issue.labels, + assignees: issue.assignees, + milestone: issue.milestone, + comments: issue.comments, + created_at: issue.created_at, + updated_at: issue.updated_at, + closed_at: issue.closed_at, + closed_by: issue.closed_by, + }, + } + }, + + outputs: { + id: { type: 'number', description: 'Issue ID' }, + number: { type: 'number', description: 'Issue number' }, + title: { type: 'string', description: 'Issue title' }, + state: { type: 'string', description: 'Issue state (open/closed)' }, + html_url: { type: 'string', description: 'GitHub web URL' }, + body: { type: 'string', description: 'Issue body/description' }, + user: { type: 'json', description: 'User who created the issue' }, + labels: { type: 'array', description: 'Array of label objects' }, + assignees: { type: 'array', description: 'Array of assignee objects' }, + milestone: { type: 'json', description: 'Milestone object' }, + comments: { type: 'number', description: 'Number of comments' }, + created_at: { type: 'string', description: 'Creation timestamp' }, + updated_at: { type: 'string', description: 'Last update timestamp' }, + closed_at: { type: 'string', description: 'Close timestamp' }, + closed_by: { type: 'json', description: 'User who closed the issue' }, + }, +} diff --git a/apps/sim/tools/github/get_pr_files.ts b/apps/sim/tools/github/get_pr_files.ts index b0409433b8..e4af9130b5 100644 --- a/apps/sim/tools/github/get_pr_files.ts +++ b/apps/sim/tools/github/get_pr_files.ts @@ -136,3 +136,45 @@ ${files }, }, } + +export const getPRFilesV2Tool: ToolConfig = { + id: 'github_get_pr_files_v2', + name: getPRFilesTool.name, + description: getPRFilesTool.description, + version: '2.0.0', + params: getPRFilesTool.params, + request: getPRFilesTool.request, + + transformResponse: async (response: Response) => { + const files = await response.json() + return { + success: true, + output: { + items: files, + count: files.length, + }, + } + }, + + outputs: { + items: { + type: 'array', + description: 'Array of changed file objects', + items: { + type: 'object', + properties: { + filename: { type: 'string', description: 'File path' }, + status: { type: 'string', description: 'Change status (added/modified/deleted/renamed)' }, + additions: { type: 'number', description: 'Lines added' }, + deletions: { type: 'number', description: 'Lines deleted' }, + changes: { type: 'number', description: 'Total changes' }, + patch: { type: 'string', description: 'File diff patch' }, + sha: { type: 'string', description: 'File SHA' }, + blob_url: { type: 'string', description: 'GitHub blob URL' }, + raw_url: { type: 'string', description: 'Raw file URL' }, + }, + }, + }, + count: { type: 'number', description: 'Total number of files' }, + }, +} diff --git a/apps/sim/tools/github/get_project.ts b/apps/sim/tools/github/get_project.ts index 75f221ca4b..8e948ed92c 100644 --- a/apps/sim/tools/github/get_project.ts +++ b/apps/sim/tools/github/get_project.ts @@ -161,3 +161,86 @@ export const getProjectTool: ToolConfig = { }, }, } + +export const getProjectV2Tool: ToolConfig = { + id: 'github_get_project_v2', + name: getProjectTool.name, + description: getProjectTool.description, + version: '2.0.0', + params: getProjectTool.params, + request: getProjectTool.request, + + transformResponse: async (response: Response) => { + const data = await response.json() + + if (data.errors) { + return { + success: false, + output: { + id: '', + title: '', + number: 0, + url: '', + closed: false, + public: false, + shortDescription: '', + readme: '', + createdAt: '', + updatedAt: '', + }, + error: data.errors[0].message, + } + } + + const ownerData = data.data?.organization || data.data?.user + const project = ownerData?.projectV2 + + if (!project) { + return { + success: false, + output: { + id: '', + title: '', + number: 0, + url: '', + closed: false, + public: false, + shortDescription: '', + readme: '', + createdAt: '', + updatedAt: '', + }, + error: 'Project not found', + } + } + + return { + success: true, + output: { + id: project.id, + title: project.title, + number: project.number, + url: project.url, + closed: project.closed, + public: project.public, + shortDescription: project.shortDescription, + readme: project.readme, + createdAt: project.createdAt, + updatedAt: project.updatedAt, + }, + } + }, + + outputs: { + id: { type: 'string', description: 'Project node ID' }, + title: { type: 'string', description: 'Project title' }, + number: { type: 'number', description: 'Project number' }, + url: { type: 'string', description: 'Project URL' }, + closed: { type: 'boolean', description: 'Whether project is closed' }, + public: { type: 'boolean', description: 'Whether project is public' }, + shortDescription: { type: 'string', description: 'Short description' }, + readme: { type: 'string', description: 'Project readme' }, + createdAt: { type: 'string', description: 'Creation timestamp' }, + updatedAt: { type: 'string', description: 'Last update timestamp' }, + }, +} diff --git a/apps/sim/tools/github/get_release.ts b/apps/sim/tools/github/get_release.ts index 5371156b54..5762450c3c 100644 --- a/apps/sim/tools/github/get_release.ts +++ b/apps/sim/tools/github/get_release.ts @@ -109,3 +109,52 @@ Download URLs: }, }, } + +export const getReleaseV2Tool: ToolConfig = { + id: 'github_get_release_v2', + name: getReleaseTool.name, + description: getReleaseTool.description, + version: '2.0.0', + params: getReleaseTool.params, + request: getReleaseTool.request, + + transformResponse: async (response: Response) => { + const data = await response.json() + return { + success: true, + output: { + id: data.id, + tag_name: data.tag_name, + name: data.name, + body: data.body, + html_url: data.html_url, + tarball_url: data.tarball_url, + zipball_url: data.zipball_url, + draft: data.draft, + prerelease: data.prerelease, + author: data.author, + assets: data.assets, + created_at: data.created_at, + published_at: data.published_at, + target_commitish: data.target_commitish, + }, + } + }, + + outputs: { + id: { type: 'number', description: 'Release ID' }, + tag_name: { type: 'string', description: 'Git tag name' }, + name: { type: 'string', description: 'Release name' }, + body: { type: 'string', description: 'Release description' }, + html_url: { type: 'string', description: 'GitHub web URL' }, + tarball_url: { type: 'string', description: 'Tarball download URL' }, + zipball_url: { type: 'string', description: 'Zipball download URL' }, + draft: { type: 'boolean', description: 'Whether this is a draft' }, + prerelease: { type: 'boolean', description: 'Whether this is a prerelease' }, + author: { type: 'json', description: 'Release author object' }, + assets: { type: 'array', description: 'Array of release asset objects' }, + created_at: { type: 'string', description: 'Creation timestamp' }, + published_at: { type: 'string', description: 'Publication timestamp' }, + target_commitish: { type: 'string', description: 'Target commit/branch' }, + }, +} diff --git a/apps/sim/tools/github/get_tree.ts b/apps/sim/tools/github/get_tree.ts index b1647fb526..4095fbf891 100644 --- a/apps/sim/tools/github/get_tree.ts +++ b/apps/sim/tools/github/get_tree.ts @@ -161,3 +161,53 @@ Total items: ${items.length} }, }, } + +export const getTreeV2Tool: ToolConfig = { + id: 'github_get_tree_v2', + name: getTreeTool.name, + description: getTreeTool.description, + version: '2.0.0', + params: getTreeTool.params, + request: getTreeTool.request, + + transformResponse: async (response: Response) => { + const data = await response.json() + + // API returns array for directory, object for file + if (!Array.isArray(data)) { + return { + success: false, + output: { items: [], count: 0 }, + error: 'Path points to a file. Use github_get_file_content to get file contents.', + } + } + + return { + success: true, + output: { + items: data, + count: data.length, + }, + } + }, + + outputs: { + items: { + type: 'array', + description: 'Array of file/directory objects', + items: { + type: 'object', + properties: { + name: { type: 'string', description: 'File or directory name' }, + path: { type: 'string', description: 'Full path in repository' }, + sha: { type: 'string', description: 'Git object SHA' }, + size: { type: 'number', description: 'Size in bytes' }, + type: { type: 'string', description: 'Type (file/dir/symlink/submodule)' }, + html_url: { type: 'string', description: 'GitHub web URL' }, + download_url: { type: 'string', description: 'Direct download URL' }, + }, + }, + }, + count: { type: 'number', description: 'Total number of items' }, + }, +} diff --git a/apps/sim/tools/github/get_workflow.ts b/apps/sim/tools/github/get_workflow.ts index 51d46e10bd..c6aa6365f1 100644 --- a/apps/sim/tools/github/get_workflow.ts +++ b/apps/sim/tools/github/get_workflow.ts @@ -87,3 +87,44 @@ Updated: ${data.updated_at}` }, }, } + +export const getWorkflowV2Tool: ToolConfig = { + id: 'github_get_workflow_v2', + name: getWorkflowTool.name, + description: getWorkflowTool.description, + version: '2.0.0', + params: getWorkflowTool.params, + request: getWorkflowTool.request, + + transformResponse: async (response: Response) => { + const data = await response.json() + return { + success: true, + output: { + id: data.id, + node_id: data.node_id, + name: data.name, + path: data.path, + state: data.state, + html_url: data.html_url, + badge_url: data.badge_url, + url: data.url, + created_at: data.created_at, + updated_at: data.updated_at, + }, + } + }, + + outputs: { + id: { type: 'number', description: 'Workflow ID' }, + node_id: { type: 'string', description: 'Workflow node ID' }, + name: { type: 'string', description: 'Workflow name' }, + path: { type: 'string', description: 'Path to workflow file' }, + state: { type: 'string', description: 'Workflow state (active/disabled)' }, + html_url: { type: 'string', description: 'GitHub web URL' }, + badge_url: { type: 'string', description: 'Badge URL' }, + url: { type: 'string', description: 'API URL' }, + created_at: { type: 'string', description: 'Creation timestamp' }, + updated_at: { type: 'string', description: 'Last update timestamp' }, + }, +} diff --git a/apps/sim/tools/github/get_workflow_run.ts b/apps/sim/tools/github/get_workflow_run.ts index ff297ad00d..be52f5a730 100644 --- a/apps/sim/tools/github/get_workflow_run.ts +++ b/apps/sim/tools/github/get_workflow_run.ts @@ -93,3 +93,60 @@ Logs: ${data.logs_url}` }, }, } + +export const getWorkflowRunV2Tool: ToolConfig = { + id: 'github_get_workflow_run_v2', + name: getWorkflowRunTool.name, + description: getWorkflowRunTool.description, + version: '2.0.0', + params: getWorkflowRunTool.params, + request: getWorkflowRunTool.request, + + transformResponse: async (response: Response) => { + const data = await response.json() + return { + success: true, + output: { + id: data.id, + name: data.name, + head_branch: data.head_branch, + head_sha: data.head_sha, + run_number: data.run_number, + run_attempt: data.run_attempt, + event: data.event, + status: data.status, + conclusion: data.conclusion, + workflow_id: data.workflow_id, + html_url: data.html_url, + logs_url: data.logs_url, + jobs_url: data.jobs_url, + artifacts_url: data.artifacts_url, + triggering_actor: data.triggering_actor, + run_started_at: data.run_started_at, + created_at: data.created_at, + updated_at: data.updated_at, + }, + } + }, + + outputs: { + id: { type: 'number', description: 'Workflow run ID' }, + name: { type: 'string', description: 'Workflow name' }, + head_branch: { type: 'string', description: 'Branch name' }, + head_sha: { type: 'string', description: 'Commit SHA' }, + run_number: { type: 'number', description: 'Run number' }, + run_attempt: { type: 'number', description: 'Run attempt number' }, + event: { type: 'string', description: 'Trigger event type' }, + status: { type: 'string', description: 'Run status' }, + conclusion: { type: 'string', description: 'Run conclusion' }, + workflow_id: { type: 'number', description: 'Workflow ID' }, + html_url: { type: 'string', description: 'GitHub web URL' }, + logs_url: { type: 'string', description: 'Logs download URL' }, + jobs_url: { type: 'string', description: 'Jobs API URL' }, + artifacts_url: { type: 'string', description: 'Artifacts API URL' }, + triggering_actor: { type: 'json', description: 'User who triggered the run' }, + run_started_at: { type: 'string', description: 'Run start timestamp' }, + created_at: { type: 'string', description: 'Creation timestamp' }, + updated_at: { type: 'string', description: 'Last update timestamp' }, + }, +} diff --git a/apps/sim/tools/github/index.ts b/apps/sim/tools/github/index.ts index ba3a57da36..bd3ff3df89 100644 --- a/apps/sim/tools/github/index.ts +++ b/apps/sim/tools/github/index.ts @@ -1,105 +1,163 @@ -import { addAssigneesTool } from '@/tools/github/add_assignees' -import { addLabelsTool } from '@/tools/github/add_labels' -import { cancelWorkflowRunTool } from '@/tools/github/cancel_workflow_run' -import { closeIssueTool } from '@/tools/github/close_issue' -import { closePRTool } from '@/tools/github/close_pr' -import { commentTool } from '@/tools/github/comment' -import { createBranchTool } from '@/tools/github/create_branch' -import { createFileTool } from '@/tools/github/create_file' -import { createIssueTool } from '@/tools/github/create_issue' -import { createPRTool } from '@/tools/github/create_pr' -import { createProjectTool } from '@/tools/github/create_project' -import { createReleaseTool } from '@/tools/github/create_release' -import { deleteBranchTool } from '@/tools/github/delete_branch' -import { deleteCommentTool } from '@/tools/github/delete_comment' -import { deleteFileTool } from '@/tools/github/delete_file' -import { deleteProjectTool } from '@/tools/github/delete_project' -import { deleteReleaseTool } from '@/tools/github/delete_release' -import { getBranchTool } from '@/tools/github/get_branch' -import { getBranchProtectionTool } from '@/tools/github/get_branch_protection' -import { getFileContentTool } from '@/tools/github/get_file_content' -import { getIssueTool } from '@/tools/github/get_issue' -import { getPRFilesTool } from '@/tools/github/get_pr_files' -import { getProjectTool } from '@/tools/github/get_project' -import { getReleaseTool } from '@/tools/github/get_release' -import { getTreeTool } from '@/tools/github/get_tree' -import { getWorkflowTool } from '@/tools/github/get_workflow' -import { getWorkflowRunTool } from '@/tools/github/get_workflow_run' -import { issueCommentTool } from '@/tools/github/issue_comment' -import { latestCommitTool } from '@/tools/github/latest_commit' -import { listBranchesTool } from '@/tools/github/list_branches' -import { listIssueCommentsTool } from '@/tools/github/list_issue_comments' -import { listIssuesTool } from '@/tools/github/list_issues' -import { listPRCommentsTool } from '@/tools/github/list_pr_comments' -import { listProjectsTool } from '@/tools/github/list_projects' -import { listPRsTool } from '@/tools/github/list_prs' -import { listReleasesTool } from '@/tools/github/list_releases' -import { listWorkflowRunsTool } from '@/tools/github/list_workflow_runs' -import { listWorkflowsTool } from '@/tools/github/list_workflows' -import { mergePRTool } from '@/tools/github/merge_pr' -import { prTool } from '@/tools/github/pr' -import { removeLabelTool } from '@/tools/github/remove_label' -import { repoInfoTool } from '@/tools/github/repo_info' -import { requestReviewersTool } from '@/tools/github/request_reviewers' -import { rerunWorkflowTool } from '@/tools/github/rerun_workflow' -import { triggerWorkflowTool } from '@/tools/github/trigger_workflow' -import { updateBranchProtectionTool } from '@/tools/github/update_branch_protection' -import { updateCommentTool } from '@/tools/github/update_comment' -import { updateFileTool } from '@/tools/github/update_file' -import { updateIssueTool } from '@/tools/github/update_issue' -import { updatePRTool } from '@/tools/github/update_pr' -import { updateProjectTool } from '@/tools/github/update_project' -import { updateReleaseTool } from '@/tools/github/update_release' +import { addAssigneesTool, addAssigneesV2Tool } from '@/tools/github/add_assignees' +import { addLabelsTool, addLabelsV2Tool } from '@/tools/github/add_labels' +import { cancelWorkflowRunTool, cancelWorkflowRunV2Tool } from '@/tools/github/cancel_workflow_run' +import { closeIssueTool, closeIssueV2Tool } from '@/tools/github/close_issue' +import { closePRTool, closePRV2Tool } from '@/tools/github/close_pr' +import { commentTool, commentV2Tool } from '@/tools/github/comment' +import { createBranchTool, createBranchV2Tool } from '@/tools/github/create_branch' +import { createFileTool, createFileV2Tool } from '@/tools/github/create_file' +import { createIssueTool, createIssueV2Tool } from '@/tools/github/create_issue' +import { createPRTool, createPRV2Tool } from '@/tools/github/create_pr' +import { createProjectTool, createProjectV2Tool } from '@/tools/github/create_project' +import { createReleaseTool, createReleaseV2Tool } from '@/tools/github/create_release' +import { deleteBranchTool, deleteBranchV2Tool } from '@/tools/github/delete_branch' +import { deleteCommentTool, deleteCommentV2Tool } from '@/tools/github/delete_comment' +import { deleteFileTool, deleteFileV2Tool } from '@/tools/github/delete_file' +import { deleteProjectTool, deleteProjectV2Tool } from '@/tools/github/delete_project' +import { deleteReleaseTool, deleteReleaseV2Tool } from '@/tools/github/delete_release' +import { getBranchTool, getBranchV2Tool } from '@/tools/github/get_branch' +import { + getBranchProtectionTool, + getBranchProtectionV2Tool, +} from '@/tools/github/get_branch_protection' +import { getFileContentTool, getFileContentV2Tool } from '@/tools/github/get_file_content' +import { getIssueTool, getIssueV2Tool } from '@/tools/github/get_issue' +import { getPRFilesTool, getPRFilesV2Tool } from '@/tools/github/get_pr_files' +import { getProjectTool, getProjectV2Tool } from '@/tools/github/get_project' +import { getReleaseTool, getReleaseV2Tool } from '@/tools/github/get_release' +import { getTreeTool, getTreeV2Tool } from '@/tools/github/get_tree' +import { getWorkflowTool, getWorkflowV2Tool } from '@/tools/github/get_workflow' +import { getWorkflowRunTool, getWorkflowRunV2Tool } from '@/tools/github/get_workflow_run' +import { issueCommentTool, issueCommentV2Tool } from '@/tools/github/issue_comment' +import { latestCommitTool, latestCommitV2Tool } from '@/tools/github/latest_commit' +import { listBranchesTool, listBranchesV2Tool } from '@/tools/github/list_branches' +import { listIssueCommentsTool, listIssueCommentsV2Tool } from '@/tools/github/list_issue_comments' +import { listIssuesTool, listIssuesV2Tool } from '@/tools/github/list_issues' +import { listPRCommentsTool, listPRCommentsV2Tool } from '@/tools/github/list_pr_comments' +import { listProjectsTool, listProjectsV2Tool } from '@/tools/github/list_projects' +import { listPRsTool, listPRsV2Tool } from '@/tools/github/list_prs' +import { listReleasesTool, listReleasesV2Tool } from '@/tools/github/list_releases' +import { listWorkflowRunsTool, listWorkflowRunsV2Tool } from '@/tools/github/list_workflow_runs' +import { listWorkflowsTool, listWorkflowsV2Tool } from '@/tools/github/list_workflows' +import { mergePRTool, mergePRV2Tool } from '@/tools/github/merge_pr' +import { prTool, prV2Tool } from '@/tools/github/pr' +import { removeLabelTool, removeLabelV2Tool } from '@/tools/github/remove_label' +import { repoInfoTool, repoInfoV2Tool } from '@/tools/github/repo_info' +import { requestReviewersTool, requestReviewersV2Tool } from '@/tools/github/request_reviewers' +import { rerunWorkflowTool, rerunWorkflowV2Tool } from '@/tools/github/rerun_workflow' +import { triggerWorkflowTool, triggerWorkflowV2Tool } from '@/tools/github/trigger_workflow' +import { + updateBranchProtectionTool, + updateBranchProtectionV2Tool, +} from '@/tools/github/update_branch_protection' +import { updateCommentTool, updateCommentV2Tool } from '@/tools/github/update_comment' +import { updateFileTool, updateFileV2Tool } from '@/tools/github/update_file' +import { updateIssueTool, updateIssueV2Tool } from '@/tools/github/update_issue' +import { updatePRTool, updatePRV2Tool } from '@/tools/github/update_pr' +import { updateProjectTool, updateProjectV2Tool } from '@/tools/github/update_project' +import { updateReleaseTool, updateReleaseV2Tool } from '@/tools/github/update_release' export const githubCancelWorkflowRunTool = cancelWorkflowRunTool +export const githubCancelWorkflowRunV2Tool = cancelWorkflowRunV2Tool export const githubClosePRTool = closePRTool +export const githubClosePRV2Tool = closePRV2Tool export const githubCommentTool = commentTool +export const githubCommentV2Tool = commentV2Tool export const githubCreateBranchTool = createBranchTool +export const githubCreateBranchV2Tool = createBranchV2Tool export const githubCreateFileTool = createFileTool +export const githubCreateFileV2Tool = createFileV2Tool export const githubCreatePRTool = createPRTool +export const githubCreatePRV2Tool = createPRV2Tool export const githubCreateProjectTool = createProjectTool +export const githubCreateProjectV2Tool = createProjectV2Tool export const githubCreateReleaseTool = createReleaseTool +export const githubCreateReleaseV2Tool = createReleaseV2Tool export const githubDeleteBranchTool = deleteBranchTool +export const githubDeleteBranchV2Tool = deleteBranchV2Tool export const githubDeleteCommentTool = deleteCommentTool +export const githubDeleteCommentV2Tool = deleteCommentV2Tool export const githubDeleteFileTool = deleteFileTool +export const githubDeleteFileV2Tool = deleteFileV2Tool export const githubDeleteProjectTool = deleteProjectTool +export const githubDeleteProjectV2Tool = deleteProjectV2Tool export const githubDeleteReleaseTool = deleteReleaseTool +export const githubDeleteReleaseV2Tool = deleteReleaseV2Tool export const githubGetBranchTool = getBranchTool +export const githubGetBranchV2Tool = getBranchV2Tool export const githubGetBranchProtectionTool = getBranchProtectionTool +export const githubGetBranchProtectionV2Tool = getBranchProtectionV2Tool export const githubGetFileContentTool = getFileContentTool +export const githubGetFileContentV2Tool = getFileContentV2Tool export const githubGetPRFilesTool = getPRFilesTool +export const githubGetPRFilesV2Tool = getPRFilesV2Tool export const githubGetProjectTool = getProjectTool +export const githubGetProjectV2Tool = getProjectV2Tool export const githubGetReleaseTool = getReleaseTool +export const githubGetReleaseV2Tool = getReleaseV2Tool export const githubGetTreeTool = getTreeTool +export const githubGetTreeV2Tool = getTreeV2Tool export const githubGetWorkflowTool = getWorkflowTool +export const githubGetWorkflowV2Tool = getWorkflowV2Tool export const githubGetWorkflowRunTool = getWorkflowRunTool +export const githubGetWorkflowRunV2Tool = getWorkflowRunV2Tool export const githubIssueCommentTool = issueCommentTool +export const githubIssueCommentV2Tool = issueCommentV2Tool export const githubLatestCommitTool = latestCommitTool +export const githubLatestCommitV2Tool = latestCommitV2Tool export const githubListBranchesTool = listBranchesTool +export const githubListBranchesV2Tool = listBranchesV2Tool export const githubListIssueCommentsTool = listIssueCommentsTool +export const githubListIssueCommentsV2Tool = listIssueCommentsV2Tool export const githubListPRCommentsTool = listPRCommentsTool +export const githubListPRCommentsV2Tool = listPRCommentsV2Tool export const githubListPRsTool = listPRsTool +export const githubListPRsV2Tool = listPRsV2Tool export const githubListProjectsTool = listProjectsTool +export const githubListProjectsV2Tool = listProjectsV2Tool export const githubListReleasesTool = listReleasesTool +export const githubListReleasesV2Tool = listReleasesV2Tool export const githubListWorkflowRunsTool = listWorkflowRunsTool +export const githubListWorkflowRunsV2Tool = listWorkflowRunsV2Tool export const githubListWorkflowsTool = listWorkflowsTool +export const githubListWorkflowsV2Tool = listWorkflowsV2Tool export const githubMergePRTool = mergePRTool +export const githubMergePRV2Tool = mergePRV2Tool export const githubPrTool = prTool +export const githubPrV2Tool = prV2Tool export const githubRepoInfoTool = repoInfoTool +export const githubRepoInfoV2Tool = repoInfoV2Tool export const githubRequestReviewersTool = requestReviewersTool +export const githubRequestReviewersV2Tool = requestReviewersV2Tool export const githubRerunWorkflowTool = rerunWorkflowTool +export const githubRerunWorkflowV2Tool = rerunWorkflowV2Tool export const githubTriggerWorkflowTool = triggerWorkflowTool +export const githubTriggerWorkflowV2Tool = triggerWorkflowV2Tool export const githubUpdateBranchProtectionTool = updateBranchProtectionTool +export const githubUpdateBranchProtectionV2Tool = updateBranchProtectionV2Tool export const githubUpdateCommentTool = updateCommentTool +export const githubUpdateCommentV2Tool = updateCommentV2Tool export const githubUpdateFileTool = updateFileTool +export const githubUpdateFileV2Tool = updateFileV2Tool export const githubUpdatePRTool = updatePRTool +export const githubUpdatePRV2Tool = updatePRV2Tool export const githubUpdateProjectTool = updateProjectTool +export const githubUpdateProjectV2Tool = updateProjectV2Tool export const githubUpdateReleaseTool = updateReleaseTool +export const githubUpdateReleaseV2Tool = updateReleaseV2Tool export const githubAddAssigneesTool = addAssigneesTool +export const githubAddAssigneesV2Tool = addAssigneesV2Tool export const githubAddLabelsTool = addLabelsTool +export const githubAddLabelsV2Tool = addLabelsV2Tool export const githubCloseIssueTool = closeIssueTool +export const githubCloseIssueV2Tool = closeIssueV2Tool export const githubCreateIssueTool = createIssueTool +export const githubCreateIssueV2Tool = createIssueV2Tool export const githubGetIssueTool = getIssueTool +export const githubGetIssueV2Tool = getIssueV2Tool export const githubListIssuesTool = listIssuesTool +export const githubListIssuesV2Tool = listIssuesV2Tool export const githubRemoveLabelTool = removeLabelTool +export const githubRemoveLabelV2Tool = removeLabelV2Tool export const githubUpdateIssueTool = updateIssueTool +export const githubUpdateIssueV2Tool = updateIssueV2Tool diff --git a/apps/sim/tools/github/issue_comment.ts b/apps/sim/tools/github/issue_comment.ts index 8228e359b3..293952c063 100644 --- a/apps/sim/tools/github/issue_comment.ts +++ b/apps/sim/tools/github/issue_comment.ts @@ -101,3 +101,35 @@ export const issueCommentTool: ToolConfig { + const comment = await response.json() + return { + success: true, + output: { + id: comment.id, + body: comment.body, + html_url: comment.html_url, + user: comment.user, + created_at: comment.created_at, + updated_at: comment.updated_at, + }, + } + }, + outputs: { + id: { type: 'number', description: 'Comment ID' }, + body: { type: 'string', description: 'Comment body' }, + html_url: { type: 'string', description: 'GitHub web URL' }, + user: { type: 'json', description: 'User who created the comment' }, + created_at: { type: 'string', description: 'Creation timestamp' }, + updated_at: { type: 'string', description: 'Last update timestamp' }, + }, +} diff --git a/apps/sim/tools/github/latest_commit.ts b/apps/sim/tools/github/latest_commit.ts index c4e7db0318..5ebb018170 100644 --- a/apps/sim/tools/github/latest_commit.ts +++ b/apps/sim/tools/github/latest_commit.ts @@ -134,3 +134,34 @@ export const latestCommitTool: ToolConfig { + const commits = await response.json() + const commit = commits[0] + return { + success: true, + output: { + sha: commit.sha, + html_url: commit.html_url, + commit: commit.commit, + author: commit.author, + committer: commit.committer, + }, + } + }, + outputs: { + sha: { type: 'string', description: 'Commit SHA' }, + html_url: { type: 'string', description: 'GitHub web URL' }, + commit: { type: 'json', description: 'Commit info with message, author, committer' }, + author: { type: 'json', description: 'Author user object' }, + committer: { type: 'json', description: 'Committer user object' }, + }, +} diff --git a/apps/sim/tools/github/list_branches.ts b/apps/sim/tools/github/list_branches.ts index fa35c39b28..8671c21f10 100644 --- a/apps/sim/tools/github/list_branches.ts +++ b/apps/sim/tools/github/list_branches.ts @@ -135,3 +135,39 @@ ${branchList}` }, }, } + +export const listBranchesV2Tool: ToolConfig = { + id: 'github_list_branches_v2', + name: listBranchesTool.name, + description: listBranchesTool.description, + version: '2.0.0', + params: listBranchesTool.params, + request: listBranchesTool.request, + + transformResponse: async (response: Response) => { + const branches = await response.json() + return { + success: true, + output: { + items: branches, + count: branches.length, + }, + } + }, + + outputs: { + items: { + type: 'array', + description: 'Array of branch objects', + items: { + type: 'object', + properties: { + name: { type: 'string', description: 'Branch name' }, + commit: { type: 'object', description: 'Commit info with sha and url' }, + protected: { type: 'boolean', description: 'Whether branch is protected' }, + }, + }, + }, + count: { type: 'number', description: 'Number of branches returned' }, + }, +} diff --git a/apps/sim/tools/github/list_issue_comments.ts b/apps/sim/tools/github/list_issue_comments.ts index c14a8fcb0a..01a7697833 100644 --- a/apps/sim/tools/github/list_issue_comments.ts +++ b/apps/sim/tools/github/list_issue_comments.ts @@ -138,3 +138,42 @@ export const listIssueCommentsTool: ToolConfig = { + id: 'github_list_issue_comments_v2', + name: listIssueCommentsTool.name, + description: listIssueCommentsTool.description, + version: '2.0.0', + params: listIssueCommentsTool.params, + request: listIssueCommentsTool.request, + + transformResponse: async (response: Response) => { + const comments = await response.json() + return { + success: true, + output: { + items: comments, + count: comments.length, + }, + } + }, + + outputs: { + items: { + type: 'array', + description: 'Array of comment objects', + items: { + type: 'object', + properties: { + id: { type: 'number', description: 'Comment ID' }, + body: { type: 'string', description: 'Comment body' }, + user: { type: 'object', description: 'User who created the comment' }, + html_url: { type: 'string', description: 'GitHub web URL' }, + created_at: { type: 'string', description: 'Creation timestamp' }, + updated_at: { type: 'string', description: 'Last update timestamp' }, + }, + }, + }, + count: { type: 'number', description: 'Number of comments returned' }, + }, +} diff --git a/apps/sim/tools/github/list_issues.ts b/apps/sim/tools/github/list_issues.ts index a962545e16..e086bc8757 100644 --- a/apps/sim/tools/github/list_issues.ts +++ b/apps/sim/tools/github/list_issues.ts @@ -167,3 +167,49 @@ ${transformedIssues }, }, } + +export const listIssuesV2Tool: ToolConfig = { + id: 'github_list_issues_v2', + name: listIssuesTool.name, + description: listIssuesTool.description, + version: '2.0.0', + params: listIssuesTool.params, + request: listIssuesTool.request, + + transformResponse: async (response: Response) => { + const issues = await response.json() + return { + success: true, + output: { + items: issues, + count: issues.length, + }, + } + }, + + outputs: { + items: { + type: 'array', + description: 'Array of issue objects from GitHub API', + items: { + type: 'object', + properties: { + id: { type: 'number', description: 'Issue ID' }, + number: { type: 'number', description: 'Issue number' }, + title: { type: 'string', description: 'Issue title' }, + state: { type: 'string', description: 'Issue state (open/closed)' }, + html_url: { type: 'string', description: 'GitHub web URL' }, + body: { type: 'string', description: 'Issue body' }, + user: { type: 'object', description: 'User who created the issue' }, + labels: { type: 'array', description: 'Array of label objects' }, + assignees: { type: 'array', description: 'Array of assignee objects' }, + milestone: { type: 'object', description: 'Milestone object' }, + created_at: { type: 'string', description: 'Creation timestamp' }, + updated_at: { type: 'string', description: 'Last update timestamp' }, + closed_at: { type: 'string', description: 'Close timestamp' }, + }, + }, + }, + count: { type: 'number', description: 'Number of issues returned' }, + }, +} diff --git a/apps/sim/tools/github/list_pr_comments.ts b/apps/sim/tools/github/list_pr_comments.ts index 0d0808021b..cf98539cd7 100644 --- a/apps/sim/tools/github/list_pr_comments.ts +++ b/apps/sim/tools/github/list_pr_comments.ts @@ -154,3 +154,45 @@ export const listPRCommentsTool: ToolConfig = { + id: 'github_list_pr_comments_v2', + name: listPRCommentsTool.name, + description: listPRCommentsTool.description, + version: '2.0.0', + params: listPRCommentsTool.params, + request: listPRCommentsTool.request, + + transformResponse: async (response: Response) => { + const comments = await response.json() + return { + success: true, + output: { + items: comments, + count: comments.length, + }, + } + }, + + outputs: { + items: { + type: 'array', + description: 'Array of review comment objects', + items: { + type: 'object', + properties: { + id: { type: 'number', description: 'Comment ID' }, + body: { type: 'string', description: 'Comment body' }, + path: { type: 'string', description: 'File path' }, + line: { type: 'number', description: 'Line number' }, + user: { type: 'object', description: 'User who created the comment' }, + html_url: { type: 'string', description: 'GitHub web URL' }, + diff_hunk: { type: 'string', description: 'Diff context' }, + created_at: { type: 'string', description: 'Creation timestamp' }, + updated_at: { type: 'string', description: 'Last update timestamp' }, + }, + }, + }, + count: { type: 'number', description: 'Number of comments returned' }, + }, +} diff --git a/apps/sim/tools/github/list_projects.ts b/apps/sim/tools/github/list_projects.ts index 9f25bc362e..8b0b4d882a 100644 --- a/apps/sim/tools/github/list_projects.ts +++ b/apps/sim/tools/github/list_projects.ts @@ -163,3 +163,63 @@ export const listProjectsTool: ToolConfig = { + id: 'github_list_projects_v2', + name: listProjectsTool.name, + description: listProjectsTool.description, + version: '2.0.0', + params: listProjectsTool.params, + request: listProjectsTool.request, + + transformResponse: async (response: Response) => { + const data = await response.json() + + if (data.errors) { + return { + success: false, + output: { items: [], totalCount: 0 }, + error: data.errors[0].message, + } + } + + const ownerData = data.data?.organization || data.data?.user + const projectsData = ownerData?.projectsV2 + + if (!projectsData) { + return { + success: false, + output: { items: [], totalCount: 0 }, + error: 'No projects data found', + } + } + + return { + success: true, + output: { + items: projectsData.nodes, + totalCount: projectsData.totalCount, + }, + } + }, + + outputs: { + items: { + type: 'array', + description: 'Array of project objects', + items: { + type: 'object', + properties: { + id: { type: 'string', description: 'Project node ID' }, + title: { type: 'string', description: 'Project title' }, + number: { type: 'number', description: 'Project number' }, + url: { type: 'string', description: 'Project URL' }, + closed: { type: 'boolean', description: 'Whether project is closed' }, + public: { type: 'boolean', description: 'Whether project is public' }, + shortDescription: { type: 'string', description: 'Short description' }, + }, + }, + }, + totalCount: { type: 'number', description: 'Total number of projects' }, + }, +} diff --git a/apps/sim/tools/github/list_prs.ts b/apps/sim/tools/github/list_prs.ts index 32000673fa..64139c4874 100644 --- a/apps/sim/tools/github/list_prs.ts +++ b/apps/sim/tools/github/list_prs.ts @@ -151,3 +151,46 @@ ${prs }, }, } + +export const listPRsV2Tool: ToolConfig = { + id: 'github_list_prs_v2', + name: listPRsTool.name, + description: listPRsTool.description, + version: '2.0.0', + params: listPRsTool.params, + request: listPRsTool.request, + + transformResponse: async (response: Response) => { + const prs = await response.json() + return { + success: true, + output: { + items: prs, + count: prs.length, + }, + } + }, + + outputs: { + items: { + type: 'array', + description: 'Array of pull request objects', + items: { + type: 'object', + properties: { + id: { type: 'number', description: 'PR ID' }, + number: { type: 'number', description: 'PR number' }, + title: { type: 'string', description: 'PR title' }, + state: { type: 'string', description: 'PR state' }, + html_url: { type: 'string', description: 'GitHub web URL' }, + user: { type: 'object', description: 'Author object' }, + head: { type: 'object', description: 'Head branch info' }, + base: { type: 'object', description: 'Base branch info' }, + created_at: { type: 'string', description: 'Creation timestamp' }, + updated_at: { type: 'string', description: 'Last update timestamp' }, + }, + }, + }, + count: { type: 'number', description: 'Number of PRs returned' }, + }, +} diff --git a/apps/sim/tools/github/list_releases.ts b/apps/sim/tools/github/list_releases.ts index e1048cf0b7..f21dfd3f3c 100644 --- a/apps/sim/tools/github/list_releases.ts +++ b/apps/sim/tools/github/list_releases.ts @@ -135,3 +135,48 @@ Summary of tags: ${releases.map((r: any) => r.tag_name).join(', ')}` }, }, } + +export const listReleasesV2Tool: ToolConfig = { + id: 'github_list_releases_v2', + name: listReleasesTool.name, + description: listReleasesTool.description, + version: '2.0.0', + params: listReleasesTool.params, + request: listReleasesTool.request, + + transformResponse: async (response: Response) => { + const releases = await response.json() + return { + success: true, + output: { + items: releases, + count: releases.length, + }, + } + }, + + outputs: { + items: { + type: 'array', + description: 'Array of release objects', + items: { + type: 'object', + properties: { + id: { type: 'number', description: 'Release ID' }, + tag_name: { type: 'string', description: 'Git tag name' }, + name: { type: 'string', description: 'Release name' }, + html_url: { type: 'string', description: 'GitHub web URL' }, + tarball_url: { type: 'string', description: 'Tarball download URL' }, + zipball_url: { type: 'string', description: 'Zipball download URL' }, + draft: { type: 'boolean', description: 'Whether this is a draft' }, + prerelease: { type: 'boolean', description: 'Whether this is a prerelease' }, + author: { type: 'object', description: 'Release author' }, + assets: { type: 'array', description: 'Release assets' }, + created_at: { type: 'string', description: 'Creation timestamp' }, + published_at: { type: 'string', description: 'Publication timestamp' }, + }, + }, + }, + count: { type: 'number', description: 'Number of releases returned' }, + }, +} diff --git a/apps/sim/tools/github/list_workflow_runs.ts b/apps/sim/tools/github/list_workflow_runs.ts index 94abda4087..0910d4d205 100644 --- a/apps/sim/tools/github/list_workflow_runs.ts +++ b/apps/sim/tools/github/list_workflow_runs.ts @@ -184,3 +184,47 @@ ${data.workflow_runs }, }, } + +export const listWorkflowRunsV2Tool: ToolConfig = { + id: 'github_list_workflow_runs_v2', + name: listWorkflowRunsTool.name, + description: listWorkflowRunsTool.description, + version: '2.0.0', + params: listWorkflowRunsTool.params, + request: listWorkflowRunsTool.request, + + transformResponse: async (response: Response) => { + const data = await response.json() + return { + success: true, + output: { + total_count: data.total_count, + items: data.workflow_runs, + }, + } + }, + + outputs: { + total_count: { type: 'number', description: 'Total number of workflow runs' }, + items: { + type: 'array', + description: 'Array of workflow run objects', + items: { + type: 'object', + properties: { + id: { type: 'number', description: 'Workflow run ID' }, + name: { type: 'string', description: 'Workflow name' }, + head_branch: { type: 'string', description: 'Branch name' }, + head_sha: { type: 'string', description: 'Commit SHA' }, + run_number: { type: 'number', description: 'Run number' }, + event: { type: 'string', description: 'Trigger event' }, + status: { type: 'string', description: 'Run status' }, + conclusion: { type: 'string', description: 'Run conclusion' }, + html_url: { type: 'string', description: 'GitHub web URL' }, + created_at: { type: 'string', description: 'Creation timestamp' }, + updated_at: { type: 'string', description: 'Last update timestamp' }, + }, + }, + }, + }, +} diff --git a/apps/sim/tools/github/list_workflows.ts b/apps/sim/tools/github/list_workflows.ts index 2c6938b4fb..ec495425d8 100644 --- a/apps/sim/tools/github/list_workflows.ts +++ b/apps/sim/tools/github/list_workflows.ts @@ -133,3 +133,45 @@ ${data.workflows }, }, } + +export const listWorkflowsV2Tool: ToolConfig = { + id: 'github_list_workflows_v2', + name: listWorkflowsTool.name, + description: listWorkflowsTool.description, + version: '2.0.0', + params: listWorkflowsTool.params, + request: listWorkflowsTool.request, + + transformResponse: async (response: Response) => { + const data = await response.json() + return { + success: true, + output: { + total_count: data.total_count, + items: data.workflows, + }, + } + }, + + outputs: { + total_count: { type: 'number', description: 'Total number of workflows' }, + items: { + type: 'array', + description: 'Array of workflow objects', + items: { + type: 'object', + properties: { + id: { type: 'number', description: 'Workflow ID' }, + node_id: { type: 'string', description: 'Workflow node ID' }, + name: { type: 'string', description: 'Workflow name' }, + path: { type: 'string', description: 'Path to workflow file' }, + state: { type: 'string', description: 'Workflow state' }, + html_url: { type: 'string', description: 'GitHub web URL' }, + badge_url: { type: 'string', description: 'Badge URL' }, + created_at: { type: 'string', description: 'Creation timestamp' }, + updated_at: { type: 'string', description: 'Last update timestamp' }, + }, + }, + }, + }, +} diff --git a/apps/sim/tools/github/merge_pr.ts b/apps/sim/tools/github/merge_pr.ts index 619c1169d0..e497f93dd3 100644 --- a/apps/sim/tools/github/merge_pr.ts +++ b/apps/sim/tools/github/merge_pr.ts @@ -120,3 +120,30 @@ Message: ${result.message}` }, }, } + +export const mergePRV2Tool: ToolConfig = { + id: 'github_merge_pr_v2', + name: mergePRTool.name, + description: mergePRTool.description, + version: '2.0.0', + params: mergePRTool.params, + request: mergePRTool.request, + + transformResponse: async (response: Response) => { + const result = await response.json() + return { + success: true, + output: { + sha: result.sha, + merged: result.merged, + message: result.message, + }, + } + }, + + outputs: { + sha: { type: 'string', description: 'Merge commit SHA' }, + merged: { type: 'boolean', description: 'Whether merge was successful' }, + message: { type: 'string', description: 'Response message' }, + }, +} diff --git a/apps/sim/tools/github/pr.ts b/apps/sim/tools/github/pr.ts index c83f982384..1edfd2786f 100644 --- a/apps/sim/tools/github/pr.ts +++ b/apps/sim/tools/github/pr.ts @@ -121,3 +121,79 @@ URL: ${pr.html_url}` }, }, } + +export const prV2Tool: ToolConfig = { + id: 'github_pr_v2', + name: prTool.name, + description: prTool.description, + version: '2.0.0', + params: prTool.params, + request: prTool.request, + + transformResponse: async (response: Response) => { + const pr = await response.json() + + // Fetch files changed + const filesResponse = await fetch( + `https://api.github.com/repos/${pr.base.repo.owner.login}/${pr.base.repo.name}/pulls/${pr.number}/files` + ) + const files = await filesResponse.json() + + return { + success: true, + output: { + id: pr.id, + number: pr.number, + title: pr.title, + state: pr.state, + html_url: pr.html_url, + diff_url: pr.diff_url, + body: pr.body, + user: pr.user, + head: pr.head, + base: pr.base, + merged: pr.merged, + mergeable: pr.mergeable, + merged_by: pr.merged_by, + comments: pr.comments, + review_comments: pr.review_comments, + commits: pr.commits, + additions: pr.additions, + deletions: pr.deletions, + changed_files: pr.changed_files, + created_at: pr.created_at, + updated_at: pr.updated_at, + closed_at: pr.closed_at, + merged_at: pr.merged_at, + files: files, + }, + } + }, + + outputs: { + id: { type: 'number', description: 'Pull request ID' }, + number: { type: 'number', description: 'Pull request number' }, + title: { type: 'string', description: 'PR title' }, + state: { type: 'string', description: 'PR state (open/closed)' }, + html_url: { type: 'string', description: 'GitHub web URL' }, + diff_url: { type: 'string', description: 'Raw diff URL' }, + body: { type: 'string', description: 'PR description' }, + user: { type: 'json', description: 'User who created the PR' }, + head: { type: 'json', description: 'Head branch info' }, + base: { type: 'json', description: 'Base branch info' }, + merged: { type: 'boolean', description: 'Whether PR is merged' }, + mergeable: { type: 'boolean', description: 'Whether PR is mergeable' }, + merged_by: { type: 'json', description: 'User who merged the PR' }, + comments: { type: 'number', description: 'Number of comments' }, + review_comments: { type: 'number', description: 'Number of review comments' }, + commits: { type: 'number', description: 'Number of commits' }, + additions: { type: 'number', description: 'Lines added' }, + deletions: { type: 'number', description: 'Lines deleted' }, + changed_files: { type: 'number', description: 'Number of changed files' }, + created_at: { type: 'string', description: 'Creation timestamp' }, + updated_at: { type: 'string', description: 'Last update timestamp' }, + closed_at: { type: 'string', description: 'Close timestamp' }, + merged_at: { type: 'string', description: 'Merge timestamp' }, + files: { type: 'array', description: 'Array of changed file objects' }, + }, +} diff --git a/apps/sim/tools/github/remove_label.ts b/apps/sim/tools/github/remove_label.ts index e708060107..19c5193381 100644 --- a/apps/sim/tools/github/remove_label.ts +++ b/apps/sim/tools/github/remove_label.ts @@ -100,3 +100,24 @@ ${labels.length > 0 ? `Remaining labels: ${labels.join(', ')}` : 'No labels rema }, }, } + +export const removeLabelV2Tool: ToolConfig = { + id: 'github_remove_label_v2', + name: removeLabelTool.name, + description: removeLabelTool.description, + version: '2.0.0', + params: removeLabelTool.params, + request: removeLabelTool.request, + oauth: removeLabelTool.oauth, + transformResponse: async (response: Response) => { + if (response.status === 200) { + const labels = await response.json() + return { success: true, output: { items: labels, count: labels.length } } + } + return { success: true, output: { items: [], count: 0 } } + }, + outputs: { + items: { type: 'array', description: 'Remaining labels on the issue' }, + count: { type: 'number', description: 'Number of remaining labels' }, + }, +} diff --git a/apps/sim/tools/github/repo_info.ts b/apps/sim/tools/github/repo_info.ts index 78dc0dcbdd..387e0ba176 100644 --- a/apps/sim/tools/github/repo_info.ts +++ b/apps/sim/tools/github/repo_info.ts @@ -82,3 +82,70 @@ URL: ${data.html_url}` }, }, } + +export const repoInfoV2Tool: ToolConfig = { + id: 'github_repo_info_v2', + name: repoInfoTool.name, + description: repoInfoTool.description, + version: '2.0.0', + params: repoInfoTool.params, + request: repoInfoTool.request, + + transformResponse: async (response: Response) => { + const data = await response.json() + return { + success: true, + output: { + id: data.id, + name: data.name, + full_name: data.full_name, + description: data.description, + html_url: data.html_url, + homepage: data.homepage, + language: data.language, + default_branch: data.default_branch, + visibility: data.visibility, + private: data.private, + fork: data.fork, + archived: data.archived, + disabled: data.disabled, + stargazers_count: data.stargazers_count, + watchers_count: data.watchers_count, + forks_count: data.forks_count, + open_issues_count: data.open_issues_count, + topics: data.topics, + created_at: data.created_at, + updated_at: data.updated_at, + pushed_at: data.pushed_at, + owner: data.owner, + license: data.license, + }, + } + }, + + outputs: { + id: { type: 'number', description: 'Repository ID' }, + name: { type: 'string', description: 'Repository name' }, + full_name: { type: 'string', description: 'Full repository name (owner/repo)' }, + description: { type: 'string', description: 'Repository description' }, + html_url: { type: 'string', description: 'GitHub web URL' }, + homepage: { type: 'string', description: 'Homepage URL' }, + language: { type: 'string', description: 'Primary programming language' }, + default_branch: { type: 'string', description: 'Default branch name' }, + visibility: { type: 'string', description: 'Repository visibility (public/private)' }, + private: { type: 'boolean', description: 'Whether the repository is private' }, + fork: { type: 'boolean', description: 'Whether this is a fork' }, + archived: { type: 'boolean', description: 'Whether the repository is archived' }, + disabled: { type: 'boolean', description: 'Whether the repository is disabled' }, + stargazers_count: { type: 'number', description: 'Number of stars' }, + watchers_count: { type: 'number', description: 'Number of watchers' }, + forks_count: { type: 'number', description: 'Number of forks' }, + open_issues_count: { type: 'number', description: 'Number of open issues' }, + topics: { type: 'array', description: 'Repository topics' }, + created_at: { type: 'string', description: 'Creation timestamp' }, + updated_at: { type: 'string', description: 'Last update timestamp' }, + pushed_at: { type: 'string', description: 'Last push timestamp' }, + owner: { type: 'json', description: 'Repository owner object' }, + license: { type: 'json', description: 'License information' }, + }, +} diff --git a/apps/sim/tools/github/request_reviewers.ts b/apps/sim/tools/github/request_reviewers.ts index 71fcd5b9fb..33374103fa 100644 --- a/apps/sim/tools/github/request_reviewers.ts +++ b/apps/sim/tools/github/request_reviewers.ts @@ -145,3 +145,35 @@ Team Reviewers: ${teamsList}` }, }, } + +export const requestReviewersV2Tool: ToolConfig = { + id: 'github_request_reviewers_v2', + name: requestReviewersTool.name, + description: requestReviewersTool.description, + version: '2.0.0', + params: requestReviewersTool.params, + request: requestReviewersTool.request, + oauth: requestReviewersTool.oauth, + transformResponse: async (response: Response) => { + const pr = await response.json() + return { + success: true, + output: { + id: pr.id, + number: pr.number, + title: pr.title, + html_url: pr.html_url, + requested_reviewers: pr.requested_reviewers, + requested_teams: pr.requested_teams, + }, + } + }, + outputs: { + id: { type: 'number', description: 'PR ID' }, + number: { type: 'number', description: 'PR number' }, + title: { type: 'string', description: 'PR title' }, + html_url: { type: 'string', description: 'GitHub web URL' }, + requested_reviewers: { type: 'array', description: 'Array of requested reviewer objects' }, + requested_teams: { type: 'array', description: 'Array of requested team objects' }, + }, +} diff --git a/apps/sim/tools/github/rerun_workflow.ts b/apps/sim/tools/github/rerun_workflow.ts index 42f6baad07..1ed79dadeb 100644 --- a/apps/sim/tools/github/rerun_workflow.ts +++ b/apps/sim/tools/github/rerun_workflow.ts @@ -100,3 +100,26 @@ The rerun should start shortly.` }, }, } + +export const rerunWorkflowV2Tool: ToolConfig = { + id: 'github_rerun_workflow_v2', + name: rerunWorkflowTool.name, + description: rerunWorkflowTool.description, + version: '2.0.0', + params: rerunWorkflowTool.params, + request: rerunWorkflowTool.request, + oauth: rerunWorkflowTool.oauth, + transformResponse: async (response: Response, params) => { + return { + success: true, + output: { + rerun_requested: response.status === 201, + run_id: params?.run_id || 0, + }, + } + }, + outputs: { + rerun_requested: { type: 'boolean', description: 'Whether rerun was requested' }, + run_id: { type: 'number', description: 'Workflow run ID' }, + }, +} diff --git a/apps/sim/tools/github/trigger_workflow.ts b/apps/sim/tools/github/trigger_workflow.ts index c440c9ced5..c3d728d1bd 100644 --- a/apps/sim/tools/github/trigger_workflow.ts +++ b/apps/sim/tools/github/trigger_workflow.ts @@ -83,3 +83,24 @@ The workflow run should start shortly.` }, }, } + +export const triggerWorkflowV2Tool: ToolConfig = { + id: 'github_trigger_workflow_v2', + name: triggerWorkflowTool.name, + description: triggerWorkflowTool.description, + version: '2.0.0', + params: triggerWorkflowTool.params, + request: triggerWorkflowTool.request, + oauth: triggerWorkflowTool.oauth, + transformResponse: async (response: Response) => { + return { + success: true, + output: { + triggered: response.status === 204, + }, + } + }, + outputs: { + triggered: { type: 'boolean', description: 'Whether workflow was triggered' }, + }, +} diff --git a/apps/sim/tools/github/update_branch_protection.ts b/apps/sim/tools/github/update_branch_protection.ts index c49b277511..d368254db4 100644 --- a/apps/sim/tools/github/update_branch_protection.ts +++ b/apps/sim/tools/github/update_branch_protection.ts @@ -219,3 +219,39 @@ Enforce Admins: ${protection.enforce_admins?.enabled ? 'Yes' : 'No'}` }, }, } + +export const updateBranchProtectionV2Tool: ToolConfig = { + id: 'github_update_branch_protection_v2', + name: updateBranchProtectionTool.name, + description: updateBranchProtectionTool.description, + version: '2.0.0', + params: updateBranchProtectionTool.params, + request: updateBranchProtectionTool.request, + oauth: updateBranchProtectionTool.oauth, + transformResponse: async (response: Response) => { + const protection = await response.json() + return { + success: true, + output: { + url: protection.url, + required_status_checks: protection.required_status_checks, + enforce_admins: protection.enforce_admins, + required_pull_request_reviews: protection.required_pull_request_reviews, + restrictions: protection.restrictions, + required_linear_history: protection.required_linear_history, + allow_force_pushes: protection.allow_force_pushes, + allow_deletions: protection.allow_deletions, + }, + } + }, + outputs: { + url: { type: 'string', description: 'Protection URL' }, + required_status_checks: { type: 'json', description: 'Status check requirements' }, + enforce_admins: { type: 'json', description: 'Admin enforcement settings' }, + required_pull_request_reviews: { type: 'json', description: 'PR review requirements' }, + restrictions: { type: 'json', description: 'Push restrictions' }, + required_linear_history: { type: 'json', description: 'Linear history requirement' }, + allow_force_pushes: { type: 'json', description: 'Force push settings' }, + allow_deletions: { type: 'json', description: 'Deletion settings' }, + }, +} diff --git a/apps/sim/tools/github/update_comment.ts b/apps/sim/tools/github/update_comment.ts index 75116b8d68..da1eb8fc86 100644 --- a/apps/sim/tools/github/update_comment.ts +++ b/apps/sim/tools/github/update_comment.ts @@ -101,3 +101,35 @@ export const updateCommentTool: ToolConfig { + const comment = await response.json() + return { + success: true, + output: { + id: comment.id, + body: comment.body, + html_url: comment.html_url, + user: comment.user, + created_at: comment.created_at, + updated_at: comment.updated_at, + }, + } + }, + outputs: { + id: { type: 'number', description: 'Comment ID' }, + body: { type: 'string', description: 'Comment body' }, + html_url: { type: 'string', description: 'GitHub web URL' }, + user: { type: 'json', description: 'User who updated the comment' }, + created_at: { type: 'string', description: 'Creation timestamp' }, + updated_at: { type: 'string', description: 'Last update timestamp' }, + }, +} diff --git a/apps/sim/tools/github/update_file.ts b/apps/sim/tools/github/update_file.ts index 4d4d6fde2f..470e1f571b 100644 --- a/apps/sim/tools/github/update_file.ts +++ b/apps/sim/tools/github/update_file.ts @@ -177,3 +177,27 @@ View file: ${data.content.html_url}` }, }, } + +export const updateFileV2Tool: ToolConfig = { + id: 'github_update_file_v2', + name: updateFileTool.name, + description: updateFileTool.description, + version: '2.0.0', + params: updateFileTool.params, + request: updateFileTool.request, + oauth: updateFileTool.oauth, + transformResponse: async (response: Response) => { + const data = await response.json() + return { + success: true, + output: { + content: data.content, + commit: data.commit, + }, + } + }, + outputs: { + content: { type: 'json', description: 'Updated file content info' }, + commit: { type: 'json', description: 'Commit information' }, + }, +} diff --git a/apps/sim/tools/github/update_issue.ts b/apps/sim/tools/github/update_issue.ts index 0beb675051..f34eead5ba 100644 --- a/apps/sim/tools/github/update_issue.ts +++ b/apps/sim/tools/github/update_issue.ts @@ -137,3 +137,49 @@ ${assignees.length > 0 ? `Assignees: ${assignees.join(', ')}` : ''}` }, }, } + +export const updateIssueV2Tool: ToolConfig = { + id: 'github_update_issue_v2', + name: updateIssueTool.name, + description: updateIssueTool.description, + version: '2.0.0', + params: updateIssueTool.params, + request: updateIssueTool.request, + oauth: updateIssueTool.oauth, + transformResponse: async (response: Response) => { + const issue = await response.json() + return { + success: true, + output: { + id: issue.id, + number: issue.number, + title: issue.title, + state: issue.state, + html_url: issue.html_url, + body: issue.body, + user: issue.user, + labels: issue.labels, + assignees: issue.assignees, + milestone: issue.milestone, + created_at: issue.created_at, + updated_at: issue.updated_at, + closed_at: issue.closed_at, + }, + } + }, + outputs: { + id: { type: 'number', description: 'Issue ID' }, + number: { type: 'number', description: 'Issue number' }, + title: { type: 'string', description: 'Issue title' }, + state: { type: 'string', description: 'Issue state' }, + html_url: { type: 'string', description: 'GitHub web URL' }, + body: { type: 'string', description: 'Issue body' }, + user: { type: 'json', description: 'User who created the issue' }, + labels: { type: 'array', description: 'Array of label objects' }, + assignees: { type: 'array', description: 'Array of assignee objects' }, + milestone: { type: 'json', description: 'Milestone object' }, + created_at: { type: 'string', description: 'Creation timestamp' }, + updated_at: { type: 'string', description: 'Last update timestamp' }, + closed_at: { type: 'string', description: 'Close timestamp' }, + }, +} diff --git a/apps/sim/tools/github/update_pr.ts b/apps/sim/tools/github/update_pr.ts index 85e302bb19..6824c31d3e 100644 --- a/apps/sim/tools/github/update_pr.ts +++ b/apps/sim/tools/github/update_pr.ts @@ -119,3 +119,49 @@ URL: ${pr.html_url}` }, }, } + +export const updatePRV2Tool: ToolConfig = { + id: 'github_update_pr_v2', + name: updatePRTool.name, + description: updatePRTool.description, + version: '2.0.0', + params: updatePRTool.params, + request: updatePRTool.request, + oauth: updatePRTool.oauth, + transformResponse: async (response: Response) => { + const pr = await response.json() + return { + success: true, + output: { + id: pr.id, + number: pr.number, + title: pr.title, + state: pr.state, + html_url: pr.html_url, + body: pr.body, + user: pr.user, + head: pr.head, + base: pr.base, + draft: pr.draft, + merged: pr.merged, + created_at: pr.created_at, + updated_at: pr.updated_at, + }, + } + }, + outputs: { + id: { type: 'number', description: 'PR ID' }, + number: { type: 'number', description: 'PR number' }, + title: { type: 'string', description: 'PR title' }, + state: { type: 'string', description: 'PR state' }, + html_url: { type: 'string', description: 'GitHub web URL' }, + body: { type: 'string', description: 'PR description' }, + user: { type: 'json', description: 'User who created the PR' }, + head: { type: 'json', description: 'Head branch info' }, + base: { type: 'json', description: 'Base branch info' }, + draft: { type: 'boolean', description: 'Whether PR is a draft' }, + merged: { type: 'boolean', description: 'Whether PR is merged' }, + created_at: { type: 'string', description: 'Creation timestamp' }, + updated_at: { type: 'string', description: 'Last update timestamp' }, + }, +} diff --git a/apps/sim/tools/github/update_project.ts b/apps/sim/tools/github/update_project.ts index 28968a8ca5..6688fe7da2 100644 --- a/apps/sim/tools/github/update_project.ts +++ b/apps/sim/tools/github/update_project.ts @@ -190,3 +190,45 @@ export const updateProjectTool: ToolConfig }, }, } + +export const updateProjectV2Tool: ToolConfig = { + id: 'github_update_project_v2', + name: updateProjectTool.name, + description: updateProjectTool.description, + version: '2.0.0', + params: updateProjectTool.params, + request: updateProjectTool.request, + oauth: updateProjectTool.oauth, + transformResponse: async (response: Response) => { + const data = await response.json() + if (data.errors) { + return { + success: false, + output: { id: '', title: '', number: 0, url: '' }, + error: data.errors[0].message, + } + } + const project = data.data?.updateProjectV2?.projectV2 || {} + return { + success: true, + output: { + id: project.id, + title: project.title, + number: project.number, + url: project.url, + closed: project.closed, + public: project.public, + shortDescription: project.shortDescription, + }, + } + }, + outputs: { + id: { type: 'string', description: 'Project node ID' }, + title: { type: 'string', description: 'Project title' }, + number: { type: 'number', description: 'Project number' }, + url: { type: 'string', description: 'Project URL' }, + closed: { type: 'boolean', description: 'Whether project is closed' }, + public: { type: 'boolean', description: 'Whether project is public' }, + shortDescription: { type: 'string', description: 'Short description' }, + }, +} diff --git a/apps/sim/tools/github/update_release.ts b/apps/sim/tools/github/update_release.ts index 4e233cf5a2..c1bd4d2b07 100644 --- a/apps/sim/tools/github/update_release.ts +++ b/apps/sim/tools/github/update_release.ts @@ -159,3 +159,45 @@ Download URLs: }, }, } + +export const updateReleaseV2Tool: ToolConfig = { + id: 'github_update_release_v2', + name: updateReleaseTool.name, + description: updateReleaseTool.description, + version: '2.0.0', + params: updateReleaseTool.params, + request: updateReleaseTool.request, + oauth: updateReleaseTool.oauth, + transformResponse: async (response: Response) => { + const data = await response.json() + return { + success: true, + output: { + id: data.id, + tag_name: data.tag_name, + name: data.name, + body: data.body, + html_url: data.html_url, + tarball_url: data.tarball_url, + zipball_url: data.zipball_url, + draft: data.draft, + prerelease: data.prerelease, + created_at: data.created_at, + published_at: data.published_at, + }, + } + }, + outputs: { + id: { type: 'number', description: 'Release ID' }, + tag_name: { type: 'string', description: 'Git tag name' }, + name: { type: 'string', description: 'Release name' }, + body: { type: 'string', description: 'Release description' }, + html_url: { type: 'string', description: 'GitHub web URL' }, + tarball_url: { type: 'string', description: 'Tarball download URL' }, + zipball_url: { type: 'string', description: 'Zipball download URL' }, + draft: { type: 'boolean', description: 'Whether this is a draft' }, + prerelease: { type: 'boolean', description: 'Whether this is a prerelease' }, + created_at: { type: 'string', description: 'Creation timestamp' }, + published_at: { type: 'string', description: 'Publication timestamp' }, + }, +} diff --git a/apps/sim/tools/gmail/add_label.ts b/apps/sim/tools/gmail/add_label.ts index cf270927b5..5a1de527d3 100644 --- a/apps/sim/tools/gmail/add_label.ts +++ b/apps/sim/tools/gmail/add_label.ts @@ -82,3 +82,36 @@ export const gmailAddLabelTool: ToolConfig }, }, } + +interface GmailModifyV2Response { + success: boolean + output: { + id?: string + threadId?: string + labelIds?: string[] + } +} + +export const gmailAddLabelV2Tool: ToolConfig = { + id: 'gmail_add_label_v2', + name: 'Gmail Add Label', + description: 'Add label(s) to a Gmail message. Returns API-aligned fields only.', + version: '2.0.0', + oauth: gmailAddLabelTool.oauth, + params: gmailAddLabelTool.params, + request: gmailAddLabelTool.request, + transformResponse: async (response) => { + const legacy = await gmailAddLabelTool.transformResponse!(response) + if (!legacy.success) return { success: false, output: {}, error: legacy.error } + const metadata = legacy.output.metadata as any + return { + success: true, + output: { id: metadata?.id, threadId: metadata?.threadId, labelIds: metadata?.labelIds }, + } + }, + outputs: { + id: { type: 'string', description: 'Gmail message ID' }, + threadId: { type: 'string', description: 'Gmail thread ID' }, + labelIds: { type: 'array', items: { type: 'string' }, description: 'Updated email labels' }, + }, +} diff --git a/apps/sim/tools/gmail/archive.ts b/apps/sim/tools/gmail/archive.ts index 9e495c865b..0b95adb2e7 100644 --- a/apps/sim/tools/gmail/archive.ts +++ b/apps/sim/tools/gmail/archive.ts @@ -75,3 +75,36 @@ export const gmailArchiveTool: ToolConfig = { + id: 'gmail_archive_v2', + name: 'Gmail Archive', + description: 'Archive a Gmail message (remove from inbox). Returns API-aligned fields only.', + version: '2.0.0', + oauth: gmailArchiveTool.oauth, + params: gmailArchiveTool.params, + request: gmailArchiveTool.request, + transformResponse: async (response) => { + const legacy = await gmailArchiveTool.transformResponse!(response) + if (!legacy.success) return { success: false, output: {}, error: legacy.error } + const metadata = legacy.output.metadata as any + return { + success: true, + output: { id: metadata?.id, threadId: metadata?.threadId, labelIds: metadata?.labelIds }, + } + }, + outputs: { + id: { type: 'string', description: 'Gmail message ID' }, + threadId: { type: 'string', description: 'Gmail thread ID' }, + labelIds: { type: 'array', items: { type: 'string' }, description: 'Updated email labels' }, + }, +} diff --git a/apps/sim/tools/gmail/delete.ts b/apps/sim/tools/gmail/delete.ts index dbb1913b7e..4b992e5a33 100644 --- a/apps/sim/tools/gmail/delete.ts +++ b/apps/sim/tools/gmail/delete.ts @@ -75,3 +75,36 @@ export const gmailDeleteTool: ToolConfig }, }, } + +interface GmailModifyV2Response { + success: boolean + output: { + id?: string + threadId?: string + labelIds?: string[] + } +} + +export const gmailDeleteV2Tool: ToolConfig = { + id: 'gmail_delete_v2', + name: 'Gmail Delete', + description: 'Delete a Gmail message (move to trash). Returns API-aligned fields only.', + version: '2.0.0', + oauth: gmailDeleteTool.oauth, + params: gmailDeleteTool.params, + request: gmailDeleteTool.request, + transformResponse: async (response) => { + const legacy = await gmailDeleteTool.transformResponse!(response) + if (!legacy.success) return { success: false, output: {}, error: legacy.error } + const metadata = legacy.output.metadata as any + return { + success: true, + output: { id: metadata?.id, threadId: metadata?.threadId, labelIds: metadata?.labelIds }, + } + }, + outputs: { + id: { type: 'string', description: 'Gmail message ID' }, + threadId: { type: 'string', description: 'Gmail thread ID' }, + labelIds: { type: 'array', items: { type: 'string' }, description: 'Updated email labels' }, + }, +} diff --git a/apps/sim/tools/gmail/draft.ts b/apps/sim/tools/gmail/draft.ts index b7c86f3d2b..bedb976deb 100644 --- a/apps/sim/tools/gmail/draft.ts +++ b/apps/sim/tools/gmail/draft.ts @@ -139,3 +139,43 @@ export const gmailDraftTool: ToolConfig = { }, }, } + +interface GmailDraftV2Response { + success: boolean + output: { + draftId?: string + messageId?: string + threadId?: string + labelIds?: string[] + } +} + +export const gmailDraftV2Tool: ToolConfig = { + id: 'gmail_draft_v2', + name: 'Gmail Draft', + description: 'Draft emails using Gmail. Returns API-aligned fields only.', + version: '2.0.0', + oauth: gmailDraftTool.oauth, + params: gmailDraftTool.params, + request: gmailDraftTool.request, + transformResponse: async (response) => { + const legacy = await gmailDraftTool.transformResponse!(response) + if (!legacy.success) return { success: false, output: {}, error: legacy.error } + const metadata = legacy.output.metadata as any + return { + success: true, + output: { + draftId: metadata?.id, + messageId: metadata?.message?.id, + threadId: metadata?.message?.threadId, + labelIds: metadata?.message?.labelIds, + }, + } + }, + outputs: { + draftId: { type: 'string', description: 'Draft ID' }, + messageId: { type: 'string', description: 'Gmail message ID for the draft' }, + threadId: { type: 'string', description: 'Gmail thread ID' }, + labelIds: { type: 'array', items: { type: 'string' }, description: 'Email labels' }, + }, +} diff --git a/apps/sim/tools/gmail/index.ts b/apps/sim/tools/gmail/index.ts index 78819b3330..3dfa89e4eb 100644 --- a/apps/sim/tools/gmail/index.ts +++ b/apps/sim/tools/gmail/index.ts @@ -1,27 +1,39 @@ -import { gmailAddLabelTool } from '@/tools/gmail/add_label' -import { gmailArchiveTool } from '@/tools/gmail/archive' -import { gmailDeleteTool } from '@/tools/gmail/delete' -import { gmailDraftTool } from '@/tools/gmail/draft' -import { gmailMarkReadTool } from '@/tools/gmail/mark_read' -import { gmailMarkUnreadTool } from '@/tools/gmail/mark_unread' -import { gmailMoveTool } from '@/tools/gmail/move' -import { gmailReadTool } from '@/tools/gmail/read' -import { gmailRemoveLabelTool } from '@/tools/gmail/remove_label' -import { gmailSearchTool } from '@/tools/gmail/search' -import { gmailSendTool } from '@/tools/gmail/send' -import { gmailUnarchiveTool } from '@/tools/gmail/unarchive' +import { gmailAddLabelTool, gmailAddLabelV2Tool } from '@/tools/gmail/add_label' +import { gmailArchiveTool, gmailArchiveV2Tool } from '@/tools/gmail/archive' +import { gmailDeleteTool, gmailDeleteV2Tool } from '@/tools/gmail/delete' +import { gmailDraftTool, gmailDraftV2Tool } from '@/tools/gmail/draft' +import { gmailMarkReadTool, gmailMarkReadV2Tool } from '@/tools/gmail/mark_read' +import { gmailMarkUnreadTool, gmailMarkUnreadV2Tool } from '@/tools/gmail/mark_unread' +import { gmailMoveTool, gmailMoveV2Tool } from '@/tools/gmail/move' +import { gmailReadTool, gmailReadV2Tool } from '@/tools/gmail/read' +import { gmailRemoveLabelTool, gmailRemoveLabelV2Tool } from '@/tools/gmail/remove_label' +import { gmailSearchTool, gmailSearchV2Tool } from '@/tools/gmail/search' +import { gmailSendTool, gmailSendV2Tool } from '@/tools/gmail/send' +import { gmailUnarchiveTool, gmailUnarchiveV2Tool } from '@/tools/gmail/unarchive' export { gmailSendTool, + gmailSendV2Tool, gmailReadTool, + gmailReadV2Tool, gmailSearchTool, + gmailSearchV2Tool, gmailDraftTool, + gmailDraftV2Tool, gmailMoveTool, + gmailMoveV2Tool, gmailMarkReadTool, + gmailMarkReadV2Tool, gmailMarkUnreadTool, + gmailMarkUnreadV2Tool, gmailArchiveTool, + gmailArchiveV2Tool, gmailUnarchiveTool, + gmailUnarchiveV2Tool, gmailDeleteTool, + gmailDeleteV2Tool, gmailAddLabelTool, + gmailAddLabelV2Tool, gmailRemoveLabelTool, + gmailRemoveLabelV2Tool, } diff --git a/apps/sim/tools/gmail/mark_read.ts b/apps/sim/tools/gmail/mark_read.ts index 8f657f6640..ef2e9015cc 100644 --- a/apps/sim/tools/gmail/mark_read.ts +++ b/apps/sim/tools/gmail/mark_read.ts @@ -75,3 +75,36 @@ export const gmailMarkReadTool: ToolConfig = { + id: 'gmail_mark_read_v2', + name: 'Gmail Mark as Read', + description: 'Mark a Gmail message as read. Returns API-aligned fields only.', + version: '2.0.0', + oauth: gmailMarkReadTool.oauth, + params: gmailMarkReadTool.params, + request: gmailMarkReadTool.request, + transformResponse: async (response) => { + const legacy = await gmailMarkReadTool.transformResponse!(response) + if (!legacy.success) return { success: false, output: {}, error: legacy.error } + const metadata = legacy.output.metadata as any + return { + success: true, + output: { id: metadata?.id, threadId: metadata?.threadId, labelIds: metadata?.labelIds }, + } + }, + outputs: { + id: { type: 'string', description: 'Gmail message ID' }, + threadId: { type: 'string', description: 'Gmail thread ID' }, + labelIds: { type: 'array', items: { type: 'string' }, description: 'Updated email labels' }, + }, +} diff --git a/apps/sim/tools/gmail/mark_unread.ts b/apps/sim/tools/gmail/mark_unread.ts index cf1b07d4bd..8234e8abdb 100644 --- a/apps/sim/tools/gmail/mark_unread.ts +++ b/apps/sim/tools/gmail/mark_unread.ts @@ -75,3 +75,36 @@ export const gmailMarkUnreadTool: ToolConfig = { + id: 'gmail_mark_unread_v2', + name: 'Gmail Mark as Unread', + description: 'Mark a Gmail message as unread. Returns API-aligned fields only.', + version: '2.0.0', + oauth: gmailMarkUnreadTool.oauth, + params: gmailMarkUnreadTool.params, + request: gmailMarkUnreadTool.request, + transformResponse: async (response) => { + const legacy = await gmailMarkUnreadTool.transformResponse!(response) + if (!legacy.success) return { success: false, output: {}, error: legacy.error } + const metadata = legacy.output.metadata as any + return { + success: true, + output: { id: metadata?.id, threadId: metadata?.threadId, labelIds: metadata?.labelIds }, + } + }, + outputs: { + id: { type: 'string', description: 'Gmail message ID' }, + threadId: { type: 'string', description: 'Gmail thread ID' }, + labelIds: { type: 'array', items: { type: 'string' }, description: 'Updated email labels' }, + }, +} diff --git a/apps/sim/tools/gmail/move.ts b/apps/sim/tools/gmail/move.ts index e01edd5caf..2641c62bed 100644 --- a/apps/sim/tools/gmail/move.ts +++ b/apps/sim/tools/gmail/move.ts @@ -89,3 +89,42 @@ export const gmailMoveTool: ToolConfig = { }, }, } + +interface GmailModifyV2Response { + success: boolean + output: { + id?: string + threadId?: string + labelIds?: string[] + } +} + +export const gmailMoveV2Tool: ToolConfig = { + id: 'gmail_move_v2', + name: 'Gmail Move', + description: 'Move emails between labels/folders in Gmail. Returns API-aligned fields only.', + version: '2.0.0', + oauth: gmailMoveTool.oauth, + params: gmailMoveTool.params, + request: gmailMoveTool.request, + transformResponse: async (response: Response, params?: GmailMoveParams) => { + const legacy = await gmailMoveTool.transformResponse!(response, params) + if (!legacy.success) { + return { success: false, output: {}, error: legacy.error } + } + const metadata = legacy.output.metadata as any + return { + success: true, + output: { + id: metadata?.id, + threadId: metadata?.threadId, + labelIds: metadata?.labelIds, + }, + } + }, + outputs: { + id: { type: 'string', description: 'Gmail message ID' }, + threadId: { type: 'string', description: 'Gmail thread ID' }, + labelIds: { type: 'array', items: { type: 'string' }, description: 'Email labels' }, + }, +} diff --git a/apps/sim/tools/gmail/read.ts b/apps/sim/tools/gmail/read.ts index 76ca1af958..eca79e39ce 100644 --- a/apps/sim/tools/gmail/read.ts +++ b/apps/sim/tools/gmail/read.ts @@ -267,3 +267,75 @@ export const gmailReadTool: ToolConfig = { attachments: { type: 'file[]', description: 'Attachments of the email' }, }, } + +interface GmailReadV2Response { + success: boolean + output: { + id?: string + threadId?: string + labelIds?: string[] + from?: string + to?: string + subject?: string + date?: string + body?: string + hasAttachments?: boolean + attachmentCount?: number + attachments?: GmailAttachment[] + results?: Array> + } +} + +export const gmailReadV2Tool: ToolConfig = { + id: 'gmail_read_v2', + name: 'Gmail Read', + description: 'Read emails from Gmail. Returns API-aligned fields only.', + version: '2.0.0', + oauth: gmailReadTool.oauth, + params: gmailReadTool.params, + request: gmailReadTool.request, + transformResponse: async (response: Response, params?: GmailReadParams) => { + const legacy = await gmailReadTool.transformResponse!(response, params) + if (!legacy.success) { + return { + success: false, + output: {}, + error: legacy.error, + } + } + + const metadata = (legacy.output.metadata || {}) as any + + return { + success: true, + output: { + id: metadata.id, + threadId: metadata.threadId, + labelIds: metadata.labelIds, + from: metadata.from, + to: metadata.to, + subject: metadata.subject, + date: metadata.date, + body: legacy.output.content, + hasAttachments: metadata.hasAttachments, + attachmentCount: metadata.attachmentCount, + attachments: legacy.output.attachments || [], + results: metadata.results, + }, + } + }, + outputs: { + id: { type: 'string', description: 'Gmail message ID' }, + threadId: { type: 'string', description: 'Gmail thread ID' }, + labelIds: { type: 'array', items: { type: 'string' }, description: 'Email labels' }, + from: { type: 'string', description: 'Sender email address' }, + to: { type: 'string', description: 'Recipient email address' }, + subject: { type: 'string', description: 'Email subject' }, + date: { type: 'string', description: 'Email date' }, + body: { type: 'string', description: 'Email body text (best-effort plain text)' }, + hasAttachments: { type: 'boolean', description: 'Whether the email has attachments' }, + attachmentCount: { type: 'number', description: 'Number of attachments' }, + attachments: { type: 'file[]', description: 'Downloaded attachments (if enabled)' }, + results: { type: 'json', description: 'Summary results when reading multiple messages' }, + }, +} diff --git a/apps/sim/tools/gmail/remove_label.ts b/apps/sim/tools/gmail/remove_label.ts index 5d5fe4ebac..b4b4193c31 100644 --- a/apps/sim/tools/gmail/remove_label.ts +++ b/apps/sim/tools/gmail/remove_label.ts @@ -82,3 +82,36 @@ export const gmailRemoveLabelTool: ToolConfig = { + id: 'gmail_remove_label_v2', + name: 'Gmail Remove Label', + description: 'Remove label(s) from a Gmail message. Returns API-aligned fields only.', + version: '2.0.0', + oauth: gmailRemoveLabelTool.oauth, + params: gmailRemoveLabelTool.params, + request: gmailRemoveLabelTool.request, + transformResponse: async (response) => { + const legacy = await gmailRemoveLabelTool.transformResponse!(response) + if (!legacy.success) return { success: false, output: {}, error: legacy.error } + const metadata = legacy.output.metadata as any + return { + success: true, + output: { id: metadata?.id, threadId: metadata?.threadId, labelIds: metadata?.labelIds }, + } + }, + outputs: { + id: { type: 'string', description: 'Gmail message ID' }, + threadId: { type: 'string', description: 'Gmail thread ID' }, + labelIds: { type: 'array', items: { type: 'string' }, description: 'Updated email labels' }, + }, +} diff --git a/apps/sim/tools/gmail/search.ts b/apps/sim/tools/gmail/search.ts index e46868541f..d62cd6502b 100644 --- a/apps/sim/tools/gmail/search.ts +++ b/apps/sim/tools/gmail/search.ts @@ -152,3 +152,41 @@ export const gmailSearchTool: ToolConfig = }, }, } + +interface GmailSearchV2Response { + success: boolean + output: { + results: Array> + } +} + +export const gmailSearchV2Tool: ToolConfig = { + id: 'gmail_search_v2', + name: 'Gmail Search', + description: 'Search emails in Gmail. Returns API-aligned fields only.', + version: '2.0.0', + oauth: gmailSearchTool.oauth, + params: gmailSearchTool.params, + request: gmailSearchTool.request, + transformResponse: async (response: Response, params?: GmailSearchParams) => { + const legacy = await gmailSearchTool.transformResponse!(response, params) + if (!legacy.success) { + return { + success: false, + output: { results: [] }, + error: legacy.error, + } + } + + const metadata = (legacy.output.metadata || {}) as any + return { + success: true, + output: { + results: metadata.results || [], + }, + } + }, + outputs: { + results: { type: 'json', description: 'Array of search results' }, + }, +} diff --git a/apps/sim/tools/gmail/send.ts b/apps/sim/tools/gmail/send.ts index 7fb2cf0de0..a35456dab6 100644 --- a/apps/sim/tools/gmail/send.ts +++ b/apps/sim/tools/gmail/send.ts @@ -132,3 +132,47 @@ export const gmailSendTool: ToolConfig = { }, }, } + +interface GmailSendV2Response { + success: boolean + output: { + id?: string + threadId?: string + labelIds?: string[] + } +} + +export const gmailSendV2Tool: ToolConfig = { + id: 'gmail_send_v2', + name: 'Gmail Send', + description: 'Send emails using Gmail. Returns API-aligned fields only.', + version: '2.0.0', + oauth: gmailSendTool.oauth, + params: gmailSendTool.params, + request: gmailSendTool.request, + transformResponse: async (response) => { + const legacy = await gmailSendTool.transformResponse!(response) + if (!legacy.success) { + return { + success: false, + output: {}, + error: legacy.error, + } + } + + const metadata = legacy.output.metadata as any + return { + success: true, + output: { + id: metadata?.id, + threadId: metadata?.threadId, + labelIds: metadata?.labelIds, + }, + } + }, + outputs: { + id: { type: 'string', description: 'Gmail message ID' }, + threadId: { type: 'string', description: 'Gmail thread ID' }, + labelIds: { type: 'array', items: { type: 'string' }, description: 'Email labels' }, + }, +} diff --git a/apps/sim/tools/gmail/unarchive.ts b/apps/sim/tools/gmail/unarchive.ts index 2b4fc4ad95..882157292d 100644 --- a/apps/sim/tools/gmail/unarchive.ts +++ b/apps/sim/tools/gmail/unarchive.ts @@ -75,3 +75,36 @@ export const gmailUnarchiveTool: ToolConfig = { + id: 'gmail_unarchive_v2', + name: 'Gmail Unarchive', + description: 'Unarchive a Gmail message (move back to inbox). Returns API-aligned fields only.', + version: '2.0.0', + oauth: gmailUnarchiveTool.oauth, + params: gmailUnarchiveTool.params, + request: gmailUnarchiveTool.request, + transformResponse: async (response) => { + const legacy = await gmailUnarchiveTool.transformResponse!(response) + if (!legacy.success) return { success: false, output: {}, error: legacy.error } + const metadata = legacy.output.metadata as any + return { + success: true, + output: { id: metadata?.id, threadId: metadata?.threadId, labelIds: metadata?.labelIds }, + } + }, + outputs: { + id: { type: 'string', description: 'Gmail message ID' }, + threadId: { type: 'string', description: 'Gmail thread ID' }, + labelIds: { type: 'array', items: { type: 'string' }, description: 'Updated email labels' }, + }, +} diff --git a/apps/sim/tools/google_calendar/create.ts b/apps/sim/tools/google_calendar/create.ts index 3a0bf3c80c..d18f34d8dd 100644 --- a/apps/sim/tools/google_calendar/create.ts +++ b/apps/sim/tools/google_calendar/create.ts @@ -191,3 +191,64 @@ export const createTool: ToolConfig = + { + id: 'google_calendar_create_v2', + name: 'Google Calendar Create Event', + description: 'Create a new event in Google Calendar. Returns API-aligned fields only.', + version: '2.0.0', + oauth: createTool.oauth, + params: createTool.params, + request: createTool.request, + transformResponse: async (response: Response) => { + const data: GoogleCalendarApiEventResponse = await response.json() + + return { + success: true, + output: { + id: data.id, + htmlLink: data.htmlLink, + status: data.status, + summary: data.summary, + description: data.description, + location: data.location, + start: data.start, + end: data.end, + attendees: data.attendees, + creator: data.creator, + organizer: data.organizer, + }, + } + }, + outputs: { + id: { type: 'string', description: 'Event ID' }, + htmlLink: { type: 'string', description: 'Event link' }, + status: { type: 'string', description: 'Event status' }, + summary: { type: 'string', description: 'Event title' }, + description: { type: 'string', description: 'Event description' }, + location: { type: 'string', description: 'Event location' }, + start: { type: 'json', description: 'Event start' }, + end: { type: 'json', description: 'Event end' }, + attendees: { type: 'json', description: 'Event attendees' }, + creator: { type: 'json', description: 'Event creator' }, + organizer: { type: 'json', description: 'Event organizer' }, + }, + } diff --git a/apps/sim/tools/google_calendar/get.ts b/apps/sim/tools/google_calendar/get.ts index a73d8f9df8..34f585af88 100644 --- a/apps/sim/tools/google_calendar/get.ts +++ b/apps/sim/tools/google_calendar/get.ts @@ -82,3 +82,63 @@ export const getTool: ToolConfig = { + id: 'google_calendar_get_v2', + name: 'Google Calendar Get Event', + description: 'Get a specific event from Google Calendar. Returns API-aligned fields only.', + version: '2.0.0', + oauth: getTool.oauth, + params: getTool.params, + request: getTool.request, + transformResponse: async (response: Response) => { + const data: GoogleCalendarApiEventResponse = await response.json() + + return { + success: true, + output: { + id: data.id, + htmlLink: data.htmlLink, + status: data.status, + summary: data.summary, + description: data.description, + location: data.location, + start: data.start, + end: data.end, + attendees: data.attendees, + creator: data.creator, + organizer: data.organizer, + }, + } + }, + outputs: { + id: { type: 'string', description: 'Event ID' }, + htmlLink: { type: 'string', description: 'Event link' }, + status: { type: 'string', description: 'Event status' }, + summary: { type: 'string', description: 'Event title' }, + description: { type: 'string', description: 'Event description' }, + location: { type: 'string', description: 'Event location' }, + start: { type: 'json', description: 'Event start' }, + end: { type: 'json', description: 'Event end' }, + attendees: { type: 'json', description: 'Event attendees' }, + creator: { type: 'json', description: 'Event creator' }, + organizer: { type: 'json', description: 'Event organizer' }, + }, +} diff --git a/apps/sim/tools/google_calendar/index.ts b/apps/sim/tools/google_calendar/index.ts index 2cc7ab2a81..0f3105ae92 100644 --- a/apps/sim/tools/google_calendar/index.ts +++ b/apps/sim/tools/google_calendar/index.ts @@ -1,11 +1,17 @@ -import { createTool } from '@/tools/google_calendar/create' -import { getTool } from '@/tools/google_calendar/get' -import { inviteTool } from '@/tools/google_calendar/invite' -import { listTool } from '@/tools/google_calendar/list' -import { quickAddTool } from '@/tools/google_calendar/quick_add' +import { createTool, createV2Tool } from '@/tools/google_calendar/create' +import { getTool, getV2Tool } from '@/tools/google_calendar/get' +import { inviteTool, inviteV2Tool } from '@/tools/google_calendar/invite' +import { listTool, listV2Tool } from '@/tools/google_calendar/list' +import { quickAddTool, quickAddV2Tool } from '@/tools/google_calendar/quick_add' export const googleCalendarCreateTool = createTool export const googleCalendarGetTool = getTool export const googleCalendarInviteTool = inviteTool export const googleCalendarListTool = listTool export const googleCalendarQuickAddTool = quickAddTool + +export const googleCalendarCreateV2Tool = createV2Tool +export const googleCalendarGetV2Tool = getV2Tool +export const googleCalendarInviteV2Tool = inviteV2Tool +export const googleCalendarListV2Tool = listV2Tool +export const googleCalendarQuickAddV2Tool = quickAddV2Tool diff --git a/apps/sim/tools/google_calendar/invite.ts b/apps/sim/tools/google_calendar/invite.ts index b48f260f48..48e896fb06 100644 --- a/apps/sim/tools/google_calendar/invite.ts +++ b/apps/sim/tools/google_calendar/invite.ts @@ -253,3 +253,162 @@ export const inviteTool: ToolConfig = + { + id: 'google_calendar_invite_v2', + name: 'Google Calendar Invite Attendees', + description: + 'Invite attendees to an existing Google Calendar event. Returns API-aligned fields only.', + version: '2.0.0', + oauth: inviteTool.oauth, + params: inviteTool.params, + request: inviteTool.request, + transformResponse: async (response: Response, params) => { + const existingEvent = await response.json() + + if (!existingEvent.start || !existingEvent.end || !existingEvent.summary) { + throw new Error('Existing event is missing required fields (start, end, or summary)') + } + + let newAttendeeList: string[] = [] + + if (params?.attendees) { + if (Array.isArray(params.attendees)) { + newAttendeeList = params.attendees.filter( + (email: string) => email && email.trim().length > 0 + ) + } else if ( + typeof (params.attendees as any) === 'string' && + (params.attendees as any).trim().length > 0 + ) { + newAttendeeList = (params.attendees as any) + .split(',') + .map((email: string) => email.trim()) + .filter((email: string) => email.length > 0) + } + } + + const existingAttendees = existingEvent.attendees || [] + let finalAttendees: Array = [] + + const shouldReplace = + params?.replaceExisting === true || (params?.replaceExisting as any) === 'true' + + if (shouldReplace) { + finalAttendees = newAttendeeList.map((email: string) => ({ + email, + responseStatus: 'needsAction', + })) + } else { + finalAttendees = [...existingAttendees] + + const existingEmails = new Set( + existingAttendees.map((attendee: any) => attendee.email?.toLowerCase() || '') + ) + + for (const newEmail of newAttendeeList) { + const emailLower = newEmail.toLowerCase() + if (!existingEmails.has(emailLower)) { + finalAttendees.push({ + email: newEmail, + responseStatus: 'needsAction', + }) + } + } + } + + const updatedEvent = { + ...existingEvent, + attendees: finalAttendees, + } + + const readOnlyFields = [ + 'id', + 'etag', + 'kind', + 'created', + 'updated', + 'htmlLink', + 'iCalUID', + 'sequence', + 'creator', + 'organizer', + ] + readOnlyFields.forEach((field) => { + delete updatedEvent[field] + }) + + const calendarId = params?.calendarId || 'primary' + const queryParams = new URLSearchParams() + if (params?.sendUpdates !== undefined) { + queryParams.append('sendUpdates', params.sendUpdates) + } + + const queryString = queryParams.toString() + const putUrl = `${CALENDAR_API_BASE}/calendars/${encodeURIComponent(calendarId)}/events/${encodeURIComponent(params?.eventId || '')}${queryString ? `?${queryString}` : ''}` + + const putResponse = await fetch(putUrl, { + method: 'PUT', + headers: { + Authorization: `Bearer ${params?.accessToken}`, + 'Content-Type': 'application/json', + }, + body: JSON.stringify(updatedEvent), + }) + + if (!putResponse.ok) { + const errorData = await putResponse.json() + throw new Error(errorData.error?.message || 'Failed to invite attendees to calendar event') + } + + const data = await putResponse.json() + + return { + success: true, + output: { + id: data.id, + htmlLink: data.htmlLink, + status: data.status, + summary: data.summary, + description: data.description, + location: data.location, + start: data.start, + end: data.end, + attendees: data.attendees, + creator: data.creator, + organizer: data.organizer, + }, + } + }, + outputs: { + id: { type: 'string', description: 'Event ID' }, + htmlLink: { type: 'string', description: 'Event link' }, + status: { type: 'string', description: 'Event status' }, + summary: { type: 'string', description: 'Event title' }, + description: { type: 'string', description: 'Event description' }, + location: { type: 'string', description: 'Event location' }, + start: { type: 'json', description: 'Event start' }, + end: { type: 'json', description: 'Event end' }, + attendees: { type: 'json', description: 'Event attendees' }, + creator: { type: 'json', description: 'Event creator' }, + organizer: { type: 'json', description: 'Event organizer' }, + }, + } diff --git a/apps/sim/tools/google_calendar/list.ts b/apps/sim/tools/google_calendar/list.ts index 067af795c0..5a9c3abc2c 100644 --- a/apps/sim/tools/google_calendar/list.ts +++ b/apps/sim/tools/google_calendar/list.ts @@ -118,3 +118,55 @@ export const listTool: ToolConfig> + } +} + +export const listV2Tool: ToolConfig = { + id: 'google_calendar_list_v2', + name: 'Google Calendar List Events', + description: 'List events from Google Calendar. Returns API-aligned fields only.', + version: '2.0.0', + oauth: listTool.oauth, + params: listTool.params, + request: listTool.request, + transformResponse: async (response: Response) => { + const data: GoogleCalendarApiListResponse = await response.json() + const events = data.items || [] + + return { + success: true, + output: { + nextPageToken: data.nextPageToken, + nextSyncToken: data.nextSyncToken, + timeZone: data.timeZone, + events: events.map((event: GoogleCalendarApiEventResponse) => ({ + id: event.id, + htmlLink: event.htmlLink, + status: event.status, + summary: event.summary || 'No title', + description: event.description, + location: event.location, + start: event.start, + end: event.end, + attendees: event.attendees, + creator: event.creator, + organizer: event.organizer, + })), + }, + } + }, + outputs: { + nextPageToken: { type: 'string', description: 'Next page token', optional: true }, + nextSyncToken: { type: 'string', description: 'Next sync token', optional: true }, + timeZone: { type: 'string', description: 'Calendar time zone', optional: true }, + events: { type: 'json', description: 'List of events' }, + }, +} diff --git a/apps/sim/tools/google_calendar/quick_add.ts b/apps/sim/tools/google_calendar/quick_add.ts index 5b12f7bded..08598852c0 100644 --- a/apps/sim/tools/google_calendar/quick_add.ts +++ b/apps/sim/tools/google_calendar/quick_add.ts @@ -1,3 +1,4 @@ +import { createLogger } from '@sim/logger' import { CALENDAR_API_BASE, type GoogleCalendarQuickAddParams, @@ -5,6 +6,8 @@ import { } from '@/tools/google_calendar/types' import type { ToolConfig } from '@/tools/types' +const logger = createLogger('GoogleCalendarQuickAddTool') + export const quickAddTool: ToolConfig< GoogleCalendarQuickAddParams, GoogleCalendarQuickAddResponse @@ -125,14 +128,13 @@ export const quickAddTool: ToolConfig< finalEventData = await updateResponse.json() } else { // If update fails, we still return the original event but log the error - console.warn( - 'Failed to add attendees to quick-added event:', - await updateResponse.text() - ) + logger.warn('Failed to add attendees to quick-added event', { + error: await updateResponse.text(), + }) } } catch (error) { // If attendee update fails, we still return the original event - console.warn('Error adding attendees to quick-added event:', error) + logger.warn('Error adding attendees to quick-added event', { error }) } } } @@ -163,6 +165,137 @@ export const quickAddTool: ToolConfig< type: 'string', description: 'Event creation confirmation message from natural language', }, - metadata: { type: 'json', description: 'Created event metadata including parsed details' }, + metadata: { + type: 'json', + description: 'Created event metadata including parsed details', + properties: { + id: { type: 'string', description: 'Event ID' }, + htmlLink: { type: 'string', description: 'URL to view the event in Google Calendar' }, + status: { type: 'string', description: 'Event status (confirmed, tentative, cancelled)' }, + summary: { type: 'string', description: 'Event title' }, + description: { type: 'string', description: 'Event description' }, + location: { type: 'string', description: 'Event location' }, + start: { type: 'object', description: 'Event start time' }, + end: { type: 'object', description: 'Event end time' }, + attendees: { type: 'array', description: 'List of event attendees' }, + creator: { type: 'object', description: 'Event creator info' }, + organizer: { type: 'object', description: 'Event organizer info' }, + }, + }, + }, +} + +interface GoogleCalendarQuickAddV2Response { + success: boolean + output: { + id: string + htmlLink?: string + status?: string + summary?: string + description?: string + location?: string + start?: any + end?: any + attendees?: any + creator?: any + organizer?: any + } +} + +export const quickAddV2Tool: ToolConfig< + GoogleCalendarQuickAddParams, + GoogleCalendarQuickAddV2Response +> = { + id: 'google_calendar_quick_add_v2', + name: 'Google Calendar Quick Add', + description: 'Create events from natural language text. Returns API-aligned fields only.', + version: '2.0.0', + oauth: quickAddTool.oauth, + params: quickAddTool.params, + request: quickAddTool.request, + transformResponse: async (response: Response, params) => { + const data = await response.json() + + let finalEventData = data + if (params?.attendees) { + let attendeeList: string[] = [] + const attendees = params.attendees as string | string[] + + if (Array.isArray(attendees)) { + attendeeList = attendees.filter((email: string) => email && email.trim().length > 0) + } else if (typeof attendees === 'string' && attendees.trim().length > 0) { + attendeeList = attendees + .split(',') + .map((email: string) => email.trim()) + .filter((email: string) => email.length > 0) + } + + if (attendeeList.length > 0) { + try { + const calendarId = params.calendarId || 'primary' + const eventId = data.id + + const updateData = { + attendees: attendeeList.map((email: string) => ({ email })), + } + + const updateQueryParams = new URLSearchParams() + if (params.sendUpdates !== undefined) { + updateQueryParams.append('sendUpdates', params.sendUpdates) + } + + const updateUrl = `${CALENDAR_API_BASE}/calendars/${encodeURIComponent(calendarId)}/events/${eventId}${updateQueryParams.toString() ? `?${updateQueryParams.toString()}` : ''}` + + const updateResponse = await fetch(updateUrl, { + method: 'PATCH', + headers: { + Authorization: `Bearer ${params.accessToken}`, + 'Content-Type': 'application/json', + }, + body: JSON.stringify(updateData), + }) + + if (updateResponse.ok) { + finalEventData = await updateResponse.json() + } else { + logger.warn('Failed to add attendees to quick-added event', { + error: await updateResponse.text(), + }) + } + } catch (error) { + logger.warn('Error adding attendees to quick-added event', { error }) + } + } + } + + return { + success: true, + output: { + id: finalEventData.id, + htmlLink: finalEventData.htmlLink, + status: finalEventData.status, + summary: finalEventData.summary, + description: finalEventData.description, + location: finalEventData.location, + start: finalEventData.start, + end: finalEventData.end, + attendees: finalEventData.attendees, + creator: finalEventData.creator, + organizer: finalEventData.organizer, + }, + } + }, + outputs: { + id: { type: 'string', description: 'Event ID' }, + htmlLink: { type: 'string', description: 'Event link' }, + status: { type: 'string', description: 'Event status' }, + summary: { type: 'string', description: 'Event title' }, + description: { type: 'string', description: 'Event description' }, + location: { type: 'string', description: 'Event location' }, + start: { type: 'json', description: 'Event start' }, + end: { type: 'json', description: 'Event end' }, + attendees: { type: 'json', description: 'Event attendees' }, + creator: { type: 'json', description: 'Event creator' }, + organizer: { type: 'json', description: 'Event organizer' }, }, } diff --git a/apps/sim/tools/google_docs/create.ts b/apps/sim/tools/google_docs/create.ts index f17c3cbec1..4fbec19740 100644 --- a/apps/sim/tools/google_docs/create.ts +++ b/apps/sim/tools/google_docs/create.ts @@ -150,6 +150,12 @@ export const createTool: ToolConfig outputs: { content: { type: 'string', description: 'Extracted document text content' }, - metadata: { type: 'json', description: 'Document metadata including ID, title, and URL' }, + metadata: { + type: 'json', + description: 'Document metadata including ID, title, and URL', + properties: { + documentId: { type: 'string', description: 'Google Docs document ID' }, + title: { type: 'string', description: 'Document title' }, + mimeType: { type: 'string', description: 'Document MIME type' }, + url: { type: 'string', description: 'Document URL' }, + }, + }, }, } diff --git a/apps/sim/tools/google_docs/write.ts b/apps/sim/tools/google_docs/write.ts index c43255df49..4b0986b859 100644 --- a/apps/sim/tools/google_docs/write.ts +++ b/apps/sim/tools/google_docs/write.ts @@ -82,6 +82,12 @@ export const writeTool: ToolConfig & { output: { company: HubSpotContact - metadata: { - operation: 'get_company' - companyId: string - } + companyId: string success: boolean } } @@ -190,10 +175,7 @@ export type HubSpotCreateCompanyParams = HubSpotCreateContactParams export type HubSpotCreateCompanyResponse = Omit & { output: { company: HubSpotContact - metadata: { - operation: 'create_company' - companyId: string - } + companyId: string success: boolean } } @@ -201,22 +183,21 @@ export type HubSpotUpdateCompanyParams = HubSpotUpdateContactParams & { companyI export type HubSpotUpdateCompanyResponse = Omit & { output: { company: HubSpotContact - metadata: { - operation: 'update_company' - companyId: string - } + companyId: string success: boolean } } export type HubSpotSearchCompaniesParams = HubSpotSearchContactsParams export interface HubSpotSearchCompaniesResponse extends ToolResponse { - companies: HubSpotContact[] - total: number - paging?: HubSpotPaging - metadata: { - operation: 'search_companies' - totalReturned: number + output: { + companies: HubSpotContact[] total: number + paging?: HubSpotPaging + metadata: { + totalReturned: number + hasMore: boolean + } + success: boolean } } @@ -228,7 +209,6 @@ export type HubSpotListDealsResponse = Omit = { - id: 'intercom_create_company', - name: 'Create Company in Intercom', - description: 'Create or update a company in Intercom', - version: '1.0.0', - +const createCompanyBase = { params: { accessToken: { type: 'string', @@ -131,13 +123,13 @@ export const intercomCreateCompanyTool: ToolConfig< request: { url: () => buildIntercomUrl('/companies'), method: 'POST', - headers: (params) => ({ + headers: (params: IntercomCreateCompanyParams) => ({ Authorization: `Bearer ${params.accessToken}`, Accept: 'application/json', 'Content-Type': 'application/json', 'Intercom-Version': '2.14', }), - body: (params) => { + body: (params: IntercomCreateCompanyParams) => { const company: any = { company_id: params.company_id, } @@ -162,6 +154,18 @@ export const intercomCreateCompanyTool: ToolConfig< return company }, }, +} satisfies Pick, 'params' | 'request'> + +export const intercomCreateCompanyTool: ToolConfig< + IntercomCreateCompanyParams, + IntercomCreateCompanyResponse +> = { + id: 'intercom_create_company', + name: 'Create Company in Intercom', + description: 'Create or update a company in Intercom', + version: '1.0.0', + + ...createCompanyBase, transformResponse: async (response: Response) => { if (!response.ok) { @@ -237,3 +241,110 @@ export const intercomCreateCompanyTool: ToolConfig< success: { type: 'boolean', description: 'Operation success status' }, }, } + +interface IntercomCreateCompanyV2Response { + success: boolean + output: { + company: { + id: string + type: string + app_id: string + company_id: string + name?: string + website?: string + plan: Record + size?: number + industry?: string + monthly_spend: number + session_count: number + user_count: number + created_at: number + updated_at: number + remote_created_at?: number + custom_attributes: Record + tags: { + type: string + tags: any[] + } + segments: { + type: string + segments: any[] + } + [key: string]: any + } + companyId: string + } +} + +export const intercomCreateCompanyV2Tool: ToolConfig< + IntercomCreateCompanyParams, + IntercomCreateCompanyV2Response +> = { + ...createCompanyBase, + id: 'intercom_create_company_v2', + name: 'Create Company in Intercom', + description: 'Create or update a company in Intercom', + version: '2.0.0', + + transformResponse: async (response: Response) => { + if (!response.ok) { + const data = await response.json() + handleIntercomError(data, response.status, 'create_company') + } + + const data = await response.json() + + return { + success: true, + output: { + company: data, + companyId: data.id, + }, + } + }, + + outputs: { + company: { + type: 'object', + description: 'Created or updated company object', + properties: { + id: { type: 'string', description: 'Unique identifier for the company' }, + type: { type: 'string', description: 'Object type (company)' }, + app_id: { type: 'string', description: 'Intercom app ID' }, + company_id: { type: 'string', description: 'Your unique identifier for the company' }, + name: { type: 'string', description: 'Name of the company' }, + website: { type: 'string', description: 'Company website URL' }, + plan: { type: 'object', description: 'Company plan information' }, + size: { type: 'number', description: 'Number of employees' }, + industry: { type: 'string', description: 'Industry the company operates in' }, + monthly_spend: { type: 'number', description: 'Monthly revenue from this company' }, + session_count: { type: 'number', description: 'Number of sessions' }, + user_count: { type: 'number', description: 'Number of users in the company' }, + created_at: { type: 'number', description: 'Unix timestamp when company was created' }, + updated_at: { type: 'number', description: 'Unix timestamp when company was last updated' }, + remote_created_at: { + type: 'number', + description: 'Unix timestamp when company was created by you', + }, + custom_attributes: { type: 'object', description: 'Custom attributes set on the company' }, + tags: { + type: 'object', + description: 'Tags associated with the company', + properties: { + type: { type: 'string', description: 'Tag list type' }, + tags: { type: 'array', description: 'Array of tag objects' }, + }, + }, + segments: { + type: 'object', + description: 'Segments the company belongs to', + properties: { + type: { type: 'string', description: 'Segment list type' }, + segments: { type: 'array', description: 'Array of segment objects' }, + }, + }, + }, + }, + companyId: { type: 'string', description: 'ID of the created/updated company' }, + }, +} diff --git a/apps/sim/tools/intercom/create_contact.ts b/apps/sim/tools/intercom/create_contact.ts index bedc05ff7f..24b8e4b40d 100644 --- a/apps/sim/tools/intercom/create_contact.ts +++ b/apps/sim/tools/intercom/create_contact.ts @@ -83,15 +83,7 @@ export interface IntercomCreateContactResponse { } } -export const intercomCreateContactTool: ToolConfig< - IntercomCreateContactParams, - IntercomCreateContactResponse -> = { - id: 'intercom_create_contact', - name: 'Create Contact in Intercom', - description: 'Create a new contact in Intercom with email, external_id, or role', - version: '1.0.0', - +const intercomCreateContactBase = { params: { accessToken: { type: 'string', @@ -210,6 +202,18 @@ export const intercomCreateContactTool: ToolConfig< return contact }, }, +} satisfies Pick, 'params' | 'request'> + +export const intercomCreateContactTool: ToolConfig< + IntercomCreateContactParams, + IntercomCreateContactResponse +> = { + id: 'intercom_create_contact', + name: 'Create Contact in Intercom', + description: 'Create a new contact in Intercom with email, external_id, or role', + version: '1.0.0', + + ...intercomCreateContactBase, transformResponse: async (response: Response) => { if (!response.ok) { @@ -322,3 +326,122 @@ export const intercomCreateContactTool: ToolConfig< success: { type: 'boolean', description: 'Operation success status' }, }, } + +interface IntercomCreateContactV2Response { + success: boolean + output: { + contact: IntercomCreateContactResponse['output']['contact'] + contactId: string + } +} + +export const intercomCreateContactV2Tool: ToolConfig< + IntercomCreateContactParams, + IntercomCreateContactV2Response +> = { + ...intercomCreateContactBase, + id: 'intercom_create_contact_v2', + name: 'Create Contact in Intercom', + description: + 'Create a new contact in Intercom with email, external_id, or role. Returns API-aligned fields only.', + version: '2.0.0', + + transformResponse: async (response: Response) => { + if (!response.ok) { + const data = await response.json() + handleIntercomError(data, response.status, 'create_contact') + } + + const data = await response.json() + + return { + success: true, + output: { + contact: data, + contactId: data.id, + }, + } + }, + + outputs: { + contact: { + type: 'object', + description: 'Created contact object', + properties: { + id: { type: 'string', description: 'Unique identifier for the contact' }, + type: { type: 'string', description: 'Object type (contact)' }, + role: { type: 'string', description: 'Role of the contact (user or lead)' }, + email: { type: 'string', description: 'Email address of the contact' }, + phone: { type: 'string', description: 'Phone number of the contact' }, + name: { type: 'string', description: 'Name of the contact' }, + avatar: { type: 'string', description: 'Avatar URL of the contact' }, + owner_id: { type: 'string', description: 'ID of the admin assigned to this contact' }, + external_id: { type: 'string', description: 'External identifier for the contact' }, + created_at: { type: 'number', description: 'Unix timestamp when contact was created' }, + updated_at: { type: 'number', description: 'Unix timestamp when contact was last updated' }, + signed_up_at: { type: 'number', description: 'Unix timestamp when user signed up' }, + last_seen_at: { type: 'number', description: 'Unix timestamp when user was last seen' }, + workspace_id: { type: 'string', description: 'Workspace ID the contact belongs to' }, + custom_attributes: { type: 'object', description: 'Custom attributes set on the contact' }, + tags: { + type: 'object', + description: 'Tags associated with the contact', + properties: { + type: { type: 'string', description: 'List type' }, + url: { type: 'string', description: 'URL to fetch tags' }, + data: { type: 'array', description: 'Array of tag objects' }, + has_more: { type: 'boolean', description: 'Whether there are more tags' }, + total_count: { type: 'number', description: 'Total number of tags' }, + }, + }, + notes: { + type: 'object', + description: 'Notes associated with the contact', + properties: { + type: { type: 'string', description: 'List type' }, + url: { type: 'string', description: 'URL to fetch notes' }, + data: { type: 'array', description: 'Array of note objects' }, + has_more: { type: 'boolean', description: 'Whether there are more notes' }, + total_count: { type: 'number', description: 'Total number of notes' }, + }, + }, + companies: { + type: 'object', + description: 'Companies associated with the contact', + properties: { + type: { type: 'string', description: 'List type' }, + url: { type: 'string', description: 'URL to fetch companies' }, + data: { type: 'array', description: 'Array of company objects' }, + has_more: { type: 'boolean', description: 'Whether there are more companies' }, + total_count: { type: 'number', description: 'Total number of companies' }, + }, + }, + location: { + type: 'object', + description: 'Location information for the contact', + properties: { + type: { type: 'string', description: 'Location type' }, + city: { type: 'string', description: 'City' }, + region: { type: 'string', description: 'Region/State' }, + country: { type: 'string', description: 'Country' }, + country_code: { type: 'string', description: 'Country code' }, + continent_code: { type: 'string', description: 'Continent code' }, + }, + }, + social_profiles: { + type: 'object', + description: 'Social profiles of the contact', + properties: { + type: { type: 'string', description: 'List type' }, + data: { type: 'array', description: 'Array of social profile objects' }, + }, + }, + unsubscribed_from_emails: { + type: 'boolean', + description: 'Whether contact is unsubscribed from emails', + }, + }, + }, + contactId: { type: 'string', description: 'ID of the created contact' }, + }, +} diff --git a/apps/sim/tools/intercom/create_message.ts b/apps/sim/tools/intercom/create_message.ts index 1dc5de9383..2cea1ce073 100644 --- a/apps/sim/tools/intercom/create_message.ts +++ b/apps/sim/tools/intercom/create_message.ts @@ -1,9 +1,6 @@ -import { createLogger } from '@sim/logger' import type { ToolConfig } from '@/tools/types' import { buildIntercomUrl, handleIntercomError } from './types' -const logger = createLogger('IntercomCreateMessage') - export interface IntercomCreateMessageParams { accessToken: string message_type: 'inapp' | 'email' @@ -29,15 +26,16 @@ export interface IntercomCreateMessageResponse { } } -export const intercomCreateMessageTool: ToolConfig< - IntercomCreateMessageParams, - IntercomCreateMessageResponse -> = { - id: 'intercom_create_message', - name: 'Create Message in Intercom', - description: 'Create and send a new admin-initiated message in Intercom', - version: '1.0.0', +export interface IntercomCreateMessageV2Response { + success: boolean + output: { + message: any + messageId: string + success: boolean + } +} +const createMessageBase = { params: { accessToken: { type: 'string', @@ -102,16 +100,15 @@ export const intercomCreateMessageTool: ToolConfig< 'Unix timestamp for when the message was created. If not provided, current time is used.', }, }, - request: { url: () => buildIntercomUrl('/messages'), method: 'POST', - headers: (params) => ({ + headers: (params: IntercomCreateMessageParams) => ({ Authorization: `Bearer ${params.accessToken}`, 'Content-Type': 'application/json', 'Intercom-Version': '2.14', }), - body: (params) => { + body: (params: IntercomCreateMessageParams) => { // Map "inapp" to "in_app" as required by Intercom API const apiMessageType = params.message_type === 'inapp' ? 'in_app' : params.message_type @@ -138,6 +135,18 @@ export const intercomCreateMessageTool: ToolConfig< return message }, }, +} satisfies Pick, 'params' | 'request'> + +export const intercomCreateMessageTool: ToolConfig< + IntercomCreateMessageParams, + IntercomCreateMessageResponse +> = { + id: 'intercom_create_message', + name: 'Create Message in Intercom', + description: 'Create and send a new admin-initiated message in Intercom', + version: '1.0.0', + + ...createMessageBase, transformResponse: async (response: Response) => { if (!response.ok) { @@ -185,3 +194,51 @@ export const intercomCreateMessageTool: ToolConfig< success: { type: 'boolean', description: 'Operation success status' }, }, } + +export const intercomCreateMessageV2Tool: ToolConfig< + IntercomCreateMessageParams, + IntercomCreateMessageV2Response +> = { + ...createMessageBase, + id: 'intercom_create_message_v2', + name: 'Create Message in Intercom', + description: + 'Create and send a new admin-initiated message in Intercom. Returns API-aligned fields only.', + version: '2.0.0', + + transformResponse: async (response: Response) => { + if (!response.ok) { + const data = await response.json() + handleIntercomError(data, response.status, 'create_message') + } + + const data = await response.json() + + return { + success: true, + output: { + message: data, + messageId: data.id, + success: true, + }, + } + }, + + outputs: { + message: { + type: 'object', + description: 'Created message object', + properties: { + id: { type: 'string', description: 'Unique identifier for the message' }, + type: { type: 'string', description: 'Object type (message)' }, + created_at: { type: 'number', description: 'Unix timestamp when message was created' }, + body: { type: 'string', description: 'Body of the message' }, + message_type: { type: 'string', description: 'Type of the message (in_app or email)' }, + conversation_id: { type: 'string', description: 'ID of the conversation created' }, + owner: { type: 'object', description: 'Owner of the message' }, + }, + }, + messageId: { type: 'string', description: 'ID of the created message' }, + success: { type: 'boolean', description: 'Operation success status' }, + }, +} diff --git a/apps/sim/tools/intercom/create_ticket.ts b/apps/sim/tools/intercom/create_ticket.ts index 809472ce06..d9fbf1a867 100644 --- a/apps/sim/tools/intercom/create_ticket.ts +++ b/apps/sim/tools/intercom/create_ticket.ts @@ -27,15 +27,16 @@ export interface IntercomCreateTicketResponse { } } -export const intercomCreateTicketTool: ToolConfig< - IntercomCreateTicketParams, - IntercomCreateTicketResponse -> = { - id: 'intercom_create_ticket', - name: 'Create Ticket in Intercom', - description: 'Create a new ticket in Intercom', - version: '1.0.0', +export interface IntercomCreateTicketV2Response { + success: boolean + output: { + ticket: any + ticketId: string + success: boolean + } +} +const createTicketBase = { params: { accessToken: { type: 'string', @@ -88,16 +89,15 @@ export const intercomCreateTicketTool: ToolConfig< description: 'When true, suppresses notifications when the ticket is created', }, }, - request: { url: () => buildIntercomUrl('/tickets'), method: 'POST', - headers: (params) => ({ + headers: (params: IntercomCreateTicketParams) => ({ Authorization: `Bearer ${params.accessToken}`, 'Content-Type': 'application/json', 'Intercom-Version': '2.14', }), - body: (params) => { + body: (params: IntercomCreateTicketParams) => { const ticket: any = { ticket_type_id: params.ticket_type_id, } @@ -126,6 +126,18 @@ export const intercomCreateTicketTool: ToolConfig< return ticket }, }, +} satisfies Pick, 'params' | 'request'> + +export const intercomCreateTicketTool: ToolConfig< + IntercomCreateTicketParams, + IntercomCreateTicketResponse +> = { + id: 'intercom_create_ticket', + name: 'Create Ticket in Intercom', + description: 'Create a new ticket in Intercom', + version: '1.0.0', + + ...createTicketBase, transformResponse: async (response: Response) => { if (!response.ok) { @@ -187,3 +199,64 @@ export const intercomCreateTicketTool: ToolConfig< success: { type: 'boolean', description: 'Operation success status' }, }, } + +export const intercomCreateTicketV2Tool: ToolConfig< + IntercomCreateTicketParams, + IntercomCreateTicketV2Response +> = { + ...createTicketBase, + id: 'intercom_create_ticket_v2', + name: 'Create Ticket in Intercom', + description: 'Create a new ticket in Intercom. Returns API-aligned fields only.', + version: '2.0.0', + + transformResponse: async (response: Response) => { + if (!response.ok) { + const data = await response.json() + handleIntercomError(data, response.status, 'create_ticket') + } + + const data = await response.json() + + return { + success: true, + output: { + ticket: data, + ticketId: data.id, + success: true, + }, + } + }, + + outputs: { + ticket: { + type: 'object', + description: 'Created ticket object', + properties: { + id: { type: 'string', description: 'Unique identifier for the ticket' }, + type: { type: 'string', description: 'Object type (ticket)' }, + ticket_id: { type: 'string', description: 'Ticket ID' }, + ticket_type: { type: 'object', description: 'Type of the ticket' }, + ticket_attributes: { type: 'object', description: 'Attributes of the ticket' }, + ticket_state: { type: 'string', description: 'State of the ticket' }, + ticket_state_internal_label: { + type: 'string', + description: 'Internal label for ticket state', + }, + ticket_state_external_label: { + type: 'string', + description: 'External label for ticket state', + }, + created_at: { type: 'number', description: 'Unix timestamp when ticket was created' }, + updated_at: { type: 'number', description: 'Unix timestamp when ticket was last updated' }, + contacts: { type: 'object', description: 'Contacts associated with the ticket' }, + admin_assignee_id: { type: 'string', description: 'ID of assigned admin' }, + team_assignee_id: { type: 'string', description: 'ID of assigned team' }, + is_shared: { type: 'boolean', description: 'Whether the ticket is shared' }, + open: { type: 'boolean', description: 'Whether the ticket is open' }, + }, + }, + ticketId: { type: 'string', description: 'ID of the created ticket' }, + success: { type: 'boolean', description: 'Operation success status' }, + }, +} diff --git a/apps/sim/tools/intercom/delete_contact.ts b/apps/sim/tools/intercom/delete_contact.ts index b1658f78cb..5b5bd94328 100644 --- a/apps/sim/tools/intercom/delete_contact.ts +++ b/apps/sim/tools/intercom/delete_contact.ts @@ -1,9 +1,6 @@ -import { createLogger } from '@sim/logger' import type { ToolConfig } from '@/tools/types' import { buildIntercomUrl, handleIntercomError } from './types' -const logger = createLogger('IntercomDeleteContact') - export interface IntercomDeleteContactParams { accessToken: string contactId: string @@ -21,15 +18,7 @@ export interface IntercomDeleteContactResponse { } } -export const intercomDeleteContactTool: ToolConfig< - IntercomDeleteContactParams, - IntercomDeleteContactResponse -> = { - id: 'intercom_delete_contact', - name: 'Delete Contact from Intercom', - description: 'Delete a contact from Intercom by ID', - version: '1.0.0', - +const intercomDeleteContactBase = { params: { accessToken: { type: 'string', @@ -46,14 +35,26 @@ export const intercomDeleteContactTool: ToolConfig< }, request: { - url: (params) => buildIntercomUrl(`/contacts/${params.contactId}`), + url: (params: IntercomDeleteContactParams) => buildIntercomUrl(`/contacts/${params.contactId}`), method: 'DELETE', - headers: (params) => ({ + headers: (params: IntercomDeleteContactParams) => ({ Authorization: `Bearer ${params.accessToken}`, 'Content-Type': 'application/json', 'Intercom-Version': '2.14', }), }, +} satisfies Pick, 'params' | 'request'> + +export const intercomDeleteContactTool: ToolConfig< + IntercomDeleteContactParams, + IntercomDeleteContactResponse +> = { + id: 'intercom_delete_contact', + name: 'Delete Contact from Intercom', + description: 'Delete a contact from Intercom by ID', + version: '1.0.0', + + ...intercomDeleteContactBase, transformResponse: async (response: Response) => { if (!response.ok) { @@ -89,3 +90,44 @@ export const intercomDeleteContactTool: ToolConfig< success: { type: 'boolean', description: 'Operation success status' }, }, } + +interface IntercomDeleteContactV2Response { + success: boolean + output: { + id: string + deleted: boolean + } +} + +export const intercomDeleteContactV2Tool: ToolConfig< + IntercomDeleteContactParams, + IntercomDeleteContactV2Response +> = { + ...intercomDeleteContactBase, + id: 'intercom_delete_contact_v2', + name: 'Delete Contact from Intercom', + description: 'Delete a contact from Intercom by ID. Returns API-aligned fields only.', + version: '2.0.0', + + transformResponse: async (response: Response) => { + if (!response.ok) { + const data = await response.json() + handleIntercomError(data, response.status, 'delete_contact') + } + + const data = await response.json() + + return { + success: true, + output: { + id: data.id, + deleted: true, + }, + } + }, + + outputs: { + id: { type: 'string', description: 'ID of deleted contact' }, + deleted: { type: 'boolean', description: 'Whether the contact was deleted' }, + }, +} diff --git a/apps/sim/tools/intercom/get_company.ts b/apps/sim/tools/intercom/get_company.ts index 71dee66fa9..ae311a0742 100644 --- a/apps/sim/tools/intercom/get_company.ts +++ b/apps/sim/tools/intercom/get_company.ts @@ -20,15 +20,7 @@ export interface IntercomGetCompanyResponse { } } -export const intercomGetCompanyTool: ToolConfig< - IntercomGetCompanyParams, - IntercomGetCompanyResponse -> = { - id: 'intercom_get_company', - name: 'Get Company from Intercom', - description: 'Retrieve a single company by ID from Intercom', - version: '1.0.0', - +const getCompanyBase = { params: { accessToken: { type: 'string', @@ -45,15 +37,27 @@ export const intercomGetCompanyTool: ToolConfig< }, request: { - url: (params) => buildIntercomUrl(`/companies/${params.companyId}`), + url: (params: IntercomGetCompanyParams) => buildIntercomUrl(`/companies/${params.companyId}`), method: 'GET', - headers: (params) => ({ + headers: (params: IntercomGetCompanyParams) => ({ Authorization: `Bearer ${params.accessToken}`, Accept: 'application/json', 'Content-Type': 'application/json', 'Intercom-Version': '2.14', }), }, +} satisfies Pick, 'params' | 'request'> + +export const intercomGetCompanyTool: ToolConfig< + IntercomGetCompanyParams, + IntercomGetCompanyResponse +> = { + id: 'intercom_get_company', + name: 'Get Company from Intercom', + description: 'Retrieve a single company by ID from Intercom', + version: '1.0.0', + + ...getCompanyBase, transformResponse: async (response: Response) => { if (!response.ok) { @@ -109,3 +113,63 @@ export const intercomGetCompanyTool: ToolConfig< success: { type: 'boolean', description: 'Operation success status' }, }, } + +interface IntercomGetCompanyV2Response { + success: boolean + output: { + company: any + } +} + +export const intercomGetCompanyV2Tool: ToolConfig< + IntercomGetCompanyParams, + IntercomGetCompanyV2Response +> = { + ...getCompanyBase, + id: 'intercom_get_company_v2', + name: 'Get Company from Intercom', + description: 'Retrieve a single company by ID from Intercom', + version: '2.0.0', + + transformResponse: async (response: Response) => { + if (!response.ok) { + const data = await response.json() + handleIntercomError(data, response.status, 'get_company') + } + + const data = await response.json() + + return { + success: true, + output: { + company: data, + }, + } + }, + + outputs: { + company: { + type: 'object', + description: 'Company object', + properties: { + id: { type: 'string', description: 'Unique identifier for the company' }, + type: { type: 'string', description: 'Object type (company)' }, + app_id: { type: 'string', description: 'Intercom app ID' }, + company_id: { type: 'string', description: 'Your unique identifier for the company' }, + name: { type: 'string', description: 'Name of the company' }, + website: { type: 'string', description: 'Company website URL' }, + plan: { type: 'object', description: 'Company plan information' }, + size: { type: 'number', description: 'Number of employees' }, + industry: { type: 'string', description: 'Industry the company operates in' }, + monthly_spend: { type: 'number', description: 'Monthly revenue from this company' }, + session_count: { type: 'number', description: 'Number of sessions' }, + user_count: { type: 'number', description: 'Number of users in the company' }, + created_at: { type: 'number', description: 'Unix timestamp when company was created' }, + updated_at: { type: 'number', description: 'Unix timestamp when company was last updated' }, + custom_attributes: { type: 'object', description: 'Custom attributes set on the company' }, + tags: { type: 'object', description: 'Tags associated with the company' }, + segments: { type: 'object', description: 'Segments the company belongs to' }, + }, + }, + }, +} diff --git a/apps/sim/tools/intercom/get_contact.ts b/apps/sim/tools/intercom/get_contact.ts index 7fcb5efe8c..bdfacd304b 100644 --- a/apps/sim/tools/intercom/get_contact.ts +++ b/apps/sim/tools/intercom/get_contact.ts @@ -1,9 +1,6 @@ -import { createLogger } from '@sim/logger' import type { ToolConfig } from '@/tools/types' import { buildIntercomUrl, handleIntercomError } from './types' -const logger = createLogger('IntercomGetContact') - export interface IntercomGetContactParams { accessToken: string contactId: string @@ -20,15 +17,7 @@ export interface IntercomGetContactResponse { } } -export const intercomGetContactTool: ToolConfig< - IntercomGetContactParams, - IntercomGetContactResponse -> = { - id: 'intercom_get_contact', - name: 'Get Single Contact from Intercom', - description: 'Get a single contact by ID from Intercom', - version: '1.0.0', - +const intercomGetContactBase = { params: { accessToken: { type: 'string', @@ -45,15 +34,27 @@ export const intercomGetContactTool: ToolConfig< }, request: { - url: (params) => buildIntercomUrl(`/contacts/${params.contactId}`), + url: (params: IntercomGetContactParams) => buildIntercomUrl(`/contacts/${params.contactId}`), method: 'GET', - headers: (params) => ({ + headers: (params: IntercomGetContactParams) => ({ Authorization: `Bearer ${params.accessToken}`, Accept: 'application/json', 'Content-Type': 'application/json', 'Intercom-Version': '2.14', }), }, +} satisfies Pick, 'params' | 'request'> + +export const intercomGetContactTool: ToolConfig< + IntercomGetContactParams, + IntercomGetContactResponse +> = { + id: 'intercom_get_contact', + name: 'Get Single Contact from Intercom', + description: 'Get a single contact by ID from Intercom', + version: '1.0.0', + + ...intercomGetContactBase, transformResponse: async (response: Response) => { if (!response.ok) { @@ -114,3 +115,68 @@ export const intercomGetContactTool: ToolConfig< success: { type: 'boolean', description: 'Operation success status' }, }, } + +interface IntercomGetContactV2Response { + success: boolean + output: { + contact: any + } +} + +export const intercomGetContactV2Tool: ToolConfig< + IntercomGetContactParams, + IntercomGetContactV2Response +> = { + ...intercomGetContactBase, + id: 'intercom_get_contact_v2', + name: 'Get Single Contact from Intercom', + description: 'Get a single contact by ID from Intercom. Returns API-aligned fields only.', + version: '2.0.0', + + transformResponse: async (response: Response) => { + if (!response.ok) { + const data = await response.json() + handleIntercomError(data, response.status, 'get_contact') + } + + const data = await response.json() + + return { + success: true, + output: { + contact: data, + }, + } + }, + + outputs: { + contact: { + type: 'object', + description: 'Contact object', + properties: { + id: { type: 'string', description: 'Unique identifier for the contact' }, + type: { type: 'string', description: 'Object type (contact)' }, + role: { type: 'string', description: 'Role of the contact (user or lead)' }, + email: { type: 'string', description: 'Email address of the contact' }, + phone: { type: 'string', description: 'Phone number of the contact' }, + name: { type: 'string', description: 'Name of the contact' }, + avatar: { type: 'string', description: 'Avatar URL of the contact' }, + owner_id: { type: 'string', description: 'ID of the admin assigned to this contact' }, + external_id: { type: 'string', description: 'External identifier for the contact' }, + created_at: { type: 'number', description: 'Unix timestamp when contact was created' }, + updated_at: { type: 'number', description: 'Unix timestamp when contact was last updated' }, + workspace_id: { type: 'string', description: 'Workspace ID the contact belongs to' }, + custom_attributes: { type: 'object', description: 'Custom attributes set on the contact' }, + tags: { type: 'object', description: 'Tags associated with the contact' }, + notes: { type: 'object', description: 'Notes associated with the contact' }, + companies: { type: 'object', description: 'Companies associated with the contact' }, + location: { type: 'object', description: 'Location information for the contact' }, + social_profiles: { type: 'object', description: 'Social profiles of the contact' }, + unsubscribed_from_emails: { + type: 'boolean', + description: 'Whether contact is unsubscribed from emails', + }, + }, + }, + }, +} diff --git a/apps/sim/tools/intercom/get_conversation.ts b/apps/sim/tools/intercom/get_conversation.ts index ac15cea8d7..a926f0f6bb 100644 --- a/apps/sim/tools/intercom/get_conversation.ts +++ b/apps/sim/tools/intercom/get_conversation.ts @@ -22,15 +22,7 @@ export interface IntercomGetConversationResponse { } } -export const intercomGetConversationTool: ToolConfig< - IntercomGetConversationParams, - IntercomGetConversationResponse -> = { - id: 'intercom_get_conversation', - name: 'Get Conversation from Intercom', - description: 'Retrieve a single conversation by ID from Intercom', - version: '1.0.0', - +const getConversationBase = { params: { accessToken: { type: 'string', @@ -58,9 +50,8 @@ export const intercomGetConversationTool: ToolConfig< 'When true, conversation parts will be translated to the detected language of the conversation', }, }, - request: { - url: (params) => { + url: (params: IntercomGetConversationParams) => { const url = buildIntercomUrl(`/conversations/${params.conversationId}`) const queryParams = new URLSearchParams() @@ -72,13 +63,25 @@ export const intercomGetConversationTool: ToolConfig< return queryString ? `${url}?${queryString}` : url }, method: 'GET', - headers: (params) => ({ + headers: (params: IntercomGetConversationParams) => ({ Authorization: `Bearer ${params.accessToken}`, Accept: 'application/json', 'Content-Type': 'application/json', 'Intercom-Version': '2.14', }), }, +} satisfies Pick, 'params' | 'request'> + +export const intercomGetConversationTool: ToolConfig< + IntercomGetConversationParams, + IntercomGetConversationResponse +> = { + id: 'intercom_get_conversation', + name: 'Get Conversation from Intercom', + description: 'Retrieve a single conversation by ID from Intercom', + version: '1.0.0', + + ...getConversationBase, transformResponse: async (response: Response) => { if (!response.ok) { @@ -139,3 +142,71 @@ export const intercomGetConversationTool: ToolConfig< success: { type: 'boolean', description: 'Operation success status' }, }, } + +interface IntercomGetConversationV2Response { + success: boolean + output: { + conversation: any + success: boolean + } +} + +export const intercomGetConversationV2Tool: ToolConfig< + IntercomGetConversationParams, + IntercomGetConversationV2Response +> = { + ...getConversationBase, + id: 'intercom_get_conversation_v2', + name: 'Get Conversation from Intercom', + description: 'Retrieve a single conversation by ID from Intercom', + version: '2.0.0', + + transformResponse: async (response: Response) => { + if (!response.ok) { + const data = await response.json() + handleIntercomError(data, response.status, 'get_conversation') + } + + const data = await response.json() + + return { + success: true, + output: { + conversation: data, + success: true, + }, + } + }, + + outputs: { + conversation: { + type: 'object', + description: 'Conversation object', + properties: { + id: { type: 'string', description: 'Unique identifier for the conversation' }, + type: { type: 'string', description: 'Object type (conversation)' }, + title: { type: 'string', description: 'Title of the conversation' }, + created_at: { type: 'number', description: 'Unix timestamp when conversation was created' }, + updated_at: { + type: 'number', + description: 'Unix timestamp when conversation was last updated', + }, + waiting_since: { type: 'number', description: 'Unix timestamp when waiting for reply' }, + snoozed_until: { type: 'number', description: 'Unix timestamp when snooze ends' }, + open: { type: 'boolean', description: 'Whether the conversation is open' }, + state: { type: 'string', description: 'State of the conversation' }, + read: { type: 'boolean', description: 'Whether the conversation has been read' }, + priority: { type: 'string', description: 'Priority of the conversation' }, + admin_assignee_id: { type: 'number', description: 'ID of assigned admin' }, + team_assignee_id: { type: 'string', description: 'ID of assigned team' }, + tags: { type: 'object', description: 'Tags on the conversation' }, + source: { type: 'object', description: 'Source of the conversation' }, + contacts: { type: 'object', description: 'Contacts in the conversation' }, + teammates: { type: 'object', description: 'Teammates in the conversation' }, + conversation_parts: { type: 'object', description: 'Parts of the conversation' }, + statistics: { type: 'object', description: 'Conversation statistics' }, + }, + }, + success: { type: 'boolean', description: 'Operation success status' }, + }, +} diff --git a/apps/sim/tools/intercom/get_ticket.ts b/apps/sim/tools/intercom/get_ticket.ts index b056b94844..7ad3f77364 100644 --- a/apps/sim/tools/intercom/get_ticket.ts +++ b/apps/sim/tools/intercom/get_ticket.ts @@ -1,9 +1,6 @@ -import { createLogger } from '@sim/logger' import type { ToolConfig } from '@/tools/types' import { buildIntercomUrl, handleIntercomError } from './types' -const logger = createLogger('IntercomGetTicket') - export interface IntercomGetTicketParams { accessToken: string ticketId: string @@ -20,6 +17,42 @@ export interface IntercomGetTicketResponse { } } +export interface IntercomGetTicketV2Response { + success: boolean + output: { + ticket: any + ticketId: string + success: boolean + } +} + +const getTicketBase = { + params: { + accessToken: { + type: 'string', + required: true, + visibility: 'hidden', + description: 'Intercom API access token', + }, + ticketId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'Ticket ID to retrieve', + }, + }, + request: { + url: (params: IntercomGetTicketParams) => buildIntercomUrl(`/tickets/${params.ticketId}`), + method: 'GET', + headers: (params: IntercomGetTicketParams) => ({ + Authorization: `Bearer ${params.accessToken}`, + Accept: 'application/json', + 'Content-Type': 'application/json', + 'Intercom-Version': '2.14', + }), + }, +} satisfies Pick, 'params' | 'request'> + export const intercomGetTicketTool: ToolConfig = { id: 'intercom_get_ticket', @@ -27,31 +60,7 @@ export const intercomGetTicketTool: ToolConfig buildIntercomUrl(`/tickets/${params.ticketId}`), - method: 'GET', - headers: (params) => ({ - Authorization: `Bearer ${params.accessToken}`, - Accept: 'application/json', - 'Content-Type': 'application/json', - 'Intercom-Version': '2.14', - }), - }, + ...getTicketBase, transformResponse: async (response: Response) => { if (!response.ok) { @@ -114,3 +123,67 @@ export const intercomGetTicketTool: ToolConfig = { + ...getTicketBase, + id: 'intercom_get_ticket_v2', + name: 'Get Ticket from Intercom', + description: 'Retrieve a single ticket by ID from Intercom. Returns API-aligned fields only.', + version: '2.0.0', + + transformResponse: async (response: Response) => { + if (!response.ok) { + const data = await response.json() + handleIntercomError(data, response.status, 'get_ticket') + } + + const data = await response.json() + + return { + success: true, + output: { + ticket: data, + ticketId: data.id, + success: true, + }, + } + }, + + outputs: { + ticket: { + type: 'object', + description: 'Ticket object', + properties: { + id: { type: 'string', description: 'Unique identifier for the ticket' }, + type: { type: 'string', description: 'Object type (ticket)' }, + ticket_id: { type: 'string', description: 'Ticket ID' }, + ticket_type: { type: 'object', description: 'Type of the ticket' }, + ticket_attributes: { type: 'object', description: 'Attributes of the ticket' }, + ticket_state: { type: 'string', description: 'State of the ticket' }, + ticket_state_internal_label: { + type: 'string', + description: 'Internal label for ticket state', + }, + ticket_state_external_label: { + type: 'string', + description: 'External label for ticket state', + }, + created_at: { type: 'number', description: 'Unix timestamp when ticket was created' }, + updated_at: { + type: 'number', + description: 'Unix timestamp when ticket was last updated', + }, + contacts: { type: 'object', description: 'Contacts associated with the ticket' }, + admin_assignee_id: { type: 'string', description: 'ID of assigned admin' }, + team_assignee_id: { type: 'string', description: 'ID of assigned team' }, + is_shared: { type: 'boolean', description: 'Whether the ticket is shared' }, + open: { type: 'boolean', description: 'Whether the ticket is open' }, + }, + }, + ticketId: { type: 'string', description: 'ID of the retrieved ticket' }, + success: { type: 'boolean', description: 'Operation success status' }, + }, +} diff --git a/apps/sim/tools/intercom/index.ts b/apps/sim/tools/intercom/index.ts index dab0671ba9..626c93cfff 100644 --- a/apps/sim/tools/intercom/index.ts +++ b/apps/sim/tools/intercom/index.ts @@ -1,22 +1,31 @@ // Contact tools // Company tools -export { intercomCreateCompanyTool } from './create_company' -export { intercomCreateContactTool } from './create_contact' +export { intercomCreateCompanyTool, intercomCreateCompanyV2Tool } from './create_company' +export { intercomCreateContactTool, intercomCreateContactV2Tool } from './create_contact' // Message tools -export { intercomCreateMessageTool } from './create_message' +export { intercomCreateMessageTool, intercomCreateMessageV2Tool } from './create_message' // Ticket tools -export { intercomCreateTicketTool } from './create_ticket' -export { intercomDeleteContactTool } from './delete_contact' -export { intercomGetCompanyTool } from './get_company' -export { intercomGetContactTool } from './get_contact' +export { intercomCreateTicketTool, intercomCreateTicketV2Tool } from './create_ticket' +export { intercomDeleteContactTool, intercomDeleteContactV2Tool } from './delete_contact' +export { intercomGetCompanyTool, intercomGetCompanyV2Tool } from './get_company' +export { intercomGetContactTool, intercomGetContactV2Tool } from './get_contact' // Conversation tools -export { intercomGetConversationTool } from './get_conversation' -export { intercomGetTicketTool } from './get_ticket' -export { intercomListCompaniesTool } from './list_companies' -export { intercomListContactsTool } from './list_contacts' -export { intercomListConversationsTool } from './list_conversations' -export { intercomReplyConversationTool } from './reply_conversation' -export { intercomSearchContactsTool } from './search_contacts' -export { intercomSearchConversationsTool } from './search_conversations' -export { intercomUpdateContactTool } from './update_contact' +export { intercomGetConversationTool, intercomGetConversationV2Tool } from './get_conversation' +export { intercomGetTicketTool, intercomGetTicketV2Tool } from './get_ticket' +export { intercomListCompaniesTool, intercomListCompaniesV2Tool } from './list_companies' +export { intercomListContactsTool, intercomListContactsV2Tool } from './list_contacts' +export { + intercomListConversationsTool, + intercomListConversationsV2Tool, +} from './list_conversations' +export { + intercomReplyConversationTool, + intercomReplyConversationV2Tool, +} from './reply_conversation' +export { intercomSearchContactsTool, intercomSearchContactsV2Tool } from './search_contacts' +export { + intercomSearchConversationsTool, + intercomSearchConversationsV2Tool, +} from './search_conversations' +export { intercomUpdateContactTool, intercomUpdateContactV2Tool } from './update_contact' diff --git a/apps/sim/tools/intercom/list_companies.ts b/apps/sim/tools/intercom/list_companies.ts index fc76c093b5..d06030405d 100644 --- a/apps/sim/tools/intercom/list_companies.ts +++ b/apps/sim/tools/intercom/list_companies.ts @@ -24,16 +24,7 @@ export interface IntercomListCompaniesResponse { } } -export const intercomListCompaniesTool: ToolConfig< - IntercomListCompaniesParams, - IntercomListCompaniesResponse -> = { - id: 'intercom_list_companies', - name: 'List Companies from Intercom', - description: - 'List all companies from Intercom with pagination support. Note: This endpoint has a limit of 10,000 companies that can be returned using pagination. For datasets larger than 10,000 companies, use the Scroll API instead.', - version: '1.0.0', - +const listCompaniesBase = { params: { accessToken: { type: 'string', @@ -60,9 +51,8 @@ export const intercomListCompaniesTool: ToolConfig< description: 'Cursor for pagination (preferred over page-based pagination)', }, }, - request: { - url: (params) => { + url: (params: IntercomListCompaniesParams) => { const url = buildIntercomUrl('/companies/list') const queryParams = new URLSearchParams() @@ -74,13 +64,26 @@ export const intercomListCompaniesTool: ToolConfig< return queryString ? `${url}?${queryString}` : url }, method: 'POST', - headers: (params) => ({ + headers: (params: IntercomListCompaniesParams) => ({ Authorization: `Bearer ${params.accessToken}`, Accept: 'application/json', 'Content-Type': 'application/json', 'Intercom-Version': '2.14', }), }, +} satisfies Pick, 'params' | 'request'> + +export const intercomListCompaniesTool: ToolConfig< + IntercomListCompaniesParams, + IntercomListCompaniesResponse +> = { + id: 'intercom_list_companies', + name: 'List Companies from Intercom', + description: + 'List all companies from Intercom with pagination support. Note: This endpoint has a limit of 10,000 companies that can be returned using pagination. For datasets larger than 10,000 companies, use the Scroll API instead.', + version: '1.0.0', + + ...listCompaniesBase, transformResponse: async (response: Response) => { if (!response.ok) { @@ -156,3 +159,89 @@ export const intercomListCompaniesTool: ToolConfig< success: { type: 'boolean', description: 'Operation success status' }, }, } + +interface IntercomListCompaniesV2Response { + success: boolean + output: { + companies: any[] + pages?: any + total_count?: number + success: boolean + } +} + +export const intercomListCompaniesV2Tool: ToolConfig< + IntercomListCompaniesParams, + IntercomListCompaniesV2Response +> = { + ...listCompaniesBase, + id: 'intercom_list_companies_v2', + name: 'List Companies from Intercom', + description: + 'List all companies from Intercom with pagination support. Note: This endpoint has a limit of 10,000 companies that can be returned using pagination. For datasets larger than 10,000 companies, use the Scroll API instead.', + version: '2.0.0', + + transformResponse: async (response: Response) => { + if (!response.ok) { + const data = await response.json() + handleIntercomError(data, response.status, 'list_companies') + } + + const data = await response.json() + + return { + success: true, + output: { + companies: data.data || data.companies || [], + pages: data.pages, + total_count: data.total_count, + success: true, + }, + } + }, + + outputs: { + companies: { + type: 'array', + description: 'Array of company objects', + items: { + type: 'object', + properties: { + id: { type: 'string', description: 'Unique identifier for the company' }, + type: { type: 'string', description: 'Object type (company)' }, + app_id: { type: 'string', description: 'Intercom app ID' }, + company_id: { type: 'string', description: 'Your unique identifier for the company' }, + name: { type: 'string', description: 'Name of the company' }, + website: { type: 'string', description: 'Company website URL' }, + plan: { type: 'object', description: 'Company plan information' }, + monthly_spend: { type: 'number', description: 'Monthly revenue from this company' }, + session_count: { type: 'number', description: 'Number of sessions' }, + user_count: { type: 'number', description: 'Number of users in the company' }, + created_at: { type: 'number', description: 'Unix timestamp when company was created' }, + updated_at: { + type: 'number', + description: 'Unix timestamp when company was last updated', + }, + custom_attributes: { + type: 'object', + description: 'Custom attributes set on the company', + }, + tags: { type: 'object', description: 'Tags associated with the company' }, + segments: { type: 'object', description: 'Segments the company belongs to' }, + }, + }, + }, + pages: { + type: 'object', + description: 'Pagination information', + properties: { + type: { type: 'string', description: 'Pages type identifier' }, + page: { type: 'number', description: 'Current page number' }, + per_page: { type: 'number', description: 'Number of results per page' }, + total_pages: { type: 'number', description: 'Total number of pages' }, + }, + }, + total_count: { type: 'number', description: 'Total number of companies' }, + success: { type: 'boolean', description: 'Operation success status' }, + }, +} diff --git a/apps/sim/tools/intercom/list_contacts.ts b/apps/sim/tools/intercom/list_contacts.ts index db8abf41aa..11bf82a3fe 100644 --- a/apps/sim/tools/intercom/list_contacts.ts +++ b/apps/sim/tools/intercom/list_contacts.ts @@ -23,15 +23,7 @@ export interface IntercomListContactsResponse { } } -export const intercomListContactsTool: ToolConfig< - IntercomListContactsParams, - IntercomListContactsResponse -> = { - id: 'intercom_list_contacts', - name: 'List Contacts from Intercom', - description: 'List all contacts from Intercom with pagination support', - version: '1.0.0', - +const listContactsBase = { params: { accessToken: { type: 'string', @@ -54,7 +46,7 @@ export const intercomListContactsTool: ToolConfig< }, request: { - url: (params) => { + url: (params: IntercomListContactsParams) => { const url = buildIntercomUrl('/contacts') const queryParams = new URLSearchParams() @@ -65,13 +57,25 @@ export const intercomListContactsTool: ToolConfig< return queryString ? `${url}?${queryString}` : url }, method: 'GET', - headers: (params) => ({ + headers: (params: IntercomListContactsParams) => ({ Authorization: `Bearer ${params.accessToken}`, Accept: 'application/json', 'Content-Type': 'application/json', 'Intercom-Version': '2.14', }), }, +} satisfies Pick, 'params' | 'request'> + +export const intercomListContactsTool: ToolConfig< + IntercomListContactsParams, + IntercomListContactsResponse +> = { + id: 'intercom_list_contacts', + name: 'List Contacts from Intercom', + description: 'List all contacts from Intercom with pagination support', + version: '1.0.0', + + ...listContactsBase, transformResponse: async (response: Response) => { if (!response.ok) { @@ -145,3 +149,83 @@ export const intercomListContactsTool: ToolConfig< success: { type: 'boolean', description: 'Operation success status' }, }, } + +interface IntercomListContactsV2Response { + success: boolean + output: { + contacts: any[] + pages?: any + total_count?: number + } +} + +export const intercomListContactsV2Tool: ToolConfig< + IntercomListContactsParams, + IntercomListContactsV2Response +> = { + ...listContactsBase, + id: 'intercom_list_contacts_v2', + name: 'List Contacts from Intercom', + description: 'List all contacts from Intercom with pagination support', + version: '2.0.0', + + transformResponse: async (response: Response) => { + if (!response.ok) { + const data = await response.json() + handleIntercomError(data, response.status, 'list_contacts') + } + + const data = await response.json() + + return { + success: true, + output: { + contacts: data.data || [], + pages: data.pages, + total_count: data.total_count, + }, + } + }, + + outputs: { + contacts: { + type: 'array', + description: 'Array of contact objects', + items: { + type: 'object', + properties: { + id: { type: 'string', description: 'Unique identifier for the contact' }, + type: { type: 'string', description: 'Object type (contact)' }, + role: { type: 'string', description: 'Role of the contact (user or lead)' }, + email: { type: 'string', description: 'Email address of the contact' }, + phone: { type: 'string', description: 'Phone number of the contact' }, + name: { type: 'string', description: 'Name of the contact' }, + external_id: { type: 'string', description: 'External identifier for the contact' }, + created_at: { type: 'number', description: 'Unix timestamp when contact was created' }, + updated_at: { + type: 'number', + description: 'Unix timestamp when contact was last updated', + }, + workspace_id: { type: 'string', description: 'Workspace ID the contact belongs to' }, + custom_attributes: { + type: 'object', + description: 'Custom attributes set on the contact', + }, + tags: { type: 'object', description: 'Tags associated with the contact' }, + companies: { type: 'object', description: 'Companies associated with the contact' }, + }, + }, + }, + pages: { + type: 'object', + description: 'Pagination information', + properties: { + type: { type: 'string', description: 'Pages type identifier' }, + page: { type: 'number', description: 'Current page number' }, + per_page: { type: 'number', description: 'Number of results per page' }, + total_pages: { type: 'number', description: 'Total number of pages' }, + }, + }, + total_count: { type: 'number', description: 'Total number of contacts' }, + }, +} diff --git a/apps/sim/tools/intercom/list_conversations.ts b/apps/sim/tools/intercom/list_conversations.ts index 51056fad6d..5446e87dd4 100644 --- a/apps/sim/tools/intercom/list_conversations.ts +++ b/apps/sim/tools/intercom/list_conversations.ts @@ -25,15 +25,7 @@ export interface IntercomListConversationsResponse { } } -export const intercomListConversationsTool: ToolConfig< - IntercomListConversationsParams, - IntercomListConversationsResponse -> = { - id: 'intercom_list_conversations', - name: 'List Conversations from Intercom', - description: 'List all conversations from Intercom with pagination support', - version: '1.0.0', - +const listConversationsBase = { params: { accessToken: { type: 'string', @@ -66,9 +58,8 @@ export const intercomListConversationsTool: ToolConfig< description: 'Sort order: "asc" (ascending) or "desc" (descending)', }, }, - request: { - url: (params) => { + url: (params: IntercomListConversationsParams) => { const url = buildIntercomUrl('/conversations') const queryParams = new URLSearchParams() @@ -81,13 +72,25 @@ export const intercomListConversationsTool: ToolConfig< return queryString ? `${url}?${queryString}` : url }, method: 'GET', - headers: (params) => ({ + headers: (params: IntercomListConversationsParams) => ({ Authorization: `Bearer ${params.accessToken}`, Accept: 'application/json', 'Content-Type': 'application/json', 'Intercom-Version': '2.14', }), }, +} satisfies Pick, 'params' | 'request'> + +export const intercomListConversationsTool: ToolConfig< + IntercomListConversationsParams, + IntercomListConversationsResponse +> = { + id: 'intercom_list_conversations', + name: 'List Conversations from Intercom', + description: 'List all conversations from Intercom with pagination support', + version: '1.0.0', + + ...listConversationsBase, transformResponse: async (response: Response) => { if (!response.ok) { @@ -163,3 +166,88 @@ export const intercomListConversationsTool: ToolConfig< success: { type: 'boolean', description: 'Operation success status' }, }, } + +interface IntercomListConversationsV2Response { + success: boolean + output: { + conversations: any[] + pages?: any + total_count?: number + success: boolean + } +} + +export const intercomListConversationsV2Tool: ToolConfig< + IntercomListConversationsParams, + IntercomListConversationsV2Response +> = { + ...listConversationsBase, + id: 'intercom_list_conversations_v2', + name: 'List Conversations from Intercom', + description: 'List all conversations from Intercom with pagination support', + version: '2.0.0', + + transformResponse: async (response: Response) => { + if (!response.ok) { + const data = await response.json() + handleIntercomError(data, response.status, 'list_conversations') + } + + const data = await response.json() + + return { + success: true, + output: { + conversations: data.conversations || [], + pages: data.pages, + total_count: data.total_count, + success: true, + }, + } + }, + + outputs: { + conversations: { + type: 'array', + description: 'Array of conversation objects', + items: { + type: 'object', + properties: { + id: { type: 'string', description: 'Unique identifier for the conversation' }, + type: { type: 'string', description: 'Object type (conversation)' }, + title: { type: 'string', description: 'Title of the conversation' }, + created_at: { + type: 'number', + description: 'Unix timestamp when conversation was created', + }, + updated_at: { + type: 'number', + description: 'Unix timestamp when conversation was last updated', + }, + waiting_since: { type: 'number', description: 'Unix timestamp when waiting for reply' }, + open: { type: 'boolean', description: 'Whether the conversation is open' }, + state: { type: 'string', description: 'State of the conversation' }, + read: { type: 'boolean', description: 'Whether the conversation has been read' }, + priority: { type: 'string', description: 'Priority of the conversation' }, + admin_assignee_id: { type: 'number', description: 'ID of assigned admin' }, + team_assignee_id: { type: 'string', description: 'ID of assigned team' }, + tags: { type: 'object', description: 'Tags on the conversation' }, + source: { type: 'object', description: 'Source of the conversation' }, + contacts: { type: 'object', description: 'Contacts in the conversation' }, + }, + }, + }, + pages: { + type: 'object', + description: 'Pagination information', + properties: { + type: { type: 'string', description: 'Pages type identifier' }, + page: { type: 'number', description: 'Current page number' }, + per_page: { type: 'number', description: 'Number of results per page' }, + total_pages: { type: 'number', description: 'Total number of pages' }, + }, + }, + total_count: { type: 'number', description: 'Total number of conversations' }, + success: { type: 'boolean', description: 'Operation success status' }, + }, +} diff --git a/apps/sim/tools/intercom/reply_conversation.ts b/apps/sim/tools/intercom/reply_conversation.ts index dd9ab3a878..bde1b061c2 100644 --- a/apps/sim/tools/intercom/reply_conversation.ts +++ b/apps/sim/tools/intercom/reply_conversation.ts @@ -26,15 +26,7 @@ export interface IntercomReplyConversationResponse { } } -export const intercomReplyConversationTool: ToolConfig< - IntercomReplyConversationParams, - IntercomReplyConversationResponse -> = { - id: 'intercom_reply_conversation', - name: 'Reply to Conversation in Intercom', - description: 'Reply to a conversation as an admin in Intercom', - version: '1.0.0', - +const replyConversationBase = { params: { accessToken: { type: 'string', @@ -81,16 +73,16 @@ export const intercomReplyConversationTool: ToolConfig< 'Unix timestamp for when the reply was created. If not provided, current time is used.', }, }, - request: { - url: (params) => buildIntercomUrl(`/conversations/${params.conversationId}/reply`), + url: (params: IntercomReplyConversationParams) => + buildIntercomUrl(`/conversations/${params.conversationId}/reply`), method: 'POST', - headers: (params) => ({ + headers: (params: IntercomReplyConversationParams) => ({ Authorization: `Bearer ${params.accessToken}`, 'Content-Type': 'application/json', 'Intercom-Version': '2.14', }), - body: (params) => { + body: (params: IntercomReplyConversationParams) => { const reply: any = { message_type: params.message_type, type: 'admin', @@ -111,6 +103,18 @@ export const intercomReplyConversationTool: ToolConfig< return reply }, }, +} satisfies Pick, 'params' | 'request'> + +export const intercomReplyConversationTool: ToolConfig< + IntercomReplyConversationParams, + IntercomReplyConversationResponse +> = { + id: 'intercom_reply_conversation', + name: 'Reply to Conversation in Intercom', + description: 'Reply to a conversation as an admin in Intercom', + version: '1.0.0', + + ...replyConversationBase, transformResponse: async (response: Response) => { if (!response.ok) { @@ -170,3 +174,71 @@ export const intercomReplyConversationTool: ToolConfig< success: { type: 'boolean', description: 'Operation success status' }, }, } + +interface IntercomReplyConversationV2Response { + success: boolean + output: { + conversation: any + conversationId: string + success: boolean + } +} + +export const intercomReplyConversationV2Tool: ToolConfig< + IntercomReplyConversationParams, + IntercomReplyConversationV2Response +> = { + ...replyConversationBase, + id: 'intercom_reply_conversation_v2', + name: 'Reply to Conversation in Intercom', + description: 'Reply to a conversation as an admin in Intercom', + version: '2.0.0', + + transformResponse: async (response: Response) => { + if (!response.ok) { + const data = await response.json() + handleIntercomError(data, response.status, 'reply_conversation') + } + + const data = await response.json() + + return { + success: true, + output: { + conversation: data, + conversationId: data.id, + success: true, + }, + } + }, + + outputs: { + conversation: { + type: 'object', + description: 'Updated conversation object', + properties: { + id: { type: 'string', description: 'Unique identifier for the conversation' }, + type: { type: 'string', description: 'Object type (conversation)' }, + title: { type: 'string', description: 'Title of the conversation' }, + created_at: { type: 'number', description: 'Unix timestamp when conversation was created' }, + updated_at: { + type: 'number', + description: 'Unix timestamp when conversation was last updated', + }, + waiting_since: { type: 'number', description: 'Unix timestamp when waiting for reply' }, + open: { type: 'boolean', description: 'Whether the conversation is open' }, + state: { type: 'string', description: 'State of the conversation' }, + read: { type: 'boolean', description: 'Whether the conversation has been read' }, + priority: { type: 'string', description: 'Priority of the conversation' }, + admin_assignee_id: { type: 'number', description: 'ID of assigned admin' }, + team_assignee_id: { type: 'string', description: 'ID of assigned team' }, + tags: { type: 'object', description: 'Tags on the conversation' }, + source: { type: 'object', description: 'Source of the conversation' }, + contacts: { type: 'object', description: 'Contacts in the conversation' }, + conversation_parts: { type: 'object', description: 'Parts of the conversation' }, + }, + }, + conversationId: { type: 'string', description: 'ID of the conversation' }, + success: { type: 'boolean', description: 'Operation success status' }, + }, +} diff --git a/apps/sim/tools/intercom/search_contacts.ts b/apps/sim/tools/intercom/search_contacts.ts index 46437a1ce4..87f9ae4240 100644 --- a/apps/sim/tools/intercom/search_contacts.ts +++ b/apps/sim/tools/intercom/search_contacts.ts @@ -82,15 +82,7 @@ export interface IntercomSearchContactsResponse { } } -export const intercomSearchContactsTool: ToolConfig< - IntercomSearchContactsParams, - IntercomSearchContactsResponse -> = { - id: 'intercom_search_contacts', - name: 'Search Contacts in Intercom', - description: 'Search for contacts in Intercom using a query', - version: '1.0.0', - +const searchContactsBase = { params: { accessToken: { type: 'string', @@ -134,13 +126,13 @@ export const intercomSearchContactsTool: ToolConfig< request: { url: () => buildIntercomUrl('/contacts/search'), method: 'POST', - headers: (params) => ({ + headers: (params: IntercomSearchContactsParams) => ({ Authorization: `Bearer ${params.accessToken}`, Accept: 'application/json', 'Content-Type': 'application/json', 'Intercom-Version': '2.14', }), - body: (params) => { + body: (params: IntercomSearchContactsParams) => { let query try { query = JSON.parse(params.query) @@ -169,6 +161,18 @@ export const intercomSearchContactsTool: ToolConfig< return body }, }, +} satisfies Pick, 'params' | 'request'> + +export const intercomSearchContactsTool: ToolConfig< + IntercomSearchContactsParams, + IntercomSearchContactsResponse +> = { + id: 'intercom_search_contacts', + name: 'Search Contacts in Intercom', + description: 'Search for contacts in Intercom using a query', + version: '1.0.0', + + ...searchContactsBase, transformResponse: async (response: Response) => { if (!response.ok) { @@ -253,3 +257,150 @@ export const intercomSearchContactsTool: ToolConfig< success: { type: 'boolean', description: 'Operation success status' }, }, } + +interface IntercomSearchContactsV2Response { + success: boolean + output: { + contacts: Array<{ + id: string + type: string + role: string + email: string | null + phone: string | null + name: string | null + avatar: string | null + owner_id: string | null + external_id: string | null + created_at: number + updated_at: number + signed_up_at: number | null + last_seen_at: number | null + workspace_id: string + custom_attributes: Record + tags: { + type: string + url: string + data: any[] + has_more: boolean + total_count: number + } + notes: { + type: string + url: string + data: any[] + has_more: boolean + total_count: number + } + companies: { + type: string + url: string + data: any[] + has_more: boolean + total_count: number + } + location: { + type: string + city: string | null + region: string | null + country: string | null + country_code: string | null + continent_code: string | null + } + social_profiles: { + type: string + data: any[] + } + unsubscribed_from_emails: boolean + [key: string]: any + }> + pages: { + type: string + page: number + per_page: number + total_pages: number + } + total_count: number + } +} + +export const intercomSearchContactsV2Tool: ToolConfig< + IntercomSearchContactsParams, + IntercomSearchContactsV2Response +> = { + ...searchContactsBase, + id: 'intercom_search_contacts_v2', + name: 'Search Contacts in Intercom', + description: 'Search for contacts in Intercom using a query', + version: '2.0.0', + + transformResponse: async (response: Response) => { + if (!response.ok) { + const data = await response.json() + handleIntercomError(data, response.status, 'search_contacts') + } + + const data = await response.json() + + return { + success: true, + output: { + contacts: data.data || [], + pages: data.pages, + total_count: data.total_count, + }, + } + }, + + outputs: { + contacts: { + type: 'array', + description: 'Array of matching contact objects', + items: { + type: 'object', + properties: { + id: { type: 'string', description: 'Unique identifier for the contact' }, + type: { type: 'string', description: 'Object type (contact)' }, + role: { type: 'string', description: 'Role of the contact (user or lead)' }, + email: { type: 'string', description: 'Email address of the contact' }, + phone: { type: 'string', description: 'Phone number of the contact' }, + name: { type: 'string', description: 'Name of the contact' }, + avatar: { type: 'string', description: 'Avatar URL of the contact' }, + owner_id: { type: 'string', description: 'ID of the admin assigned to this contact' }, + external_id: { type: 'string', description: 'External identifier for the contact' }, + created_at: { type: 'number', description: 'Unix timestamp when contact was created' }, + updated_at: { + type: 'number', + description: 'Unix timestamp when contact was last updated', + }, + signed_up_at: { type: 'number', description: 'Unix timestamp when user signed up' }, + last_seen_at: { type: 'number', description: 'Unix timestamp when user was last seen' }, + workspace_id: { type: 'string', description: 'Workspace ID the contact belongs to' }, + custom_attributes: { + type: 'object', + description: 'Custom attributes set on the contact', + }, + tags: { type: 'object', description: 'Tags associated with the contact' }, + notes: { type: 'object', description: 'Notes associated with the contact' }, + companies: { type: 'object', description: 'Companies associated with the contact' }, + location: { type: 'object', description: 'Location information for the contact' }, + social_profiles: { type: 'object', description: 'Social profiles of the contact' }, + unsubscribed_from_emails: { + type: 'boolean', + description: 'Whether contact is unsubscribed from emails', + }, + }, + }, + }, + pages: { + type: 'object', + description: 'Pagination information', + properties: { + type: { type: 'string', description: 'Pages type identifier' }, + page: { type: 'number', description: 'Current page number' }, + per_page: { type: 'number', description: 'Number of results per page' }, + total_pages: { type: 'number', description: 'Total number of pages' }, + }, + }, + total_count: { type: 'number', description: 'Total number of matching contacts' }, + }, +} diff --git a/apps/sim/tools/intercom/search_conversations.ts b/apps/sim/tools/intercom/search_conversations.ts index 22b4cb130a..145f5ef3fd 100644 --- a/apps/sim/tools/intercom/search_conversations.ts +++ b/apps/sim/tools/intercom/search_conversations.ts @@ -26,15 +26,17 @@ export interface IntercomSearchConversationsResponse { } } -export const intercomSearchConversationsTool: ToolConfig< - IntercomSearchConversationsParams, - IntercomSearchConversationsResponse -> = { - id: 'intercom_search_conversations', - name: 'Search Conversations in Intercom', - description: 'Search for conversations in Intercom using a query', - version: '1.0.0', +export interface IntercomSearchConversationsV2Response { + success: boolean + output: { + conversations: any[] + pages?: any + total_count?: number + success: boolean + } +} +const searchConversationsBase = { params: { accessToken: { type: 'string', @@ -73,17 +75,16 @@ export const intercomSearchConversationsTool: ToolConfig< description: 'Sort order: "ascending" or "descending"', }, }, - request: { url: () => buildIntercomUrl('/conversations/search'), method: 'POST', - headers: (params) => ({ + headers: (params: IntercomSearchConversationsParams) => ({ Authorization: `Bearer ${params.accessToken}`, Accept: 'application/json', 'Content-Type': 'application/json', 'Intercom-Version': '2.14', }), - body: (params) => { + body: (params: IntercomSearchConversationsParams) => { let query try { query = JSON.parse(params.query) @@ -112,6 +113,18 @@ export const intercomSearchConversationsTool: ToolConfig< return body }, }, +} satisfies Pick, 'params' | 'request'> + +export const intercomSearchConversationsTool: ToolConfig< + IntercomSearchConversationsParams, + IntercomSearchConversationsResponse +> = { + id: 'intercom_search_conversations', + name: 'Search Conversations in Intercom', + description: 'Search for conversations in Intercom using a query', + version: '1.0.0', + + ...searchConversationsBase, transformResponse: async (response: Response) => { if (!response.ok) { @@ -190,3 +203,79 @@ export const intercomSearchConversationsTool: ToolConfig< success: { type: 'boolean', description: 'Operation success status' }, }, } + +export const intercomSearchConversationsV2Tool: ToolConfig< + IntercomSearchConversationsParams, + IntercomSearchConversationsV2Response +> = { + ...searchConversationsBase, + id: 'intercom_search_conversations_v2', + name: 'Search Conversations in Intercom', + description: + 'Search for conversations in Intercom using a query. Returns API-aligned fields only.', + version: '2.0.0', + + transformResponse: async (response: Response) => { + if (!response.ok) { + const data = await response.json() + handleIntercomError(data, response.status, 'search_conversations') + } + + const data = await response.json() + + return { + success: true, + output: { + conversations: data.conversations || [], + pages: data.pages, + total_count: data.total_count, + success: true, + }, + } + }, + + outputs: { + conversations: { + type: 'array', + description: 'Array of matching conversation objects', + items: { + type: 'object', + properties: { + id: { type: 'string', description: 'Unique identifier for the conversation' }, + type: { type: 'string', description: 'Object type (conversation)' }, + title: { type: 'string', description: 'Title of the conversation' }, + created_at: { + type: 'number', + description: 'Unix timestamp when conversation was created', + }, + updated_at: { + type: 'number', + description: 'Unix timestamp when conversation was last updated', + }, + waiting_since: { type: 'number', description: 'Unix timestamp when waiting for reply' }, + open: { type: 'boolean', description: 'Whether the conversation is open' }, + state: { type: 'string', description: 'State of the conversation' }, + read: { type: 'boolean', description: 'Whether the conversation has been read' }, + priority: { type: 'string', description: 'Priority of the conversation' }, + admin_assignee_id: { type: 'number', description: 'ID of assigned admin' }, + team_assignee_id: { type: 'string', description: 'ID of assigned team' }, + tags: { type: 'object', description: 'Tags on the conversation' }, + source: { type: 'object', description: 'Source of the conversation' }, + contacts: { type: 'object', description: 'Contacts in the conversation' }, + }, + }, + }, + pages: { + type: 'object', + description: 'Pagination information', + properties: { + type: { type: 'string', description: 'Pages type identifier' }, + page: { type: 'number', description: 'Current page number' }, + per_page: { type: 'number', description: 'Number of results per page' }, + total_pages: { type: 'number', description: 'Total number of pages' }, + }, + }, + total_count: { type: 'number', description: 'Total number of matching conversations' }, + success: { type: 'boolean', description: 'Operation success status' }, + }, +} diff --git a/apps/sim/tools/intercom/update_contact.ts b/apps/sim/tools/intercom/update_contact.ts index 1d7556e723..e84e1b0307 100644 --- a/apps/sim/tools/intercom/update_contact.ts +++ b/apps/sim/tools/intercom/update_contact.ts @@ -33,15 +33,7 @@ export interface IntercomUpdateContactResponse { } } -export const intercomUpdateContactTool: ToolConfig< - IntercomUpdateContactParams, - IntercomUpdateContactResponse -> = { - id: 'intercom_update_contact', - name: 'Update Contact in Intercom', - description: 'Update an existing contact in Intercom', - version: '1.0.0', - +const intercomUpdateContactBase = { params: { accessToken: { type: 'string', @@ -165,6 +157,18 @@ export const intercomUpdateContactTool: ToolConfig< return contact }, }, +} satisfies Pick, 'params' | 'request'> + +export const intercomUpdateContactTool: ToolConfig< + IntercomUpdateContactParams, + IntercomUpdateContactResponse +> = { + id: 'intercom_update_contact', + name: 'Update Contact in Intercom', + description: 'Update an existing contact in Intercom', + version: '1.0.0', + + ...intercomUpdateContactBase, transformResponse: async (response: Response) => { if (!response.ok) { @@ -227,3 +231,71 @@ export const intercomUpdateContactTool: ToolConfig< success: { type: 'boolean', description: 'Operation success status' }, }, } + +interface IntercomUpdateContactV2Response { + success: boolean + output: { + contact: any + contactId: string + } +} + +export const intercomUpdateContactV2Tool: ToolConfig< + IntercomUpdateContactParams, + IntercomUpdateContactV2Response +> = { + ...intercomUpdateContactBase, + id: 'intercom_update_contact_v2', + name: 'Update Contact in Intercom', + description: 'Update an existing contact in Intercom. Returns API-aligned fields only.', + version: '2.0.0', + + transformResponse: async (response: Response) => { + if (!response.ok) { + const data = await response.json() + handleIntercomError(data, response.status, 'update_contact') + } + + const data = await response.json() + + return { + success: true, + output: { + contact: data, + contactId: data.id, + }, + } + }, + + outputs: { + contact: { + type: 'object', + description: 'Updated contact object', + properties: { + id: { type: 'string', description: 'Unique identifier for the contact' }, + type: { type: 'string', description: 'Object type (contact)' }, + role: { type: 'string', description: 'Role of the contact (user or lead)' }, + email: { type: 'string', description: 'Email address of the contact' }, + phone: { type: 'string', description: 'Phone number of the contact' }, + name: { type: 'string', description: 'Name of the contact' }, + avatar: { type: 'string', description: 'Avatar URL of the contact' }, + owner_id: { type: 'string', description: 'ID of the admin assigned to this contact' }, + external_id: { type: 'string', description: 'External identifier for the contact' }, + created_at: { type: 'number', description: 'Unix timestamp when contact was created' }, + updated_at: { type: 'number', description: 'Unix timestamp when contact was last updated' }, + workspace_id: { type: 'string', description: 'Workspace ID the contact belongs to' }, + custom_attributes: { type: 'object', description: 'Custom attributes set on the contact' }, + tags: { type: 'object', description: 'Tags associated with the contact' }, + notes: { type: 'object', description: 'Notes associated with the contact' }, + companies: { type: 'object', description: 'Companies associated with the contact' }, + location: { type: 'object', description: 'Location information for the contact' }, + social_profiles: { type: 'object', description: 'Social profiles of the contact' }, + unsubscribed_from_emails: { + type: 'boolean', + description: 'Whether contact is unsubscribed from emails', + }, + }, + }, + contactId: { type: 'string', description: 'ID of the updated contact' }, + }, +} diff --git a/apps/sim/tools/mailchimp/add_member.ts b/apps/sim/tools/mailchimp/add_member.ts index 45ce315bd9..de1ab772ea 100644 --- a/apps/sim/tools/mailchimp/add_member.ts +++ b/apps/sim/tools/mailchimp/add_member.ts @@ -17,10 +17,7 @@ export interface MailchimpAddMemberResponse { success: boolean output: { member: MailchimpMember - metadata: { - operation: 'add_member' - subscriberHash: string - } + subscriber_hash: string success: boolean } } @@ -118,10 +115,7 @@ export const mailchimpAddMemberTool: ToolConfig< success: true, output: { member: data, - metadata: { - operation: 'add_member' as const, - subscriberHash: data.id, - }, + subscriber_hash: data.id, success: true, }, } @@ -133,8 +127,8 @@ export const mailchimpAddMemberTool: ToolConfig< type: 'object', description: 'Added member data', properties: { - member: { type: 'object', description: 'Added member object' }, - metadata: { type: 'object', description: 'Operation metadata' }, + member: { type: 'json', description: 'Added member object' }, + subscriber_hash: { type: 'string', description: 'Subscriber hash ID' }, success: { type: 'boolean', description: 'Operation success' }, }, }, diff --git a/apps/sim/tools/mailchimp/add_member_tags.ts b/apps/sim/tools/mailchimp/add_member_tags.ts index 2584d99116..936284f7ec 100644 --- a/apps/sim/tools/mailchimp/add_member_tags.ts +++ b/apps/sim/tools/mailchimp/add_member_tags.ts @@ -14,10 +14,6 @@ export interface MailchimpAddMemberTagsParams { export interface MailchimpAddMemberTagsResponse { success: boolean output: { - metadata: { - operation: 'add_member_tags' - subscriberHash: string - } success: boolean } } @@ -90,10 +86,6 @@ export const mailchimpAddMemberTagsTool: ToolConfig< return { success: true, output: { - metadata: { - operation: 'add_member_tags' as const, - subscriberHash: '', - }, success: true, }, } @@ -105,7 +97,6 @@ export const mailchimpAddMemberTagsTool: ToolConfig< type: 'object', description: 'Tag addition confirmation', properties: { - metadata: { type: 'object', description: 'Operation metadata' }, success: { type: 'boolean', description: 'Operation success' }, }, }, diff --git a/apps/sim/tools/mailchimp/add_or_update_member.ts b/apps/sim/tools/mailchimp/add_or_update_member.ts index abdfd2e750..0763c8dd4e 100644 --- a/apps/sim/tools/mailchimp/add_or_update_member.ts +++ b/apps/sim/tools/mailchimp/add_or_update_member.ts @@ -18,10 +18,7 @@ export interface MailchimpAddOrUpdateMemberResponse { success: boolean output: { member: MailchimpMember - metadata: { - operation: 'add_or_update_member' - subscriberHash: string - } + subscriber_hash: string success: boolean } } @@ -126,10 +123,7 @@ export const mailchimpAddOrUpdateMemberTool: ToolConfig< success: true, output: { member: data, - metadata: { - operation: 'add_or_update_member' as const, - subscriberHash: data.id, - }, + subscriber_hash: data.id, success: true, }, } @@ -141,8 +135,8 @@ export const mailchimpAddOrUpdateMemberTool: ToolConfig< type: 'object', description: 'Member data', properties: { - member: { type: 'object', description: 'Member object' }, - metadata: { type: 'object', description: 'Operation metadata' }, + member: { type: 'json', description: 'Member object' }, + subscriber_hash: { type: 'string', description: 'Subscriber hash ID' }, success: { type: 'boolean', description: 'Operation success' }, }, }, diff --git a/apps/sim/tools/mailchimp/add_segment_member.ts b/apps/sim/tools/mailchimp/add_segment_member.ts index 020f6d7981..b9eaa5d168 100644 --- a/apps/sim/tools/mailchimp/add_segment_member.ts +++ b/apps/sim/tools/mailchimp/add_segment_member.ts @@ -15,10 +15,6 @@ export interface MailchimpAddSegmentMemberResponse { success: boolean output: { member: MailchimpMember - metadata: { - operation: 'add_segment_member' - segmentId: string - } success: boolean } } @@ -87,10 +83,6 @@ export const mailchimpAddSegmentMemberTool: ToolConfig< success: true, output: { member: data, - metadata: { - operation: 'add_segment_member' as const, - segmentId: '', - }, success: true, }, } @@ -102,8 +94,7 @@ export const mailchimpAddSegmentMemberTool: ToolConfig< type: 'object', description: 'Added member data', properties: { - member: { type: 'object', description: 'Added member object' }, - metadata: { type: 'object', description: 'Operation metadata' }, + member: { type: 'json', description: 'Added member object' }, success: { type: 'boolean', description: 'Operation success' }, }, }, diff --git a/apps/sim/tools/mailchimp/add_subscriber_to_automation.ts b/apps/sim/tools/mailchimp/add_subscriber_to_automation.ts index ed0d6b603c..82bdcbc3b9 100644 --- a/apps/sim/tools/mailchimp/add_subscriber_to_automation.ts +++ b/apps/sim/tools/mailchimp/add_subscriber_to_automation.ts @@ -16,11 +16,6 @@ export interface MailchimpAddSubscriberToAutomationResponse { success: boolean output: { subscriber: MailchimpMember - metadata: { - operation: 'add_subscriber_to_automation' - workflowId: string - workflowEmailId: string - } success: boolean } } @@ -89,11 +84,6 @@ export const mailchimpAddSubscriberToAutomationTool: ToolConfig< success: true, output: { subscriber: data, - metadata: { - operation: 'add_subscriber_to_automation' as const, - workflowId: '', - workflowEmailId: '', - }, success: true, }, } @@ -105,8 +95,7 @@ export const mailchimpAddSubscriberToAutomationTool: ToolConfig< type: 'object', description: 'Subscriber queue data', properties: { - subscriber: { type: 'object', description: 'Subscriber object' }, - metadata: { type: 'object', description: 'Operation metadata' }, + subscriber: { type: 'json', description: 'Subscriber object' }, success: { type: 'boolean', description: 'Operation success' }, }, }, diff --git a/apps/sim/tools/mailchimp/archive_member.ts b/apps/sim/tools/mailchimp/archive_member.ts index 8189ee394c..2892474d07 100644 --- a/apps/sim/tools/mailchimp/archive_member.ts +++ b/apps/sim/tools/mailchimp/archive_member.ts @@ -13,10 +13,6 @@ export interface MailchimpArchiveMemberParams { export interface MailchimpArchiveMemberResponse { success: boolean output: { - metadata: { - operation: 'archive_member' - subscriberHash: string - } success: boolean } } @@ -73,10 +69,6 @@ export const mailchimpArchiveMemberTool: ToolConfig< return { success: true, output: { - metadata: { - operation: 'archive_member' as const, - subscriberHash: '', - }, success: true, }, } @@ -88,7 +80,6 @@ export const mailchimpArchiveMemberTool: ToolConfig< type: 'object', description: 'Archive confirmation', properties: { - metadata: { type: 'object', description: 'Operation metadata' }, success: { type: 'boolean', description: 'Operation success' }, }, }, diff --git a/apps/sim/tools/mailchimp/create_audience.ts b/apps/sim/tools/mailchimp/create_audience.ts index 789f98ea2d..d2131eb7c9 100644 --- a/apps/sim/tools/mailchimp/create_audience.ts +++ b/apps/sim/tools/mailchimp/create_audience.ts @@ -18,10 +18,7 @@ export interface MailchimpCreateAudienceResponse { success: boolean output: { list: MailchimpAudience - metadata: { - operation: 'create_audience' - listId: string - } + list_id: string success: boolean } } @@ -120,10 +117,7 @@ export const mailchimpCreateAudienceTool: ToolConfig< success: true, output: { list: data, - metadata: { - operation: 'create_audience' as const, - listId: data.id, - }, + list_id: data.id, success: true, }, } @@ -135,8 +129,8 @@ export const mailchimpCreateAudienceTool: ToolConfig< type: 'object', description: 'Created audience data', properties: { - list: { type: 'object', description: 'Created audience/list object' }, - metadata: { type: 'object', description: 'Operation metadata' }, + list: { type: 'json', description: 'Created audience/list object' }, + list_id: { type: 'string', description: 'Created audience/list ID' }, success: { type: 'boolean', description: 'Operation success' }, }, }, diff --git a/apps/sim/tools/mailchimp/create_batch_operation.ts b/apps/sim/tools/mailchimp/create_batch_operation.ts index 591627b611..bf53c828f4 100644 --- a/apps/sim/tools/mailchimp/create_batch_operation.ts +++ b/apps/sim/tools/mailchimp/create_batch_operation.ts @@ -14,10 +14,7 @@ export interface MailchimpCreateBatchOperationResponse { success: boolean output: { batch: MailchimpBatchOperation - metadata: { - operation: 'create_batch_operation' - batchId: string - } + batch_id: string success: boolean } } @@ -77,10 +74,7 @@ export const mailchimpCreateBatchOperationTool: ToolConfig< success: true, output: { batch: data, - metadata: { - operation: 'create_batch_operation' as const, - batchId: data.id, - }, + batch_id: data.id, success: true, }, } @@ -92,8 +86,8 @@ export const mailchimpCreateBatchOperationTool: ToolConfig< type: 'object', description: 'Created batch operation data', properties: { - batch: { type: 'object', description: 'Created batch operation object' }, - metadata: { type: 'object', description: 'Operation metadata' }, + batch: { type: 'json', description: 'Created batch operation object' }, + batch_id: { type: 'string', description: 'Created batch operation ID' }, success: { type: 'boolean', description: 'Operation success' }, }, }, diff --git a/apps/sim/tools/mailchimp/create_campaign.ts b/apps/sim/tools/mailchimp/create_campaign.ts index f164d2b8d4..ef7b63a1b6 100644 --- a/apps/sim/tools/mailchimp/create_campaign.ts +++ b/apps/sim/tools/mailchimp/create_campaign.ts @@ -15,10 +15,7 @@ export interface MailchimpCreateCampaignResponse { success: boolean output: { campaign: MailchimpCampaign - metadata: { - operation: 'create_campaign' - campaignId: string - } + campaign_id: string success: boolean } } @@ -103,10 +100,7 @@ export const mailchimpCreateCampaignTool: ToolConfig< success: true, output: { campaign: data, - metadata: { - operation: 'create_campaign' as const, - campaignId: data.id, - }, + campaign_id: data.id, success: true, }, } @@ -118,8 +112,8 @@ export const mailchimpCreateCampaignTool: ToolConfig< type: 'object', description: 'Created campaign data', properties: { - campaign: { type: 'object', description: 'Created campaign object' }, - metadata: { type: 'object', description: 'Operation metadata' }, + campaign: { type: 'json', description: 'Created campaign object' }, + campaign_id: { type: 'string', description: 'Created campaign ID' }, success: { type: 'boolean', description: 'Operation success' }, }, }, diff --git a/apps/sim/tools/mailchimp/create_interest.ts b/apps/sim/tools/mailchimp/create_interest.ts index cb7c0fdb08..69dc67326c 100644 --- a/apps/sim/tools/mailchimp/create_interest.ts +++ b/apps/sim/tools/mailchimp/create_interest.ts @@ -16,10 +16,7 @@ export interface MailchimpCreateInterestResponse { success: boolean output: { interest: MailchimpInterest - metadata: { - operation: 'create_interest' - interestId: string - } + interest_id: string success: boolean } } @@ -88,10 +85,7 @@ export const mailchimpCreateInterestTool: ToolConfig< success: true, output: { interest: data, - metadata: { - operation: 'create_interest' as const, - interestId: data.id, - }, + interest_id: data.id, success: true, }, } @@ -103,8 +97,8 @@ export const mailchimpCreateInterestTool: ToolConfig< type: 'object', description: 'Created interest data', properties: { - interest: { type: 'object', description: 'Created interest object' }, - metadata: { type: 'object', description: 'Operation metadata' }, + interest: { type: 'json', description: 'Created interest object' }, + interest_id: { type: 'string', description: 'Created interest ID' }, success: { type: 'boolean', description: 'Operation success' }, }, }, diff --git a/apps/sim/tools/mailchimp/create_interest_category.ts b/apps/sim/tools/mailchimp/create_interest_category.ts index 5464c9fb4f..d164f6ba02 100644 --- a/apps/sim/tools/mailchimp/create_interest_category.ts +++ b/apps/sim/tools/mailchimp/create_interest_category.ts @@ -16,10 +16,7 @@ export interface MailchimpCreateInterestCategoryResponse { success: boolean output: { category: MailchimpInterestCategory - metadata: { - operation: 'create_interest_category' - interestCategoryId: string - } + interest_category_id: string success: boolean } } @@ -86,10 +83,7 @@ export const mailchimpCreateInterestCategoryTool: ToolConfig< success: true, output: { category: data, - metadata: { - operation: 'create_interest_category' as const, - interestCategoryId: data.id, - }, + interest_category_id: data.id, success: true, }, } @@ -101,8 +95,8 @@ export const mailchimpCreateInterestCategoryTool: ToolConfig< type: 'object', description: 'Created interest category data', properties: { - category: { type: 'object', description: 'Created interest category object' }, - metadata: { type: 'object', description: 'Operation metadata' }, + category: { type: 'json', description: 'Created interest category object' }, + interest_category_id: { type: 'string', description: 'Created interest category ID' }, success: { type: 'boolean', description: 'Operation success' }, }, }, diff --git a/apps/sim/tools/mailchimp/create_landing_page.ts b/apps/sim/tools/mailchimp/create_landing_page.ts index 8df73d805a..d674456e53 100644 --- a/apps/sim/tools/mailchimp/create_landing_page.ts +++ b/apps/sim/tools/mailchimp/create_landing_page.ts @@ -15,10 +15,7 @@ export interface MailchimpCreateLandingPageResponse { success: boolean output: { landingPage: MailchimpLandingPage - metadata: { - operation: 'create_landing_page' - pageId: string - } + page_id: string success: boolean } } @@ -83,10 +80,7 @@ export const mailchimpCreateLandingPageTool: ToolConfig< success: true, output: { landingPage: data, - metadata: { - operation: 'create_landing_page' as const, - pageId: data.id, - }, + page_id: data.id, success: true, }, } @@ -98,8 +92,8 @@ export const mailchimpCreateLandingPageTool: ToolConfig< type: 'object', description: 'Created landing page data', properties: { - landingPage: { type: 'object', description: 'Created landing page object' }, - metadata: { type: 'object', description: 'Operation metadata' }, + landingPage: { type: 'json', description: 'Created landing page object' }, + page_id: { type: 'string', description: 'Created landing page ID' }, success: { type: 'boolean', description: 'Operation success' }, }, }, diff --git a/apps/sim/tools/mailchimp/create_merge_field.ts b/apps/sim/tools/mailchimp/create_merge_field.ts index a5352c7ed3..142a3f8449 100644 --- a/apps/sim/tools/mailchimp/create_merge_field.ts +++ b/apps/sim/tools/mailchimp/create_merge_field.ts @@ -16,10 +16,7 @@ export interface MailchimpCreateMergeFieldResponse { success: boolean output: { mergeField: MailchimpMergeField - metadata: { - operation: 'create_merge_field' - mergeId: string - } + merge_id: string success: boolean } } @@ -86,10 +83,7 @@ export const mailchimpCreateMergeFieldTool: ToolConfig< success: true, output: { mergeField: data, - metadata: { - operation: 'create_merge_field' as const, - mergeId: data.merge_id, - }, + merge_id: data.merge_id, success: true, }, } @@ -101,8 +95,8 @@ export const mailchimpCreateMergeFieldTool: ToolConfig< type: 'object', description: 'Created merge field data', properties: { - mergeField: { type: 'object', description: 'Created merge field object' }, - metadata: { type: 'object', description: 'Operation metadata' }, + mergeField: { type: 'json', description: 'Created merge field object' }, + merge_id: { type: 'string', description: 'Created merge field ID' }, success: { type: 'boolean', description: 'Operation success' }, }, }, diff --git a/apps/sim/tools/mailchimp/create_segment.ts b/apps/sim/tools/mailchimp/create_segment.ts index b45553982c..abec5bf5c2 100644 --- a/apps/sim/tools/mailchimp/create_segment.ts +++ b/apps/sim/tools/mailchimp/create_segment.ts @@ -16,10 +16,7 @@ export interface MailchimpCreateSegmentResponse { success: boolean output: { segment: MailchimpSegment - metadata: { - operation: 'create_segment' - segmentId: string - } + segment_id: string success: boolean } } @@ -97,10 +94,7 @@ export const mailchimpCreateSegmentTool: ToolConfig< success: true, output: { segment: data, - metadata: { - operation: 'create_segment' as const, - segmentId: data.id, - }, + segment_id: data.id, success: true, }, } @@ -112,8 +106,8 @@ export const mailchimpCreateSegmentTool: ToolConfig< type: 'object', description: 'Created segment data', properties: { - segment: { type: 'object', description: 'Created segment object' }, - metadata: { type: 'object', description: 'Operation metadata' }, + segment: { type: 'json', description: 'Created segment object' }, + segment_id: { type: 'string', description: 'Created segment ID' }, success: { type: 'boolean', description: 'Operation success' }, }, }, diff --git a/apps/sim/tools/mailchimp/create_template.ts b/apps/sim/tools/mailchimp/create_template.ts index 41c7b62068..6dd2a65746 100644 --- a/apps/sim/tools/mailchimp/create_template.ts +++ b/apps/sim/tools/mailchimp/create_template.ts @@ -14,10 +14,7 @@ export interface MailchimpCreateTemplateResponse { success: boolean output: { template: any - metadata: { - operation: 'create_template' - templateId: string - } + template_id: string success: boolean } } @@ -77,10 +74,7 @@ export const mailchimpCreateTemplateTool: ToolConfig< success: true, output: { template: data, - metadata: { - operation: 'create_template' as const, - templateId: data.id, - }, + template_id: data.id, success: true, }, } @@ -92,8 +86,8 @@ export const mailchimpCreateTemplateTool: ToolConfig< type: 'object', description: 'Created template data', properties: { - template: { type: 'object', description: 'Created template object' }, - metadata: { type: 'object', description: 'Operation metadata' }, + template: { type: 'json', description: 'Created template object' }, + template_id: { type: 'string', description: 'Created template ID' }, success: { type: 'boolean', description: 'Operation success' }, }, }, diff --git a/apps/sim/tools/mailchimp/delete_audience.ts b/apps/sim/tools/mailchimp/delete_audience.ts index cb9934c9d7..64b0ad4f17 100644 --- a/apps/sim/tools/mailchimp/delete_audience.ts +++ b/apps/sim/tools/mailchimp/delete_audience.ts @@ -11,13 +11,6 @@ export interface MailchimpDeleteAudienceParams { export interface MailchimpDeleteAudienceResponse { success: boolean - output: { - metadata: { - operation: 'delete_audience' - listId: string - } - success: boolean - } } export const mailchimpDeleteAudienceTool: ToolConfig< @@ -61,25 +54,10 @@ export const mailchimpDeleteAudienceTool: ToolConfig< return { success: true, - output: { - metadata: { - operation: 'delete_audience' as const, - listId: '', - }, - success: true, - }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, - output: { - type: 'object', - description: 'Deletion confirmation', - properties: { - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, - }, - }, + success: { type: 'boolean', description: 'Whether the audience was successfully deleted' }, }, } diff --git a/apps/sim/tools/mailchimp/delete_batch_operation.ts b/apps/sim/tools/mailchimp/delete_batch_operation.ts index 9ca85bd235..ba12ad85bb 100644 --- a/apps/sim/tools/mailchimp/delete_batch_operation.ts +++ b/apps/sim/tools/mailchimp/delete_batch_operation.ts @@ -11,13 +11,6 @@ export interface MailchimpDeleteBatchOperationParams { export interface MailchimpDeleteBatchOperationResponse { success: boolean - output: { - metadata: { - operation: 'delete_batch_operation' - batchId: string - } - success: boolean - } } export const mailchimpDeleteBatchOperationTool: ToolConfig< @@ -61,25 +54,13 @@ export const mailchimpDeleteBatchOperationTool: ToolConfig< return { success: true, - output: { - metadata: { - operation: 'delete_batch_operation' as const, - batchId: '', - }, - success: true, - }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, - output: { - type: 'object', - description: 'Deletion confirmation', - properties: { - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, - }, + success: { + type: 'boolean', + description: 'Whether the batch operation was successfully deleted', }, }, } diff --git a/apps/sim/tools/mailchimp/delete_campaign.ts b/apps/sim/tools/mailchimp/delete_campaign.ts index b6f8f1d9eb..077138c151 100644 --- a/apps/sim/tools/mailchimp/delete_campaign.ts +++ b/apps/sim/tools/mailchimp/delete_campaign.ts @@ -11,13 +11,6 @@ export interface MailchimpDeleteCampaignParams { export interface MailchimpDeleteCampaignResponse { success: boolean - output: { - metadata: { - operation: 'delete_campaign' - campaignId: string - } - success: boolean - } } export const mailchimpDeleteCampaignTool: ToolConfig< @@ -61,25 +54,10 @@ export const mailchimpDeleteCampaignTool: ToolConfig< return { success: true, - output: { - metadata: { - operation: 'delete_campaign' as const, - campaignId: '', - }, - success: true, - }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, - output: { - type: 'object', - description: 'Deletion confirmation', - properties: { - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, - }, - }, + success: { type: 'boolean', description: 'Whether the campaign was successfully deleted' }, }, } diff --git a/apps/sim/tools/mailchimp/delete_interest.ts b/apps/sim/tools/mailchimp/delete_interest.ts index cf8f50c8ab..9a69d5864e 100644 --- a/apps/sim/tools/mailchimp/delete_interest.ts +++ b/apps/sim/tools/mailchimp/delete_interest.ts @@ -13,13 +13,6 @@ export interface MailchimpDeleteInterestParams { export interface MailchimpDeleteInterestResponse { success: boolean - output: { - metadata: { - operation: 'delete_interest' - interestId: string - } - success: boolean - } } export const mailchimpDeleteInterestTool: ToolConfig< @@ -79,25 +72,10 @@ export const mailchimpDeleteInterestTool: ToolConfig< return { success: true, - output: { - metadata: { - operation: 'delete_interest' as const, - interestId: '', - }, - success: true, - }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, - output: { - type: 'object', - description: 'Deletion confirmation', - properties: { - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, - }, - }, + success: { type: 'boolean', description: 'Whether the interest was successfully deleted' }, }, } diff --git a/apps/sim/tools/mailchimp/delete_interest_category.ts b/apps/sim/tools/mailchimp/delete_interest_category.ts index 23fbc37a1d..f1918a43dd 100644 --- a/apps/sim/tools/mailchimp/delete_interest_category.ts +++ b/apps/sim/tools/mailchimp/delete_interest_category.ts @@ -12,13 +12,6 @@ export interface MailchimpDeleteInterestCategoryParams { export interface MailchimpDeleteInterestCategoryResponse { success: boolean - output: { - metadata: { - operation: 'delete_interest_category' - interestCategoryId: string - } - success: boolean - } } export const mailchimpDeleteInterestCategoryTool: ToolConfig< @@ -72,25 +65,13 @@ export const mailchimpDeleteInterestCategoryTool: ToolConfig< return { success: true, - output: { - metadata: { - operation: 'delete_interest_category' as const, - interestCategoryId: '', - }, - success: true, - }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, - output: { - type: 'object', - description: 'Deletion confirmation', - properties: { - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, - }, + success: { + type: 'boolean', + description: 'Whether the interest category was successfully deleted', }, }, } diff --git a/apps/sim/tools/mailchimp/delete_landing_page.ts b/apps/sim/tools/mailchimp/delete_landing_page.ts index 61ea6e47c6..c63894f934 100644 --- a/apps/sim/tools/mailchimp/delete_landing_page.ts +++ b/apps/sim/tools/mailchimp/delete_landing_page.ts @@ -11,13 +11,6 @@ export interface MailchimpDeleteLandingPageParams { export interface MailchimpDeleteLandingPageResponse { success: boolean - output: { - metadata: { - operation: 'delete_landing_page' - pageId: string - } - success: boolean - } } export const mailchimpDeleteLandingPageTool: ToolConfig< @@ -61,25 +54,10 @@ export const mailchimpDeleteLandingPageTool: ToolConfig< return { success: true, - output: { - metadata: { - operation: 'delete_landing_page' as const, - pageId: '', - }, - success: true, - }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, - output: { - type: 'object', - description: 'Deletion confirmation', - properties: { - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, - }, - }, + success: { type: 'boolean', description: 'Whether the landing page was successfully deleted' }, }, } diff --git a/apps/sim/tools/mailchimp/delete_member.ts b/apps/sim/tools/mailchimp/delete_member.ts index a74da3f52c..72090b5ab7 100644 --- a/apps/sim/tools/mailchimp/delete_member.ts +++ b/apps/sim/tools/mailchimp/delete_member.ts @@ -12,13 +12,6 @@ export interface MailchimpDeleteMemberParams { export interface MailchimpDeleteMemberResponse { success: boolean - output: { - metadata: { - operation: 'delete_member' - subscriberHash: string - } - success: boolean - } } export const mailchimpDeleteMemberTool: ToolConfig< @@ -69,25 +62,10 @@ export const mailchimpDeleteMemberTool: ToolConfig< return { success: true, - output: { - metadata: { - operation: 'delete_member' as const, - subscriberHash: '', - }, - success: true, - }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, - output: { - type: 'object', - description: 'Deletion confirmation', - properties: { - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, - }, - }, + success: { type: 'boolean', description: 'Whether the member was successfully deleted' }, }, } diff --git a/apps/sim/tools/mailchimp/delete_merge_field.ts b/apps/sim/tools/mailchimp/delete_merge_field.ts index f04a2492de..f7a0f5201d 100644 --- a/apps/sim/tools/mailchimp/delete_merge_field.ts +++ b/apps/sim/tools/mailchimp/delete_merge_field.ts @@ -12,13 +12,6 @@ export interface MailchimpDeleteMergeFieldParams { export interface MailchimpDeleteMergeFieldResponse { success: boolean - output: { - metadata: { - operation: 'delete_merge_field' - mergeId: string - } - success: boolean - } } export const mailchimpDeleteMergeFieldTool: ToolConfig< @@ -69,25 +62,10 @@ export const mailchimpDeleteMergeFieldTool: ToolConfig< return { success: true, - output: { - metadata: { - operation: 'delete_merge_field' as const, - mergeId: '', - }, - success: true, - }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, - output: { - type: 'object', - description: 'Deletion confirmation', - properties: { - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, - }, - }, + success: { type: 'boolean', description: 'Whether the merge field was successfully deleted' }, }, } diff --git a/apps/sim/tools/mailchimp/delete_segment.ts b/apps/sim/tools/mailchimp/delete_segment.ts index 3e89c20bad..4d4f91f880 100644 --- a/apps/sim/tools/mailchimp/delete_segment.ts +++ b/apps/sim/tools/mailchimp/delete_segment.ts @@ -12,13 +12,6 @@ export interface MailchimpDeleteSegmentParams { export interface MailchimpDeleteSegmentResponse { success: boolean - output: { - metadata: { - operation: 'delete_segment' - segmentId: string - } - success: boolean - } } export const mailchimpDeleteSegmentTool: ToolConfig< @@ -69,25 +62,10 @@ export const mailchimpDeleteSegmentTool: ToolConfig< return { success: true, - output: { - metadata: { - operation: 'delete_segment' as const, - segmentId: '', - }, - success: true, - }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, - output: { - type: 'object', - description: 'Deletion confirmation', - properties: { - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, - }, - }, + success: { type: 'boolean', description: 'Whether the segment was successfully deleted' }, }, } diff --git a/apps/sim/tools/mailchimp/delete_template.ts b/apps/sim/tools/mailchimp/delete_template.ts index effb32ca1c..33cf01ccca 100644 --- a/apps/sim/tools/mailchimp/delete_template.ts +++ b/apps/sim/tools/mailchimp/delete_template.ts @@ -11,13 +11,6 @@ export interface MailchimpDeleteTemplateParams { export interface MailchimpDeleteTemplateResponse { success: boolean - output: { - metadata: { - operation: 'delete_template' - templateId: string - } - success: boolean - } } export const mailchimpDeleteTemplateTool: ToolConfig< @@ -61,25 +54,10 @@ export const mailchimpDeleteTemplateTool: ToolConfig< return { success: true, - output: { - metadata: { - operation: 'delete_template' as const, - templateId: '', - }, - success: true, - }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, - output: { - type: 'object', - description: 'Deletion confirmation', - properties: { - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, - }, - }, + success: { type: 'boolean', description: 'Whether the template was successfully deleted' }, }, } diff --git a/apps/sim/tools/mailchimp/get_audience.ts b/apps/sim/tools/mailchimp/get_audience.ts index ebe9a5f16e..5b9fb183b9 100644 --- a/apps/sim/tools/mailchimp/get_audience.ts +++ b/apps/sim/tools/mailchimp/get_audience.ts @@ -14,11 +14,7 @@ export interface MailchimpGetAudienceResponse { success: boolean output: { list: MailchimpAudience - metadata: { - operation: 'get_audience' - listId: string - } - success: boolean + list_id: string } } @@ -67,24 +63,19 @@ export const mailchimpGetAudienceTool: ToolConfig< success: true, output: { list: data, - metadata: { - operation: 'get_audience' as const, - listId: data.id, - }, - success: true, + list_id: data.id, }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, + success: { type: 'boolean', description: 'Whether the audience was successfully retrieved' }, output: { type: 'object', - description: 'Audience data and metadata', + description: 'Audience data', properties: { - list: { type: 'object', description: 'Audience/list object' }, - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, + list: { type: 'json', description: 'Audience/list object' }, + list_id: { type: 'string', description: 'The unique ID of the audience' }, }, }, }, diff --git a/apps/sim/tools/mailchimp/get_audiences.ts b/apps/sim/tools/mailchimp/get_audiences.ts index dcb4497179..f8ca125fe2 100644 --- a/apps/sim/tools/mailchimp/get_audiences.ts +++ b/apps/sim/tools/mailchimp/get_audiences.ts @@ -15,12 +15,8 @@ export interface MailchimpGetAudiencesResponse { success: boolean output: { lists: MailchimpAudience[] - totalItems: number - metadata: { - operation: 'get_audiences' - totalReturned: number - } - success: boolean + total_items: number + total_returned: number } } @@ -84,26 +80,24 @@ export const mailchimpGetAudiencesTool: ToolConfig< success: true, output: { lists, - totalItems: data.total_items || lists.length, - metadata: { - operation: 'get_audiences' as const, - totalReturned: lists.length, - }, - success: true, + total_items: data.total_items || lists.length, + total_returned: lists.length, }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, + success: { type: 'boolean', description: 'Whether the audiences were successfully retrieved' }, output: { type: 'object', - description: 'Audiences data and metadata', + description: 'Audiences data', properties: { - lists: { type: 'array', description: 'Array of audience/list objects' }, - totalItems: { type: 'number', description: 'Total number of lists' }, - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, + lists: { type: 'json', description: 'Array of audience/list objects' }, + total_items: { type: 'number', description: 'Total number of lists' }, + total_returned: { + type: 'number', + description: 'Number of lists returned in this response', + }, }, }, }, diff --git a/apps/sim/tools/mailchimp/get_automation.ts b/apps/sim/tools/mailchimp/get_automation.ts index fc4736392a..82062b5e95 100644 --- a/apps/sim/tools/mailchimp/get_automation.ts +++ b/apps/sim/tools/mailchimp/get_automation.ts @@ -14,11 +14,7 @@ export interface MailchimpGetAutomationResponse { success: boolean output: { automation: MailchimpAutomation - metadata: { - operation: 'get_automation' - workflowId: string - } - success: boolean + workflow_id: string } } @@ -67,24 +63,19 @@ export const mailchimpGetAutomationTool: ToolConfig< success: true, output: { automation: data, - metadata: { - operation: 'get_automation' as const, - workflowId: data.id, - }, - success: true, + workflow_id: data.id, }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, + success: { type: 'boolean', description: 'Whether the automation was successfully retrieved' }, output: { type: 'object', - description: 'Automation data and metadata', + description: 'Automation data', properties: { - automation: { type: 'object', description: 'Automation object' }, - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, + automation: { type: 'json', description: 'Automation object' }, + workflow_id: { type: 'string', description: 'The unique ID of the automation workflow' }, }, }, }, diff --git a/apps/sim/tools/mailchimp/get_automations.ts b/apps/sim/tools/mailchimp/get_automations.ts index f27b396d92..d2df8aa48d 100644 --- a/apps/sim/tools/mailchimp/get_automations.ts +++ b/apps/sim/tools/mailchimp/get_automations.ts @@ -15,12 +15,8 @@ export interface MailchimpGetAutomationsResponse { success: boolean output: { automations: MailchimpAutomation[] - totalItems: number - metadata: { - operation: 'get_automations' - totalReturned: number - } - success: boolean + total_items: number + total_returned: number } } @@ -84,26 +80,27 @@ export const mailchimpGetAutomationsTool: ToolConfig< success: true, output: { automations, - totalItems: data.total_items || automations.length, - metadata: { - operation: 'get_automations' as const, - totalReturned: automations.length, - }, - success: true, + total_items: data.total_items || automations.length, + total_returned: automations.length, }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, + success: { + type: 'boolean', + description: 'Whether the automations were successfully retrieved', + }, output: { type: 'object', - description: 'Automations data and metadata', + description: 'Automations data', properties: { - automations: { type: 'array', description: 'Array of automation objects' }, - totalItems: { type: 'number', description: 'Total number of automations' }, - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, + automations: { type: 'json', description: 'Array of automation objects' }, + total_items: { type: 'number', description: 'Total number of automations' }, + total_returned: { + type: 'number', + description: 'Number of automations returned in this response', + }, }, }, }, diff --git a/apps/sim/tools/mailchimp/get_batch_operation.ts b/apps/sim/tools/mailchimp/get_batch_operation.ts index abd63a5f65..1784878aec 100644 --- a/apps/sim/tools/mailchimp/get_batch_operation.ts +++ b/apps/sim/tools/mailchimp/get_batch_operation.ts @@ -14,11 +14,7 @@ export interface MailchimpGetBatchOperationResponse { success: boolean output: { batch: MailchimpBatchOperation - metadata: { - operation: 'get_batch_operation' - batchId: string - } - success: boolean + batch_id: string } } @@ -67,24 +63,22 @@ export const mailchimpGetBatchOperationTool: ToolConfig< success: true, output: { batch: data, - metadata: { - operation: 'get_batch_operation' as const, - batchId: data.id, - }, - success: true, + batch_id: data.id, }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, + success: { + type: 'boolean', + description: 'Whether the batch operation was successfully retrieved', + }, output: { type: 'object', - description: 'Batch operation data and metadata', + description: 'Batch operation data', properties: { - batch: { type: 'object', description: 'Batch operation object' }, - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, + batch: { type: 'json', description: 'Batch operation object' }, + batch_id: { type: 'string', description: 'The unique ID of the batch operation' }, }, }, }, diff --git a/apps/sim/tools/mailchimp/get_batch_operations.ts b/apps/sim/tools/mailchimp/get_batch_operations.ts index 652d6461ca..ea5f6b76e7 100644 --- a/apps/sim/tools/mailchimp/get_batch_operations.ts +++ b/apps/sim/tools/mailchimp/get_batch_operations.ts @@ -15,12 +15,8 @@ export interface MailchimpGetBatchOperationsResponse { success: boolean output: { batches: MailchimpBatchOperation[] - totalItems: number - metadata: { - operation: 'get_batch_operations' - totalReturned: number - } - success: boolean + total_items: number + total_returned: number } } @@ -84,26 +80,27 @@ export const mailchimpGetBatchOperationsTool: ToolConfig< success: true, output: { batches, - totalItems: data.total_items || batches.length, - metadata: { - operation: 'get_batch_operations' as const, - totalReturned: batches.length, - }, - success: true, + total_items: data.total_items || batches.length, + total_returned: batches.length, }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, + success: { + type: 'boolean', + description: 'Whether the batch operations were successfully retrieved', + }, output: { type: 'object', - description: 'Batch operations data and metadata', + description: 'Batch operations data', properties: { - batches: { type: 'array', description: 'Array of batch operation objects' }, - totalItems: { type: 'number', description: 'Total number of batch operations' }, - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, + batches: { type: 'json', description: 'Array of batch operation objects' }, + total_items: { type: 'number', description: 'Total number of batch operations' }, + total_returned: { + type: 'number', + description: 'Number of batch operations returned in this response', + }, }, }, }, diff --git a/apps/sim/tools/mailchimp/get_campaign.ts b/apps/sim/tools/mailchimp/get_campaign.ts index b52a6ca3b1..1562566f6d 100644 --- a/apps/sim/tools/mailchimp/get_campaign.ts +++ b/apps/sim/tools/mailchimp/get_campaign.ts @@ -13,11 +13,7 @@ export interface MailchimpGetCampaignResponse { success: boolean output: { campaign: MailchimpCampaign - metadata: { - operation: 'get_campaign' - campaignId: string - } - success: boolean + campaign_id: string } } @@ -66,24 +62,19 @@ export const mailchimpGetCampaignTool: ToolConfig< success: true, output: { campaign: data, - metadata: { - operation: 'get_campaign' as const, - campaignId: data.id, - }, - success: true, + campaign_id: data.id, }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, + success: { type: 'boolean', description: 'Whether the campaign was successfully retrieved' }, output: { type: 'object', - description: 'Campaign data and metadata', + description: 'Campaign data', properties: { - campaign: { type: 'object', description: 'Campaign object' }, - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, + campaign: { type: 'json', description: 'Campaign object' }, + campaign_id: { type: 'string', description: 'The unique ID of the campaign' }, }, }, }, diff --git a/apps/sim/tools/mailchimp/get_campaign_content.ts b/apps/sim/tools/mailchimp/get_campaign_content.ts index eb91a1facf..978ffbe415 100644 --- a/apps/sim/tools/mailchimp/get_campaign_content.ts +++ b/apps/sim/tools/mailchimp/get_campaign_content.ts @@ -13,11 +13,6 @@ export interface MailchimpGetCampaignContentResponse { success: boolean output: { content: MailchimpCampaignContent - metadata: { - operation: 'get_campaign_content' - campaignId: string - } - success: boolean } } @@ -66,24 +61,20 @@ export const mailchimpGetCampaignContentTool: ToolConfig< success: true, output: { content: data, - metadata: { - operation: 'get_campaign_content' as const, - campaignId: '', - }, - success: true, }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, + success: { + type: 'boolean', + description: 'Whether the campaign content was successfully retrieved', + }, output: { type: 'object', description: 'Campaign content data', properties: { - content: { type: 'object', description: 'Campaign content object' }, - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, + content: { type: 'json', description: 'Campaign content object' }, }, }, }, diff --git a/apps/sim/tools/mailchimp/get_campaign_report.ts b/apps/sim/tools/mailchimp/get_campaign_report.ts index e9ffd2447f..2babba6891 100644 --- a/apps/sim/tools/mailchimp/get_campaign_report.ts +++ b/apps/sim/tools/mailchimp/get_campaign_report.ts @@ -13,11 +13,7 @@ export interface MailchimpGetCampaignReportResponse { success: boolean output: { report: MailchimpCampaignReport - metadata: { - operation: 'get_campaign_report' - campaignId: string - } - success: boolean + campaign_id: string } } @@ -66,24 +62,22 @@ export const mailchimpGetCampaignReportTool: ToolConfig< success: true, output: { report: data, - metadata: { - operation: 'get_campaign_report' as const, - campaignId: data.campaign_id, - }, - success: true, + campaign_id: data.campaign_id, }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, + success: { + type: 'boolean', + description: 'Whether the campaign report was successfully retrieved', + }, output: { type: 'object', - description: 'Campaign report data and metadata', + description: 'Campaign report data', properties: { - report: { type: 'object', description: 'Campaign report object' }, - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, + report: { type: 'json', description: 'Campaign report object' }, + campaign_id: { type: 'string', description: 'The unique ID of the campaign' }, }, }, }, diff --git a/apps/sim/tools/mailchimp/get_campaign_reports.ts b/apps/sim/tools/mailchimp/get_campaign_reports.ts index 20924e192e..ee5fe8c297 100644 --- a/apps/sim/tools/mailchimp/get_campaign_reports.ts +++ b/apps/sim/tools/mailchimp/get_campaign_reports.ts @@ -14,12 +14,8 @@ export interface MailchimpGetCampaignReportsResponse { success: boolean output: { reports: MailchimpCampaignReport[] - totalItems: number - metadata: { - operation: 'get_campaign_reports' - totalReturned: number - } - success: boolean + total_items: number + total_returned: number } } @@ -83,26 +79,27 @@ export const mailchimpGetCampaignReportsTool: ToolConfig< success: true, output: { reports, - totalItems: data.total_items || reports.length, - metadata: { - operation: 'get_campaign_reports' as const, - totalReturned: reports.length, - }, - success: true, + total_items: data.total_items || reports.length, + total_returned: reports.length, }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, + success: { + type: 'boolean', + description: 'Whether the campaign reports were successfully retrieved', + }, output: { type: 'object', - description: 'Campaign reports data and metadata', + description: 'Campaign reports data', properties: { - reports: { type: 'array', description: 'Array of campaign report objects' }, - totalItems: { type: 'number', description: 'Total number of reports' }, - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, + reports: { type: 'json', description: 'Array of campaign report objects' }, + total_items: { type: 'number', description: 'Total number of reports' }, + total_returned: { + type: 'number', + description: 'Number of reports returned in this response', + }, }, }, }, diff --git a/apps/sim/tools/mailchimp/get_campaigns.ts b/apps/sim/tools/mailchimp/get_campaigns.ts index 596fc3b570..aa9d8dcaa2 100644 --- a/apps/sim/tools/mailchimp/get_campaigns.ts +++ b/apps/sim/tools/mailchimp/get_campaigns.ts @@ -16,12 +16,8 @@ export interface MailchimpGetCampaignsResponse { success: boolean output: { campaigns: MailchimpCampaign[] - totalItems: number - metadata: { - operation: 'get_campaigns' - totalReturned: number - } - success: boolean + total_items: number + total_returned: number } } @@ -99,26 +95,24 @@ export const mailchimpGetCampaignsTool: ToolConfig< success: true, output: { campaigns, - totalItems: data.total_items || campaigns.length, - metadata: { - operation: 'get_campaigns' as const, - totalReturned: campaigns.length, - }, - success: true, + total_items: data.total_items || campaigns.length, + total_returned: campaigns.length, }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, + success: { type: 'boolean', description: 'Whether the campaigns were successfully retrieved' }, output: { type: 'object', - description: 'Campaigns data and metadata', + description: 'Campaigns data', properties: { - campaigns: { type: 'array', description: 'Array of campaign objects' }, - totalItems: { type: 'number', description: 'Total number of campaigns' }, - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, + campaigns: { type: 'json', description: 'Array of campaign objects' }, + total_items: { type: 'number', description: 'Total number of campaigns' }, + total_returned: { + type: 'number', + description: 'Number of campaigns returned in this response', + }, }, }, }, diff --git a/apps/sim/tools/mailchimp/get_interest.ts b/apps/sim/tools/mailchimp/get_interest.ts index d7e56a9751..53500d1781 100644 --- a/apps/sim/tools/mailchimp/get_interest.ts +++ b/apps/sim/tools/mailchimp/get_interest.ts @@ -16,11 +16,7 @@ export interface MailchimpGetInterestResponse { success: boolean output: { interest: MailchimpInterest - metadata: { - operation: 'get_interest' - interestId: string - } - success: boolean + interest_id: string } } @@ -86,24 +82,19 @@ export const mailchimpGetInterestTool: ToolConfig< success: true, output: { interest: data, - metadata: { - operation: 'get_interest' as const, - interestId: data.id, - }, - success: true, + interest_id: data.id, }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, + success: { type: 'boolean', description: 'Whether the interest was successfully retrieved' }, output: { type: 'object', - description: 'Interest data and metadata', + description: 'Interest data', properties: { - interest: { type: 'object', description: 'Interest object' }, - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, + interest: { type: 'json', description: 'Interest object' }, + interest_id: { type: 'string', description: 'The unique ID of the interest' }, }, }, }, diff --git a/apps/sim/tools/mailchimp/get_interest_categories.ts b/apps/sim/tools/mailchimp/get_interest_categories.ts index c624041ce2..9f9f23133f 100644 --- a/apps/sim/tools/mailchimp/get_interest_categories.ts +++ b/apps/sim/tools/mailchimp/get_interest_categories.ts @@ -15,12 +15,8 @@ export interface MailchimpGetInterestCategoriesResponse { success: boolean output: { categories: any[] - totalItems: number - metadata: { - operation: 'get_interest_categories' - totalReturned: number - } - success: boolean + total_items: number + total_returned: number } } @@ -90,26 +86,27 @@ export const mailchimpGetInterestCategoriesTool: ToolConfig< success: true, output: { categories, - totalItems: data.total_items || categories.length, - metadata: { - operation: 'get_interest_categories' as const, - totalReturned: categories.length, - }, - success: true, + total_items: data.total_items || categories.length, + total_returned: categories.length, }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, + success: { + type: 'boolean', + description: 'Whether the interest categories were successfully retrieved', + }, output: { type: 'object', - description: 'Interest categories data and metadata', + description: 'Interest categories data', properties: { - categories: { type: 'array', description: 'Array of interest category objects' }, - totalItems: { type: 'number', description: 'Total number of categories' }, - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, + categories: { type: 'json', description: 'Array of interest category objects' }, + total_items: { type: 'number', description: 'Total number of categories' }, + total_returned: { + type: 'number', + description: 'Number of categories returned in this response', + }, }, }, }, diff --git a/apps/sim/tools/mailchimp/get_interest_category.ts b/apps/sim/tools/mailchimp/get_interest_category.ts index 24248d8fd6..a2277434fa 100644 --- a/apps/sim/tools/mailchimp/get_interest_category.ts +++ b/apps/sim/tools/mailchimp/get_interest_category.ts @@ -15,11 +15,7 @@ export interface MailchimpGetInterestCategoryResponse { success: boolean output: { category: MailchimpInterestCategory - metadata: { - operation: 'get_interest_category' - interestCategoryId: string - } - success: boolean + interest_category_id: string } } @@ -78,24 +74,25 @@ export const mailchimpGetInterestCategoryTool: ToolConfig< success: true, output: { category: data, - metadata: { - operation: 'get_interest_category' as const, - interestCategoryId: data.id, - }, - success: true, + interest_category_id: data.id, }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, + success: { + type: 'boolean', + description: 'Whether the interest category was successfully retrieved', + }, output: { type: 'object', - description: 'Interest category data and metadata', + description: 'Interest category data', properties: { - category: { type: 'object', description: 'Interest category object' }, - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, + category: { type: 'json', description: 'Interest category object' }, + interest_category_id: { + type: 'string', + description: 'The unique ID of the interest category', + }, }, }, }, diff --git a/apps/sim/tools/mailchimp/get_interests.ts b/apps/sim/tools/mailchimp/get_interests.ts index 54446457b1..7e0f8d5a48 100644 --- a/apps/sim/tools/mailchimp/get_interests.ts +++ b/apps/sim/tools/mailchimp/get_interests.ts @@ -16,12 +16,8 @@ export interface MailchimpGetInterestsResponse { success: boolean output: { interests: any[] - totalItems: number - metadata: { - operation: 'get_interests' - totalReturned: number - } - success: boolean + total_items: number + total_returned: number } } @@ -100,26 +96,24 @@ export const mailchimpGetInterestsTool: ToolConfig< success: true, output: { interests, - totalItems: data.total_items || interests.length, - metadata: { - operation: 'get_interests' as const, - totalReturned: interests.length, - }, - success: true, + total_items: data.total_items || interests.length, + total_returned: interests.length, }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, + success: { type: 'boolean', description: 'Whether the interests were successfully retrieved' }, output: { type: 'object', - description: 'Interests data and metadata', + description: 'Interests data', properties: { - interests: { type: 'array', description: 'Array of interest objects' }, - totalItems: { type: 'number', description: 'Total number of interests' }, - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, + interests: { type: 'json', description: 'Array of interest objects' }, + total_items: { type: 'number', description: 'Total number of interests' }, + total_returned: { + type: 'number', + description: 'Number of interests returned in this response', + }, }, }, }, diff --git a/apps/sim/tools/mailchimp/get_landing_page.ts b/apps/sim/tools/mailchimp/get_landing_page.ts index c624f106bb..4b4f3a2ad4 100644 --- a/apps/sim/tools/mailchimp/get_landing_page.ts +++ b/apps/sim/tools/mailchimp/get_landing_page.ts @@ -14,11 +14,7 @@ export interface MailchimpGetLandingPageResponse { success: boolean output: { landingPage: MailchimpLandingPage - metadata: { - operation: 'get_landing_page' - pageId: string - } - success: boolean + page_id: string } } @@ -67,24 +63,22 @@ export const mailchimpGetLandingPageTool: ToolConfig< success: true, output: { landingPage: data, - metadata: { - operation: 'get_landing_page' as const, - pageId: data.id, - }, - success: true, + page_id: data.id, }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, + success: { + type: 'boolean', + description: 'Whether the landing page was successfully retrieved', + }, output: { type: 'object', - description: 'Landing page data and metadata', + description: 'Landing page data', properties: { - landingPage: { type: 'object', description: 'Landing page object' }, - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, + landingPage: { type: 'json', description: 'Landing page object' }, + page_id: { type: 'string', description: 'The unique ID of the landing page' }, }, }, }, diff --git a/apps/sim/tools/mailchimp/get_landing_pages.ts b/apps/sim/tools/mailchimp/get_landing_pages.ts index 548c4eb1b6..ccc777bba7 100644 --- a/apps/sim/tools/mailchimp/get_landing_pages.ts +++ b/apps/sim/tools/mailchimp/get_landing_pages.ts @@ -15,12 +15,8 @@ export interface MailchimpGetLandingPagesResponse { success: boolean output: { landingPages: MailchimpLandingPage[] - totalItems: number - metadata: { - operation: 'get_landing_pages' - totalReturned: number - } - success: boolean + total_items: number + total_returned: number } } @@ -84,26 +80,27 @@ export const mailchimpGetLandingPagesTool: ToolConfig< success: true, output: { landingPages, - totalItems: data.total_items || landingPages.length, - metadata: { - operation: 'get_landing_pages' as const, - totalReturned: landingPages.length, - }, - success: true, + total_items: data.total_items || landingPages.length, + total_returned: landingPages.length, }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, + success: { + type: 'boolean', + description: 'Whether the landing pages were successfully retrieved', + }, output: { type: 'object', - description: 'Landing pages data and metadata', + description: 'Landing pages data', properties: { - landingPages: { type: 'array', description: 'Array of landing page objects' }, - totalItems: { type: 'number', description: 'Total number of landing pages' }, - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, + landingPages: { type: 'json', description: 'Array of landing page objects' }, + total_items: { type: 'number', description: 'Total number of landing pages' }, + total_returned: { + type: 'number', + description: 'Number of landing pages returned in this response', + }, }, }, }, diff --git a/apps/sim/tools/mailchimp/get_member.ts b/apps/sim/tools/mailchimp/get_member.ts index e19ae22fd6..dd886f6b16 100644 --- a/apps/sim/tools/mailchimp/get_member.ts +++ b/apps/sim/tools/mailchimp/get_member.ts @@ -14,11 +14,7 @@ export interface MailchimpGetMemberResponse { success: boolean output: { member: MailchimpMember - metadata: { - operation: 'get_member' - subscriberHash: string - } - success: boolean + subscriber_hash: string } } @@ -74,24 +70,22 @@ export const mailchimpGetMemberTool: ToolConfig< success: true, output: { member: data, - metadata: { - operation: 'get_member' as const, - subscriberHash: data.id, - }, - success: true, + subscriber_hash: data.id, }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, + success: { type: 'boolean', description: 'Whether the member was successfully retrieved' }, output: { type: 'object', - description: 'Member data and metadata', + description: 'Member data', properties: { - member: { type: 'object', description: 'Member object' }, - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, + member: { type: 'json', description: 'Member object' }, + subscriber_hash: { + type: 'string', + description: 'The MD5 hash of the member email address', + }, }, }, }, diff --git a/apps/sim/tools/mailchimp/get_member_tags.ts b/apps/sim/tools/mailchimp/get_member_tags.ts index 06f17b6189..93966daf32 100644 --- a/apps/sim/tools/mailchimp/get_member_tags.ts +++ b/apps/sim/tools/mailchimp/get_member_tags.ts @@ -14,12 +14,8 @@ export interface MailchimpGetMemberTagsResponse { success: boolean output: { tags: MailchimpTag[] - totalItems: number - metadata: { - operation: 'get_member_tags' - totalReturned: number - } - success: boolean + total_items: number + total_returned: number } } @@ -79,26 +75,24 @@ export const mailchimpGetMemberTagsTool: ToolConfig< success: true, output: { tags, - totalItems: data.total_items || tags.length, - metadata: { - operation: 'get_member_tags' as const, - totalReturned: tags.length, - }, - success: true, + total_items: data.total_items || tags.length, + total_returned: tags.length, }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, + success: { + type: 'boolean', + description: 'Whether the member tags were successfully retrieved', + }, output: { type: 'object', - description: 'Member tags data and metadata', + description: 'Member tags data', properties: { - tags: { type: 'array', description: 'Array of tag objects' }, - totalItems: { type: 'number', description: 'Total number of tags' }, - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, + tags: { type: 'json', description: 'Array of tag objects' }, + total_items: { type: 'number', description: 'Total number of tags' }, + total_returned: { type: 'number', description: 'Number of tags returned in this response' }, }, }, }, diff --git a/apps/sim/tools/mailchimp/get_members.ts b/apps/sim/tools/mailchimp/get_members.ts index 42e7220d15..259531f416 100644 --- a/apps/sim/tools/mailchimp/get_members.ts +++ b/apps/sim/tools/mailchimp/get_members.ts @@ -16,12 +16,8 @@ export interface MailchimpGetMembersResponse { success: boolean output: { members: MailchimpMember[] - totalItems: number - metadata: { - operation: 'get_members' - totalReturned: number - } - success: boolean + total_items: number + total_returned: number } } @@ -98,26 +94,24 @@ export const mailchimpGetMembersTool: ToolConfig< success: true, output: { members, - totalItems: data.total_items || members.length, - metadata: { - operation: 'get_members' as const, - totalReturned: members.length, - }, - success: true, + total_items: data.total_items || members.length, + total_returned: members.length, }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, + success: { type: 'boolean', description: 'Whether the members were successfully retrieved' }, output: { type: 'object', - description: 'Members data and metadata', + description: 'Members data', properties: { - members: { type: 'array', description: 'Array of member objects' }, - totalItems: { type: 'number', description: 'Total number of members' }, - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, + members: { type: 'json', description: 'Array of member objects' }, + total_items: { type: 'number', description: 'Total number of members' }, + total_returned: { + type: 'number', + description: 'Number of members returned in this response', + }, }, }, }, diff --git a/apps/sim/tools/mailchimp/get_merge_field.ts b/apps/sim/tools/mailchimp/get_merge_field.ts index 25bd428808..fc4b12dfc7 100644 --- a/apps/sim/tools/mailchimp/get_merge_field.ts +++ b/apps/sim/tools/mailchimp/get_merge_field.ts @@ -14,11 +14,7 @@ export interface MailchimpGetMergeFieldResponse { success: boolean output: { mergeField: any - metadata: { - operation: 'get_merge_field' - mergeId: string - } - success: boolean + merge_id: string } } @@ -74,24 +70,19 @@ export const mailchimpGetMergeFieldTool: ToolConfig< success: true, output: { mergeField: data, - metadata: { - operation: 'get_merge_field' as const, - mergeId: data.merge_id, - }, - success: true, + merge_id: data.merge_id, }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, + success: { type: 'boolean', description: 'Whether the merge field was successfully retrieved' }, output: { type: 'object', - description: 'Merge field data and metadata', + description: 'Merge field data', properties: { - mergeField: { type: 'object', description: 'Merge field object' }, - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, + mergeField: { type: 'json', description: 'Merge field object' }, + merge_id: { type: 'string', description: 'The unique ID of the merge field' }, }, }, }, diff --git a/apps/sim/tools/mailchimp/get_merge_fields.ts b/apps/sim/tools/mailchimp/get_merge_fields.ts index 9b234314d8..479ffd832c 100644 --- a/apps/sim/tools/mailchimp/get_merge_fields.ts +++ b/apps/sim/tools/mailchimp/get_merge_fields.ts @@ -16,12 +16,8 @@ export interface MailchimpGetMergeFieldsResponse { success: boolean output: { mergeFields: MailchimpMergeField[] - totalItems: number - metadata: { - operation: 'get_merge_fields' - totalReturned: number - } - success: boolean + total_items: number + total_returned: number } } @@ -91,26 +87,27 @@ export const mailchimpGetMergeFieldsTool: ToolConfig< success: true, output: { mergeFields, - totalItems: data.total_items || mergeFields.length, - metadata: { - operation: 'get_merge_fields' as const, - totalReturned: mergeFields.length, - }, - success: true, + total_items: data.total_items || mergeFields.length, + total_returned: mergeFields.length, }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, + success: { + type: 'boolean', + description: 'Whether the merge fields were successfully retrieved', + }, output: { type: 'object', - description: 'Merge fields data and metadata', + description: 'Merge fields data', properties: { - mergeFields: { type: 'array', description: 'Array of merge field objects' }, - totalItems: { type: 'number', description: 'Total number of merge fields' }, - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, + mergeFields: { type: 'json', description: 'Array of merge field objects' }, + total_items: { type: 'number', description: 'Total number of merge fields' }, + total_returned: { + type: 'number', + description: 'Number of merge fields returned in this response', + }, }, }, }, diff --git a/apps/sim/tools/mailchimp/get_segment.ts b/apps/sim/tools/mailchimp/get_segment.ts index a9e18f1e9f..2917da26a7 100644 --- a/apps/sim/tools/mailchimp/get_segment.ts +++ b/apps/sim/tools/mailchimp/get_segment.ts @@ -15,11 +15,7 @@ export interface MailchimpGetSegmentResponse { success: boolean output: { segment: MailchimpSegment - metadata: { - operation: 'get_segment' - segmentId: string - } - success: boolean + segment_id: string } } @@ -75,24 +71,19 @@ export const mailchimpGetSegmentTool: ToolConfig< success: true, output: { segment: data, - metadata: { - operation: 'get_segment' as const, - segmentId: data.id, - }, - success: true, + segment_id: data.id, }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, + success: { type: 'boolean', description: 'Whether the segment was successfully retrieved' }, output: { type: 'object', - description: 'Segment data and metadata', + description: 'Segment data', properties: { - segment: { type: 'object', description: 'Segment object' }, - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, + segment: { type: 'json', description: 'Segment object' }, + segment_id: { type: 'string', description: 'The unique ID of the segment' }, }, }, }, diff --git a/apps/sim/tools/mailchimp/get_segment_members.ts b/apps/sim/tools/mailchimp/get_segment_members.ts index 7bbd7c3768..ea215401b9 100644 --- a/apps/sim/tools/mailchimp/get_segment_members.ts +++ b/apps/sim/tools/mailchimp/get_segment_members.ts @@ -17,12 +17,8 @@ export interface MailchimpGetSegmentMembersResponse { success: boolean output: { members: MailchimpMember[] - totalItems: number - metadata: { - operation: 'get_segment_members' - totalReturned: number - } - success: boolean + total_items: number + total_returned: number } } @@ -101,26 +97,27 @@ export const mailchimpGetSegmentMembersTool: ToolConfig< success: true, output: { members, - totalItems: data.total_items || members.length, - metadata: { - operation: 'get_segment_members' as const, - totalReturned: members.length, - }, - success: true, + total_items: data.total_items || members.length, + total_returned: members.length, }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, + success: { + type: 'boolean', + description: 'Whether the segment members were successfully retrieved', + }, output: { type: 'object', - description: 'Segment members data and metadata', + description: 'Segment members data', properties: { - members: { type: 'array', description: 'Array of member objects' }, - totalItems: { type: 'number', description: 'Total number of members' }, - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, + members: { type: 'json', description: 'Array of member objects' }, + total_items: { type: 'number', description: 'Total number of members' }, + total_returned: { + type: 'number', + description: 'Number of members returned in this response', + }, }, }, }, diff --git a/apps/sim/tools/mailchimp/get_segments.ts b/apps/sim/tools/mailchimp/get_segments.ts index dc806eb3d3..d2aef507d8 100644 --- a/apps/sim/tools/mailchimp/get_segments.ts +++ b/apps/sim/tools/mailchimp/get_segments.ts @@ -15,12 +15,8 @@ export interface MailchimpGetSegmentsResponse { success: boolean output: { segments: any[] - totalItems: number - metadata: { - operation: 'get_segments' - totalReturned: number - } - success: boolean + total_items: number + total_returned: number } } @@ -90,26 +86,24 @@ export const mailchimpGetSegmentsTool: ToolConfig< success: true, output: { segments, - totalItems: data.total_items || segments.length, - metadata: { - operation: 'get_segments' as const, - totalReturned: segments.length, - }, - success: true, + total_items: data.total_items || segments.length, + total_returned: segments.length, }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, + success: { type: 'boolean', description: 'Whether the segments were successfully retrieved' }, output: { type: 'object', - description: 'Segments data and metadata', + description: 'Segments data', properties: { - segments: { type: 'array', description: 'Array of segment objects' }, - totalItems: { type: 'number', description: 'Total number of segments' }, - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, + segments: { type: 'json', description: 'Array of segment objects' }, + total_items: { type: 'number', description: 'Total number of segments' }, + total_returned: { + type: 'number', + description: 'Number of segments returned in this response', + }, }, }, }, diff --git a/apps/sim/tools/mailchimp/get_template.ts b/apps/sim/tools/mailchimp/get_template.ts index 7b7c8eb11b..4a11ee5c37 100644 --- a/apps/sim/tools/mailchimp/get_template.ts +++ b/apps/sim/tools/mailchimp/get_template.ts @@ -14,11 +14,7 @@ export interface MailchimpGetTemplateResponse { success: boolean output: { template: MailchimpTemplate - metadata: { - operation: 'get_template' - templateId: string - } - success: boolean + template_id: string } } @@ -67,24 +63,19 @@ export const mailchimpGetTemplateTool: ToolConfig< success: true, output: { template: data, - metadata: { - operation: 'get_template' as const, - templateId: data.id, - }, - success: true, + template_id: data.id, }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, + success: { type: 'boolean', description: 'Whether the template was successfully retrieved' }, output: { type: 'object', - description: 'Template data and metadata', + description: 'Template data', properties: { - template: { type: 'object', description: 'Template object' }, - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, + template: { type: 'json', description: 'Template object' }, + template_id: { type: 'string', description: 'The unique ID of the template' }, }, }, }, diff --git a/apps/sim/tools/mailchimp/get_templates.ts b/apps/sim/tools/mailchimp/get_templates.ts index 200300a7a9..9b23a71ec0 100644 --- a/apps/sim/tools/mailchimp/get_templates.ts +++ b/apps/sim/tools/mailchimp/get_templates.ts @@ -15,12 +15,8 @@ export interface MailchimpGetTemplatesResponse { success: boolean output: { templates: MailchimpTemplate[] - totalItems: number - metadata: { - operation: 'get_templates' - totalReturned: number - } - success: boolean + total_items: number + total_returned: number } } @@ -84,26 +80,24 @@ export const mailchimpGetTemplatesTool: ToolConfig< success: true, output: { templates, - totalItems: data.total_items || templates.length, - metadata: { - operation: 'get_templates' as const, - totalReturned: templates.length, - }, - success: true, + total_items: data.total_items || templates.length, + total_returned: templates.length, }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, + success: { type: 'boolean', description: 'Whether the templates were successfully retrieved' }, output: { type: 'object', - description: 'Templates data and metadata', + description: 'Templates data', properties: { - templates: { type: 'array', description: 'Array of template objects' }, - totalItems: { type: 'number', description: 'Total number of templates' }, - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, + templates: { type: 'json', description: 'Array of template objects' }, + total_items: { type: 'number', description: 'Total number of templates' }, + total_returned: { + type: 'number', + description: 'Number of templates returned in this response', + }, }, }, }, diff --git a/apps/sim/tools/mailchimp/pause_automation.ts b/apps/sim/tools/mailchimp/pause_automation.ts index c433b14cc4..fb506bf80d 100644 --- a/apps/sim/tools/mailchimp/pause_automation.ts +++ b/apps/sim/tools/mailchimp/pause_automation.ts @@ -1,9 +1,6 @@ -import { createLogger } from '@sim/logger' import type { ToolConfig } from '@/tools/types' import { buildMailchimpUrl, handleMailchimpError } from './types' -const logger = createLogger('MailchimpPauseAutomation') - export interface MailchimpPauseAutomationParams { apiKey: string workflowId: string @@ -12,10 +9,6 @@ export interface MailchimpPauseAutomationParams { export interface MailchimpPauseAutomationResponse { success: boolean output: { - metadata: { - operation: 'pause_automation' - workflowId: string - } success: boolean } } @@ -66,10 +59,6 @@ export const mailchimpPauseAutomationTool: ToolConfig< return { success: true, output: { - metadata: { - operation: 'pause_automation' as const, - workflowId: '', - }, success: true, }, } @@ -81,7 +70,6 @@ export const mailchimpPauseAutomationTool: ToolConfig< type: 'object', description: 'Pause confirmation', properties: { - metadata: { type: 'object', description: 'Operation metadata' }, success: { type: 'boolean', description: 'Operation success' }, }, }, diff --git a/apps/sim/tools/mailchimp/publish_landing_page.ts b/apps/sim/tools/mailchimp/publish_landing_page.ts index f780b908e6..bfb881cb44 100644 --- a/apps/sim/tools/mailchimp/publish_landing_page.ts +++ b/apps/sim/tools/mailchimp/publish_landing_page.ts @@ -1,9 +1,6 @@ -import { createLogger } from '@sim/logger' import type { ToolConfig } from '@/tools/types' import { buildMailchimpUrl, handleMailchimpError } from './types' -const logger = createLogger('MailchimpPublishLandingPage') - export interface MailchimpPublishLandingPageParams { apiKey: string pageId: string @@ -12,10 +9,6 @@ export interface MailchimpPublishLandingPageParams { export interface MailchimpPublishLandingPageResponse { success: boolean output: { - metadata: { - operation: 'publish_landing_page' - pageId: string - } success: boolean } } @@ -63,10 +56,6 @@ export const mailchimpPublishLandingPageTool: ToolConfig< return { success: true, output: { - metadata: { - operation: 'publish_landing_page' as const, - pageId: '', - }, success: true, }, } @@ -78,7 +67,6 @@ export const mailchimpPublishLandingPageTool: ToolConfig< type: 'object', description: 'Publish confirmation', properties: { - metadata: { type: 'object', description: 'Operation metadata' }, success: { type: 'boolean', description: 'Operation success' }, }, }, diff --git a/apps/sim/tools/mailchimp/remove_member_tags.ts b/apps/sim/tools/mailchimp/remove_member_tags.ts index 205e329d53..433cd6aeb0 100644 --- a/apps/sim/tools/mailchimp/remove_member_tags.ts +++ b/apps/sim/tools/mailchimp/remove_member_tags.ts @@ -14,10 +14,6 @@ export interface MailchimpRemoveMemberTagsParams { export interface MailchimpRemoveMemberTagsResponse { success: boolean output: { - metadata: { - operation: 'remove_member_tags' - subscriberHash: string - } success: boolean } } @@ -90,10 +86,6 @@ export const mailchimpRemoveMemberTagsTool: ToolConfig< return { success: true, output: { - metadata: { - operation: 'remove_member_tags' as const, - subscriberHash: '', - }, success: true, }, } @@ -105,7 +97,6 @@ export const mailchimpRemoveMemberTagsTool: ToolConfig< type: 'object', description: 'Tag removal confirmation', properties: { - metadata: { type: 'object', description: 'Operation metadata' }, success: { type: 'boolean', description: 'Operation success' }, }, }, diff --git a/apps/sim/tools/mailchimp/remove_segment_member.ts b/apps/sim/tools/mailchimp/remove_segment_member.ts index 9e32d580e6..b053be8879 100644 --- a/apps/sim/tools/mailchimp/remove_segment_member.ts +++ b/apps/sim/tools/mailchimp/remove_segment_member.ts @@ -1,9 +1,6 @@ -import { createLogger } from '@sim/logger' import type { ToolConfig } from '@/tools/types' import { buildMailchimpUrl, handleMailchimpError } from './types' -const logger = createLogger('MailchimpRemoveSegmentMember') - export interface MailchimpRemoveSegmentMemberParams { apiKey: string listId: string @@ -14,10 +11,6 @@ export interface MailchimpRemoveSegmentMemberParams { export interface MailchimpRemoveSegmentMemberResponse { success: boolean output: { - metadata: { - operation: 'remove_segment_member' - subscriberHash: string - } success: boolean } } @@ -80,10 +73,6 @@ export const mailchimpRemoveSegmentMemberTool: ToolConfig< return { success: true, output: { - metadata: { - operation: 'remove_segment_member' as const, - subscriberHash: '', - }, success: true, }, } @@ -95,7 +84,6 @@ export const mailchimpRemoveSegmentMemberTool: ToolConfig< type: 'object', description: 'Removal confirmation', properties: { - metadata: { type: 'object', description: 'Operation metadata' }, success: { type: 'boolean', description: 'Operation success' }, }, }, diff --git a/apps/sim/tools/mailchimp/replicate_campaign.ts b/apps/sim/tools/mailchimp/replicate_campaign.ts index 359bbb5e7a..2dd9a95b3e 100644 --- a/apps/sim/tools/mailchimp/replicate_campaign.ts +++ b/apps/sim/tools/mailchimp/replicate_campaign.ts @@ -1,9 +1,6 @@ -import { createLogger } from '@sim/logger' import type { ToolConfig } from '@/tools/types' import { buildMailchimpUrl, handleMailchimpError } from './types' -const logger = createLogger('MailchimpReplicateCampaign') - export interface MailchimpReplicateCampaignParams { apiKey: string campaignId: string @@ -12,11 +9,8 @@ export interface MailchimpReplicateCampaignParams { export interface MailchimpReplicateCampaignResponse { success: boolean output: { - campaign: any - metadata: { - operation: 'replicate_campaign' - campaignId: string - } + campaign: unknown + campaign_id: string success: boolean } } @@ -67,10 +61,7 @@ export const mailchimpReplicateCampaignTool: ToolConfig< success: true, output: { campaign: data, - metadata: { - operation: 'replicate_campaign' as const, - campaignId: data.id, - }, + campaign_id: data.id, success: true, }, } @@ -83,7 +74,7 @@ export const mailchimpReplicateCampaignTool: ToolConfig< description: 'Replicated campaign data', properties: { campaign: { type: 'object', description: 'Replicated campaign object' }, - metadata: { type: 'object', description: 'Operation metadata' }, + campaign_id: { type: 'string', description: 'Campaign ID' }, success: { type: 'boolean', description: 'Operation success' }, }, }, diff --git a/apps/sim/tools/mailchimp/schedule_campaign.ts b/apps/sim/tools/mailchimp/schedule_campaign.ts index fcd8ad630c..13b5c67501 100644 --- a/apps/sim/tools/mailchimp/schedule_campaign.ts +++ b/apps/sim/tools/mailchimp/schedule_campaign.ts @@ -1,9 +1,6 @@ -import { createLogger } from '@sim/logger' import type { ToolConfig } from '@/tools/types' import { buildMailchimpUrl, handleMailchimpError } from './types' -const logger = createLogger('MailchimpScheduleCampaign') - export interface MailchimpScheduleCampaignParams { apiKey: string campaignId: string @@ -12,14 +9,6 @@ export interface MailchimpScheduleCampaignParams { export interface MailchimpScheduleCampaignResponse { success: boolean - output: { - metadata: { - operation: 'schedule_campaign' - campaignId: string - scheduleTime: string - } - success: boolean - } } export const mailchimpScheduleCampaignTool: ToolConfig< @@ -73,26 +62,10 @@ export const mailchimpScheduleCampaignTool: ToolConfig< return { success: true, - output: { - metadata: { - operation: 'schedule_campaign' as const, - campaignId: '', - scheduleTime: '', - }, - success: true, - }, } }, outputs: { - success: { type: 'boolean', description: 'Operation success status' }, - output: { - type: 'object', - description: 'Schedule confirmation', - properties: { - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, - }, - }, + success: { type: 'boolean', description: 'Whether the campaign was successfully scheduled' }, }, } diff --git a/apps/sim/tools/mailchimp/send_campaign.ts b/apps/sim/tools/mailchimp/send_campaign.ts index acccf287e0..fdc0a18040 100644 --- a/apps/sim/tools/mailchimp/send_campaign.ts +++ b/apps/sim/tools/mailchimp/send_campaign.ts @@ -1,9 +1,6 @@ -import { createLogger } from '@sim/logger' import type { ToolConfig } from '@/tools/types' import { buildMailchimpUrl, handleMailchimpError } from './types' -const logger = createLogger('MailchimpSendCampaign') - export interface MailchimpSendCampaignParams { apiKey: string campaignId: string @@ -12,10 +9,6 @@ export interface MailchimpSendCampaignParams { export interface MailchimpSendCampaignResponse { success: boolean output: { - metadata: { - operation: 'send_campaign' - campaignId: string - } success: boolean } } @@ -63,10 +56,6 @@ export const mailchimpSendCampaignTool: ToolConfig< return { success: true, output: { - metadata: { - operation: 'send_campaign' as const, - campaignId: '', - }, success: true, }, } @@ -78,7 +67,6 @@ export const mailchimpSendCampaignTool: ToolConfig< type: 'object', description: 'Send confirmation', properties: { - metadata: { type: 'object', description: 'Operation metadata' }, success: { type: 'boolean', description: 'Operation success' }, }, }, diff --git a/apps/sim/tools/mailchimp/set_campaign_content.ts b/apps/sim/tools/mailchimp/set_campaign_content.ts index 9c13ebf85e..1c0b4b04ec 100644 --- a/apps/sim/tools/mailchimp/set_campaign_content.ts +++ b/apps/sim/tools/mailchimp/set_campaign_content.ts @@ -1,9 +1,6 @@ -import { createLogger } from '@sim/logger' import type { ToolConfig } from '@/tools/types' import { buildMailchimpUrl, handleMailchimpError, type MailchimpCampaignContent } from './types' -const logger = createLogger('MailchimpSetCampaignContent') - export interface MailchimpSetCampaignContentParams { apiKey: string campaignId: string @@ -16,10 +13,6 @@ export interface MailchimpSetCampaignContentResponse { success: boolean output: { content: MailchimpCampaignContent - metadata: { - operation: 'set_campaign_content' - campaignId: string - } success: boolean } } @@ -96,10 +89,6 @@ export const mailchimpSetCampaignContentTool: ToolConfig< success: true, output: { content: data, - metadata: { - operation: 'set_campaign_content' as const, - campaignId: '', - }, success: true, }, } @@ -112,7 +101,6 @@ export const mailchimpSetCampaignContentTool: ToolConfig< description: 'Campaign content data', properties: { content: { type: 'object', description: 'Campaign content object' }, - metadata: { type: 'object', description: 'Operation metadata' }, success: { type: 'boolean', description: 'Operation success' }, }, }, diff --git a/apps/sim/tools/mailchimp/start_automation.ts b/apps/sim/tools/mailchimp/start_automation.ts index 9c78b254a4..8d3226d4c6 100644 --- a/apps/sim/tools/mailchimp/start_automation.ts +++ b/apps/sim/tools/mailchimp/start_automation.ts @@ -1,9 +1,6 @@ -import { createLogger } from '@sim/logger' import type { ToolConfig } from '@/tools/types' import { buildMailchimpUrl, handleMailchimpError } from './types' -const logger = createLogger('MailchimpStartAutomation') - export interface MailchimpStartAutomationParams { apiKey: string workflowId: string @@ -12,10 +9,6 @@ export interface MailchimpStartAutomationParams { export interface MailchimpStartAutomationResponse { success: boolean output: { - metadata: { - operation: 'start_automation' - workflowId: string - } success: boolean } } @@ -66,10 +59,6 @@ export const mailchimpStartAutomationTool: ToolConfig< return { success: true, output: { - metadata: { - operation: 'start_automation' as const, - workflowId: '', - }, success: true, }, } @@ -81,7 +70,6 @@ export const mailchimpStartAutomationTool: ToolConfig< type: 'object', description: 'Start confirmation', properties: { - metadata: { type: 'object', description: 'Operation metadata' }, success: { type: 'boolean', description: 'Operation success' }, }, }, diff --git a/apps/sim/tools/mailchimp/types.ts b/apps/sim/tools/mailchimp/types.ts index aa13ec97ed..8632a94dd1 100644 --- a/apps/sim/tools/mailchimp/types.ts +++ b/apps/sim/tools/mailchimp/types.ts @@ -13,7 +13,7 @@ export interface MailchimpPaginationParams { } export interface MailchimpPagingInfo { - totalItems: number + total_items: number } export interface MailchimpResponse { @@ -21,8 +21,7 @@ export interface MailchimpResponse { output: { data?: T paging?: MailchimpPagingInfo - metadata: { - operation: string + metadata?: { [key: string]: unknown } success: boolean diff --git a/apps/sim/tools/mailchimp/unarchive_member.ts b/apps/sim/tools/mailchimp/unarchive_member.ts index ab84b0159b..62be61062c 100644 --- a/apps/sim/tools/mailchimp/unarchive_member.ts +++ b/apps/sim/tools/mailchimp/unarchive_member.ts @@ -1,9 +1,6 @@ -import { createLogger } from '@sim/logger' import type { ToolConfig } from '@/tools/types' import { buildMailchimpUrl, handleMailchimpError, type MailchimpMember } from './types' -const logger = createLogger('MailchimpUnarchiveMember') - export interface MailchimpUnarchiveMemberParams { apiKey: string listId: string @@ -16,10 +13,7 @@ export interface MailchimpUnarchiveMemberResponse { success: boolean output: { member: MailchimpMember - metadata: { - operation: 'unarchive_member' - subscriberHash: string - } + subscriber_hash: string success: boolean } } @@ -92,10 +86,7 @@ export const mailchimpUnarchiveMemberTool: ToolConfig< success: true, output: { member: data, - metadata: { - operation: 'unarchive_member' as const, - subscriberHash: data.id, - }, + subscriber_hash: data.id, success: true, }, } @@ -108,7 +99,7 @@ export const mailchimpUnarchiveMemberTool: ToolConfig< description: 'Unarchived member data', properties: { member: { type: 'object', description: 'Unarchived member object' }, - metadata: { type: 'object', description: 'Operation metadata' }, + subscriber_hash: { type: 'string', description: 'Subscriber hash' }, success: { type: 'boolean', description: 'Operation success' }, }, }, diff --git a/apps/sim/tools/mailchimp/unpublish_landing_page.ts b/apps/sim/tools/mailchimp/unpublish_landing_page.ts index aaf48d4a01..f4f6618d57 100644 --- a/apps/sim/tools/mailchimp/unpublish_landing_page.ts +++ b/apps/sim/tools/mailchimp/unpublish_landing_page.ts @@ -1,9 +1,6 @@ -import { createLogger } from '@sim/logger' import type { ToolConfig } from '@/tools/types' import { buildMailchimpUrl, handleMailchimpError } from './types' -const logger = createLogger('MailchimpUnpublishLandingPage') - export interface MailchimpUnpublishLandingPageParams { apiKey: string pageId: string @@ -12,10 +9,6 @@ export interface MailchimpUnpublishLandingPageParams { export interface MailchimpUnpublishLandingPageResponse { success: boolean output: { - metadata: { - operation: 'unpublish_landing_page' - pageId: string - } success: boolean } } @@ -63,10 +56,6 @@ export const mailchimpUnpublishLandingPageTool: ToolConfig< return { success: true, output: { - metadata: { - operation: 'unpublish_landing_page' as const, - pageId: '', - }, success: true, }, } @@ -78,7 +67,6 @@ export const mailchimpUnpublishLandingPageTool: ToolConfig< type: 'object', description: 'Unpublish confirmation', properties: { - metadata: { type: 'object', description: 'Operation metadata' }, success: { type: 'boolean', description: 'Operation success' }, }, }, diff --git a/apps/sim/tools/mailchimp/unschedule_campaign.ts b/apps/sim/tools/mailchimp/unschedule_campaign.ts index 473798bdbc..e305731ede 100644 --- a/apps/sim/tools/mailchimp/unschedule_campaign.ts +++ b/apps/sim/tools/mailchimp/unschedule_campaign.ts @@ -1,9 +1,6 @@ -import { createLogger } from '@sim/logger' import type { ToolConfig } from '@/tools/types' import { buildMailchimpUrl, handleMailchimpError } from './types' -const logger = createLogger('MailchimpUnscheduleCampaign') - export interface MailchimpUnscheduleCampaignParams { apiKey: string campaignId: string @@ -12,10 +9,6 @@ export interface MailchimpUnscheduleCampaignParams { export interface MailchimpUnscheduleCampaignResponse { success: boolean output: { - metadata: { - operation: 'unschedule_campaign' - campaignId: string - } success: boolean } } @@ -63,10 +56,6 @@ export const mailchimpUnscheduleCampaignTool: ToolConfig< return { success: true, output: { - metadata: { - operation: 'unschedule_campaign' as const, - campaignId: '', - }, success: true, }, } @@ -78,7 +67,6 @@ export const mailchimpUnscheduleCampaignTool: ToolConfig< type: 'object', description: 'Unschedule confirmation', properties: { - metadata: { type: 'object', description: 'Operation metadata' }, success: { type: 'boolean', description: 'Operation success' }, }, }, diff --git a/apps/sim/tools/mailchimp/update_audience.ts b/apps/sim/tools/mailchimp/update_audience.ts index 935fd81fdd..d14b4ad8eb 100644 --- a/apps/sim/tools/mailchimp/update_audience.ts +++ b/apps/sim/tools/mailchimp/update_audience.ts @@ -18,10 +18,7 @@ export interface MailchimpUpdateAudienceResponse { success: boolean output: { list: MailchimpAudience - metadata: { - operation: 'update_audience' - listId: string - } + list_id: string success: boolean } } @@ -113,10 +110,7 @@ export const mailchimpUpdateAudienceTool: ToolConfig< success: true, output: { list: data, - metadata: { - operation: 'update_audience' as const, - listId: data.id, - }, + list_id: data.id, success: true, }, } @@ -129,7 +123,7 @@ export const mailchimpUpdateAudienceTool: ToolConfig< description: 'Updated audience data', properties: { list: { type: 'object', description: 'Updated audience/list object' }, - metadata: { type: 'object', description: 'Operation metadata' }, + list_id: { type: 'string', description: 'List ID' }, success: { type: 'boolean', description: 'Operation success' }, }, }, diff --git a/apps/sim/tools/mailchimp/update_campaign.ts b/apps/sim/tools/mailchimp/update_campaign.ts index cb008ddc53..6bf3835456 100644 --- a/apps/sim/tools/mailchimp/update_campaign.ts +++ b/apps/sim/tools/mailchimp/update_campaign.ts @@ -15,10 +15,7 @@ export interface MailchimpUpdateCampaignResponse { success: boolean output: { campaign: MailchimpCampaign - metadata: { - operation: 'update_campaign' - campaignId: string - } + campaign_id: string success: boolean } } @@ -101,10 +98,7 @@ export const mailchimpUpdateCampaignTool: ToolConfig< success: true, output: { campaign: data, - metadata: { - operation: 'update_campaign' as const, - campaignId: data.id, - }, + campaign_id: data.id, success: true, }, } @@ -117,7 +111,7 @@ export const mailchimpUpdateCampaignTool: ToolConfig< description: 'Updated campaign data', properties: { campaign: { type: 'object', description: 'Updated campaign object' }, - metadata: { type: 'object', description: 'Operation metadata' }, + campaign_id: { type: 'string', description: 'Campaign ID' }, success: { type: 'boolean', description: 'Operation success' }, }, }, diff --git a/apps/sim/tools/mailchimp/update_interest.ts b/apps/sim/tools/mailchimp/update_interest.ts index 00369edc3b..ea28ea4041 100644 --- a/apps/sim/tools/mailchimp/update_interest.ts +++ b/apps/sim/tools/mailchimp/update_interest.ts @@ -1,10 +1,7 @@ -import { createLogger } from '@sim/logger' import type { ToolConfig } from '@/tools/types' import type { MailchimpInterest } from './types' import { buildMailchimpUrl, handleMailchimpError } from './types' -const logger = createLogger('MailchimpUpdateInterest') - export interface MailchimpUpdateInterestParams { apiKey: string listId: string @@ -17,10 +14,7 @@ export interface MailchimpUpdateInterestResponse { success: boolean output: { interest: MailchimpInterest - metadata: { - operation: 'update_interest' - interestId: string - } + interest_id: string success: boolean } } @@ -99,10 +93,7 @@ export const mailchimpUpdateInterestTool: ToolConfig< success: true, output: { interest: data, - metadata: { - operation: 'update_interest' as const, - interestId: data.id, - }, + interest_id: data.id, success: true, }, } @@ -115,7 +106,7 @@ export const mailchimpUpdateInterestTool: ToolConfig< description: 'Updated interest data', properties: { interest: { type: 'object', description: 'Updated interest object' }, - metadata: { type: 'object', description: 'Operation metadata' }, + interest_id: { type: 'string', description: 'Interest ID' }, success: { type: 'boolean', description: 'Operation success' }, }, }, diff --git a/apps/sim/tools/mailchimp/update_interest_category.ts b/apps/sim/tools/mailchimp/update_interest_category.ts index c0cad15078..673b409687 100644 --- a/apps/sim/tools/mailchimp/update_interest_category.ts +++ b/apps/sim/tools/mailchimp/update_interest_category.ts @@ -1,10 +1,7 @@ -import { createLogger } from '@sim/logger' import type { ToolConfig } from '@/tools/types' import type { MailchimpInterestCategory } from './types' import { buildMailchimpUrl, handleMailchimpError } from './types' -const logger = createLogger('MailchimpUpdateInterestCategory') - export interface MailchimpUpdateInterestCategoryParams { apiKey: string listId: string @@ -16,10 +13,7 @@ export interface MailchimpUpdateInterestCategoryResponse { success: boolean output: { category: MailchimpInterestCategory - metadata: { - operation: 'update_interest_category' - interestCategoryId: string - } + interest_category_id: string success: boolean } } @@ -92,10 +86,7 @@ export const mailchimpUpdateInterestCategoryTool: ToolConfig< success: true, output: { category: data, - metadata: { - operation: 'update_interest_category' as const, - interestCategoryId: data.id, - }, + interest_category_id: data.id, success: true, }, } @@ -108,7 +99,7 @@ export const mailchimpUpdateInterestCategoryTool: ToolConfig< description: 'Updated interest category data', properties: { category: { type: 'object', description: 'Updated interest category object' }, - metadata: { type: 'object', description: 'Operation metadata' }, + interest_category_id: { type: 'string', description: 'Interest category ID' }, success: { type: 'boolean', description: 'Operation success' }, }, }, diff --git a/apps/sim/tools/mailchimp/update_landing_page.ts b/apps/sim/tools/mailchimp/update_landing_page.ts index 3fe6f2ecfd..ceb54f9369 100644 --- a/apps/sim/tools/mailchimp/update_landing_page.ts +++ b/apps/sim/tools/mailchimp/update_landing_page.ts @@ -1,10 +1,7 @@ -import { createLogger } from '@sim/logger' import type { ToolConfig } from '@/tools/types' import type { MailchimpLandingPage } from './types' import { buildMailchimpUrl, handleMailchimpError } from './types' -const logger = createLogger('MailchimpUpdateLandingPage') - export interface MailchimpUpdateLandingPageParams { apiKey: string pageId: string @@ -15,10 +12,7 @@ export interface MailchimpUpdateLandingPageResponse { success: boolean output: { landingPage: MailchimpLandingPage - metadata: { - operation: 'update_landing_page' - pageId: string - } + page_id: string success: boolean } } @@ -81,10 +75,7 @@ export const mailchimpUpdateLandingPageTool: ToolConfig< success: true, output: { landingPage: data, - metadata: { - operation: 'update_landing_page' as const, - pageId: data.id, - }, + page_id: data.id, success: true, }, } @@ -97,7 +88,7 @@ export const mailchimpUpdateLandingPageTool: ToolConfig< description: 'Updated landing page data', properties: { landingPage: { type: 'object', description: 'Updated landing page object' }, - metadata: { type: 'object', description: 'Operation metadata' }, + page_id: { type: 'string', description: 'Landing page ID' }, success: { type: 'boolean', description: 'Operation success' }, }, }, diff --git a/apps/sim/tools/mailchimp/update_member.ts b/apps/sim/tools/mailchimp/update_member.ts index 5424207af4..eba1d493d1 100644 --- a/apps/sim/tools/mailchimp/update_member.ts +++ b/apps/sim/tools/mailchimp/update_member.ts @@ -18,10 +18,7 @@ export interface MailchimpUpdateMemberResponse { success: boolean output: { member: MailchimpMember - metadata: { - operation: 'update_member' - subscriberHash: string - } + subscriber_hash: string success: boolean } } @@ -126,10 +123,7 @@ export const mailchimpUpdateMemberTool: ToolConfig< success: true, output: { member: data, - metadata: { - operation: 'update_member' as const, - subscriberHash: data.id, - }, + subscriber_hash: data.id, success: true, }, } @@ -142,7 +136,7 @@ export const mailchimpUpdateMemberTool: ToolConfig< description: 'Updated member data', properties: { member: { type: 'object', description: 'Updated member object' }, - metadata: { type: 'object', description: 'Operation metadata' }, + subscriber_hash: { type: 'string', description: 'Subscriber hash' }, success: { type: 'boolean', description: 'Operation success' }, }, }, diff --git a/apps/sim/tools/mailchimp/update_merge_field.ts b/apps/sim/tools/mailchimp/update_merge_field.ts index 1f0d26fda6..7a754f071b 100644 --- a/apps/sim/tools/mailchimp/update_merge_field.ts +++ b/apps/sim/tools/mailchimp/update_merge_field.ts @@ -1,10 +1,7 @@ -import { createLogger } from '@sim/logger' import type { ToolConfig } from '@/tools/types' import type { MailchimpMergeField } from './types' import { buildMailchimpUrl, handleMailchimpError } from './types' -const logger = createLogger('MailchimpUpdateMergeField') - export interface MailchimpUpdateMergeFieldParams { apiKey: string listId: string @@ -16,10 +13,7 @@ export interface MailchimpUpdateMergeFieldResponse { success: boolean output: { mergeField: MailchimpMergeField - metadata: { - operation: 'update_merge_field' - mergeId: string - } + merge_id: string success: boolean } } @@ -89,10 +83,7 @@ export const mailchimpUpdateMergeFieldTool: ToolConfig< success: true, output: { mergeField: data, - metadata: { - operation: 'update_merge_field' as const, - mergeId: data.merge_id, - }, + merge_id: data.merge_id, success: true, }, } @@ -105,7 +96,7 @@ export const mailchimpUpdateMergeFieldTool: ToolConfig< description: 'Updated merge field data', properties: { mergeField: { type: 'object', description: 'Updated merge field object' }, - metadata: { type: 'object', description: 'Operation metadata' }, + merge_id: { type: 'string', description: 'Merge field ID' }, success: { type: 'boolean', description: 'Operation success' }, }, }, diff --git a/apps/sim/tools/mailchimp/update_segment.ts b/apps/sim/tools/mailchimp/update_segment.ts index 4107c9851d..04bf671c10 100644 --- a/apps/sim/tools/mailchimp/update_segment.ts +++ b/apps/sim/tools/mailchimp/update_segment.ts @@ -17,10 +17,7 @@ export interface MailchimpUpdateSegmentResponse { success: boolean output: { segment: MailchimpSegment - metadata: { - operation: 'update_segment' - segmentId: string - } + segment_id: string success: boolean } } @@ -105,10 +102,7 @@ export const mailchimpUpdateSegmentTool: ToolConfig< success: true, output: { segment: data, - metadata: { - operation: 'update_segment' as const, - segmentId: data.id, - }, + segment_id: data.id, success: true, }, } @@ -121,7 +115,7 @@ export const mailchimpUpdateSegmentTool: ToolConfig< description: 'Updated segment data', properties: { segment: { type: 'object', description: 'Updated segment object' }, - metadata: { type: 'object', description: 'Operation metadata' }, + segment_id: { type: 'string', description: 'Segment ID' }, success: { type: 'boolean', description: 'Operation success' }, }, }, diff --git a/apps/sim/tools/mailchimp/update_template.ts b/apps/sim/tools/mailchimp/update_template.ts index ef505128ad..6ccc33a76d 100644 --- a/apps/sim/tools/mailchimp/update_template.ts +++ b/apps/sim/tools/mailchimp/update_template.ts @@ -1,10 +1,7 @@ -import { createLogger } from '@sim/logger' import type { ToolConfig } from '@/tools/types' import type { MailchimpTemplate } from './types' import { buildMailchimpUrl, handleMailchimpError } from './types' -const logger = createLogger('MailchimpUpdateTemplate') - export interface MailchimpUpdateTemplateParams { apiKey: string templateId: string @@ -16,10 +13,7 @@ export interface MailchimpUpdateTemplateResponse { success: boolean output: { template: MailchimpTemplate - metadata: { - operation: 'update_template' - templateId: string - } + template_id: string success: boolean } } @@ -89,10 +83,7 @@ export const mailchimpUpdateTemplateTool: ToolConfig< success: true, output: { template: data, - metadata: { - operation: 'update_template' as const, - templateId: data.id, - }, + template_id: data.id, success: true, }, } @@ -105,7 +96,7 @@ export const mailchimpUpdateTemplateTool: ToolConfig< description: 'Updated template data', properties: { template: { type: 'object', description: 'Updated template object' }, - metadata: { type: 'object', description: 'Operation metadata' }, + template_id: { type: 'string', description: 'Template ID' }, success: { type: 'boolean', description: 'Operation success' }, }, }, diff --git a/apps/sim/tools/microsoft_planner/create_bucket.ts b/apps/sim/tools/microsoft_planner/create_bucket.ts index ede3565ebb..1d101fd2d4 100644 --- a/apps/sim/tools/microsoft_planner/create_bucket.ts +++ b/apps/sim/tools/microsoft_planner/create_bucket.ts @@ -95,6 +95,13 @@ export const createBucketTool: ToolConfig< outputs: { success: { type: 'boolean', description: 'Whether the bucket was created successfully' }, bucket: { type: 'object', description: 'The created bucket object with all properties' }, - metadata: { type: 'object', description: 'Metadata including bucketId and planId' }, + metadata: { + type: 'object', + description: 'Metadata including bucketId and planId', + properties: { + bucketId: { type: 'string', description: 'Created bucket ID' }, + planId: { type: 'string', description: 'Parent plan ID' }, + }, + }, }, } diff --git a/apps/sim/tools/microsoft_planner/create_task.ts b/apps/sim/tools/microsoft_planner/create_task.ts index 6bee878791..067b841776 100644 --- a/apps/sim/tools/microsoft_planner/create_task.ts +++ b/apps/sim/tools/microsoft_planner/create_task.ts @@ -145,6 +145,14 @@ export const createTaskTool: ToolConfig< outputs: { success: { type: 'boolean', description: 'Whether the task was created successfully' }, task: { type: 'object', description: 'The created task object with all properties' }, - metadata: { type: 'object', description: 'Metadata including planId, taskId, and taskUrl' }, + metadata: { + type: 'object', + description: 'Metadata including planId, taskId, and taskUrl', + properties: { + planId: { type: 'string', description: 'Parent plan ID' }, + taskId: { type: 'string', description: 'Created task ID' }, + taskUrl: { type: 'string', description: 'Microsoft Graph API URL for the task' }, + }, + }, }, } diff --git a/apps/sim/tools/microsoft_planner/get_task_details.ts b/apps/sim/tools/microsoft_planner/get_task_details.ts index cc040baaf6..e512189d2e 100644 --- a/apps/sim/tools/microsoft_planner/get_task_details.ts +++ b/apps/sim/tools/microsoft_planner/get_task_details.ts @@ -88,6 +88,12 @@ export const getTaskDetailsTool: ToolConfig< type: 'string', description: 'The ETag value for this task details - use this for update operations', }, - metadata: { type: 'object', description: 'Metadata including taskId' }, + metadata: { + type: 'object', + description: 'Metadata including taskId', + properties: { + taskId: { type: 'string', description: 'Task ID' }, + }, + }, }, } diff --git a/apps/sim/tools/microsoft_planner/list_buckets.ts b/apps/sim/tools/microsoft_planner/list_buckets.ts index b08901569e..b510752653 100644 --- a/apps/sim/tools/microsoft_planner/list_buckets.ts +++ b/apps/sim/tools/microsoft_planner/list_buckets.ts @@ -78,6 +78,13 @@ export const listBucketsTool: ToolConfig< outputs: { success: { type: 'boolean', description: 'Whether buckets were retrieved successfully' }, buckets: { type: 'array', description: 'Array of bucket objects' }, - metadata: { type: 'object', description: 'Metadata including planId and count' }, + metadata: { + type: 'object', + description: 'Metadata including planId and count', + properties: { + planId: { type: 'string', description: 'Plan ID' }, + count: { type: 'number', description: 'Number of buckets returned' }, + }, + }, }, } diff --git a/apps/sim/tools/microsoft_planner/list_plans.ts b/apps/sim/tools/microsoft_planner/list_plans.ts index 81df8a5fb3..404a77a7ef 100644 --- a/apps/sim/tools/microsoft_planner/list_plans.ts +++ b/apps/sim/tools/microsoft_planner/list_plans.ts @@ -69,6 +69,13 @@ export const listPlansTool: ToolConfig< outputs: { success: { type: 'boolean', description: 'Whether plans were retrieved successfully' }, plans: { type: 'array', description: 'Array of plan objects shared with the current user' }, - metadata: { type: 'object', description: 'Metadata including userId and count' }, + metadata: { + type: 'object', + description: 'Metadata including userId and count', + properties: { + count: { type: 'number', description: 'Number of plans returned' }, + userId: { type: 'string', description: 'User ID' }, + }, + }, }, } diff --git a/apps/sim/tools/microsoft_planner/read_bucket.ts b/apps/sim/tools/microsoft_planner/read_bucket.ts index b0e3659386..2ba8046ee4 100644 --- a/apps/sim/tools/microsoft_planner/read_bucket.ts +++ b/apps/sim/tools/microsoft_planner/read_bucket.ts @@ -76,6 +76,13 @@ export const readBucketTool: ToolConfig< outputs: { success: { type: 'boolean', description: 'Whether the bucket was retrieved successfully' }, bucket: { type: 'object', description: 'The bucket object with all properties' }, - metadata: { type: 'object', description: 'Metadata including bucketId and planId' }, + metadata: { + type: 'object', + description: 'Metadata including bucketId and planId', + properties: { + bucketId: { type: 'string', description: 'Bucket ID' }, + planId: { type: 'string', description: 'Parent plan ID' }, + }, + }, }, } diff --git a/apps/sim/tools/microsoft_planner/read_plan.ts b/apps/sim/tools/microsoft_planner/read_plan.ts index 8b67aa7cd6..ea1f51a841 100644 --- a/apps/sim/tools/microsoft_planner/read_plan.ts +++ b/apps/sim/tools/microsoft_planner/read_plan.ts @@ -76,6 +76,13 @@ export const readPlanTool: ToolConfig< outputs: { success: { type: 'boolean', description: 'Whether the plan was retrieved successfully' }, plan: { type: 'object', description: 'The plan object with all properties' }, - metadata: { type: 'object', description: 'Metadata including planId and planUrl' }, + metadata: { + type: 'object', + description: 'Metadata including planId and planUrl', + properties: { + planId: { type: 'string', description: 'Plan ID' }, + planUrl: { type: 'string', description: 'Microsoft Graph API URL for the plan' }, + }, + }, }, } diff --git a/apps/sim/tools/microsoft_planner/read_task.ts b/apps/sim/tools/microsoft_planner/read_task.ts index aea4ae5cc5..a16afac86a 100644 --- a/apps/sim/tools/microsoft_planner/read_task.ts +++ b/apps/sim/tools/microsoft_planner/read_task.ts @@ -153,6 +153,14 @@ export const readTaskTool: ToolConfig + } +} + +export const notionCreateDatabaseV2Tool: ToolConfig< + NotionCreateDatabaseParams, + NotionCreateDatabaseV2Response +> = { + id: 'notion_create_database_v2', + name: 'Create Notion Database', + description: 'Create a new database in Notion with custom properties', + version: '2.0.0', + oauth: notionCreateDatabaseTool.oauth, + params: notionCreateDatabaseTool.params, + request: notionCreateDatabaseTool.request, + + transformResponse: async (response: Response) => { + const data = await response.json() + const title = data.title?.map((t: any) => t.plain_text || '').join('') || 'Untitled Database' + + return { + success: true, + output: { + id: data.id, + title, + url: data.url, + created_time: data.created_time, + properties: data.properties || {}, + }, + } + }, + + outputs: { + id: { type: 'string', description: 'Database ID' }, + title: { type: 'string', description: 'Database title' }, + url: { type: 'string', description: 'Database URL' }, + created_time: { type: 'string', description: 'Creation timestamp' }, + properties: { type: 'object', description: 'Database properties schema' }, + }, +} diff --git a/apps/sim/tools/notion/create_page.ts b/apps/sim/tools/notion/create_page.ts index aade06ffe7..19d2bd4acd 100644 --- a/apps/sim/tools/notion/create_page.ts +++ b/apps/sim/tools/notion/create_page.ts @@ -143,3 +143,63 @@ export const notionCreatePageTool: ToolConfig = { + id: 'notion_create_page_v2', + name: 'Notion Page Creator', + description: 'Create a new page in Notion', + version: '2.0.0', + oauth: notionCreatePageTool.oauth, + params: notionCreatePageTool.params, + request: notionCreatePageTool.request, + + transformResponse: async (response: Response) => { + const data = await response.json() + let pageTitle = 'Untitled' + + if (data.properties?.title) { + const titleProperty = data.properties.title + if ( + titleProperty.title && + Array.isArray(titleProperty.title) && + titleProperty.title.length > 0 + ) { + pageTitle = titleProperty.title.map((t: any) => t.plain_text || '').join('') + } + } + + return { + success: true, + output: { + id: data.id, + title: pageTitle, + url: data.url, + created_time: data.created_time, + last_edited_time: data.last_edited_time, + }, + } + }, + + outputs: { + id: { type: 'string', description: 'Page ID' }, + title: { type: 'string', description: 'Page title' }, + url: { type: 'string', description: 'Page URL' }, + created_time: { type: 'string', description: 'Creation timestamp' }, + last_edited_time: { type: 'string', description: 'Last edit timestamp' }, + }, +} diff --git a/apps/sim/tools/notion/index.ts b/apps/sim/tools/notion/index.ts index 8adaa3091a..8b7f9dbe55 100644 --- a/apps/sim/tools/notion/index.ts +++ b/apps/sim/tools/notion/index.ts @@ -1,13 +1,17 @@ -import { notionCreateDatabaseTool } from '@/tools/notion/create_database' -import { notionCreatePageTool } from '@/tools/notion/create_page' -import { notionQueryDatabaseTool } from '@/tools/notion/query_database' -import { notionReadTool } from '@/tools/notion/read' -import { notionReadDatabaseTool } from '@/tools/notion/read_database' -import { notionSearchTool } from '@/tools/notion/search' -import { notionUpdatePageTool } from '@/tools/notion/update_page' -import { notionWriteTool } from '@/tools/notion/write' +import { + notionCreateDatabaseTool, + notionCreateDatabaseV2Tool, +} from '@/tools/notion/create_database' +import { notionCreatePageTool, notionCreatePageV2Tool } from '@/tools/notion/create_page' +import { notionQueryDatabaseTool, notionQueryDatabaseV2Tool } from '@/tools/notion/query_database' +import { notionReadTool, notionReadV2Tool } from '@/tools/notion/read' +import { notionReadDatabaseTool, notionReadDatabaseV2Tool } from '@/tools/notion/read_database' +import { notionSearchTool, notionSearchV2Tool } from '@/tools/notion/search' +import { notionUpdatePageTool, notionUpdatePageV2Tool } from '@/tools/notion/update_page' +import { notionWriteTool, notionWriteV2Tool } from '@/tools/notion/write' export { + // Legacy tools notionReadTool, notionReadDatabaseTool, notionWriteTool, @@ -16,4 +20,13 @@ export { notionQueryDatabaseTool, notionSearchTool, notionCreateDatabaseTool, + // V2 tools + notionReadV2Tool, + notionReadDatabaseV2Tool, + notionWriteV2Tool, + notionCreatePageV2Tool, + notionUpdatePageV2Tool, + notionQueryDatabaseV2Tool, + notionSearchV2Tool, + notionCreateDatabaseV2Tool, } diff --git a/apps/sim/tools/notion/query_database.ts b/apps/sim/tools/notion/query_database.ts index 3618913a9a..2cb2fdbd35 100644 --- a/apps/sim/tools/notion/query_database.ts +++ b/apps/sim/tools/notion/query_database.ts @@ -162,3 +162,62 @@ export const notionQueryDatabaseTool: ToolConfig = { + id: 'notion_query_database_v2', + name: 'Query Notion Database', + description: 'Query and filter Notion database entries with advanced filtering', + version: '2.0.0', + oauth: notionQueryDatabaseTool.oauth, + params: notionQueryDatabaseTool.params, + request: notionQueryDatabaseTool.request, + + transformResponse: async (response: Response) => { + const data = await response.json() + const results = data.results || [] + + return { + success: true, + output: { + results, + has_more: data.has_more || false, + next_cursor: data.next_cursor || null, + total_results: results.length, + }, + } + }, + + outputs: { + results: { + type: 'array', + description: 'Array of Notion page objects from the database', + items: { + type: 'object', + properties: { + id: { type: 'string', description: 'Page ID' }, + properties: { type: 'object', description: 'Page properties' }, + created_time: { type: 'string', description: 'Creation timestamp' }, + last_edited_time: { type: 'string', description: 'Last edit timestamp' }, + url: { type: 'string', description: 'Page URL' }, + }, + }, + }, + has_more: { type: 'boolean', description: 'Whether more results are available' }, + next_cursor: { type: 'string', description: 'Cursor for pagination' }, + total_results: { type: 'number', description: 'Number of results returned' }, + }, +} diff --git a/apps/sim/tools/notion/read.ts b/apps/sim/tools/notion/read.ts index 70c84163ab..72dcea3e8c 100644 --- a/apps/sim/tools/notion/read.ts +++ b/apps/sim/tools/notion/read.ts @@ -168,3 +168,132 @@ export const notionReadTool: ToolConfig = { }, }, } + +// V2 Tool with API-aligned outputs +interface NotionReadV2Response { + success: boolean + output: { + content: string + title: string + url: string + created_time: string + last_edited_time: string + } +} + +export const notionReadV2Tool: ToolConfig = { + id: 'notion_read_v2', + name: 'Notion Reader', + description: 'Read content from a Notion page', + version: '2.0.0', + oauth: notionReadTool.oauth, + params: notionReadTool.params, + request: notionReadTool.request, + + transformResponse: async (response: Response, params?: NotionReadParams) => { + const data = await response.json() + let pageTitle = 'Untitled' + + if (data.properties?.title) { + const titleProperty = data.properties.title + if ( + titleProperty.title && + Array.isArray(titleProperty.title) && + titleProperty.title.length > 0 + ) { + pageTitle = titleProperty.title.map((t: any) => t.plain_text || '').join('') + } + } + + const pageId = params?.pageId + const accessToken = params?.accessToken + + if (!pageId || !accessToken) { + return { + success: true, + output: { + content: '', + title: pageTitle, + url: data.url, + created_time: data.created_time, + last_edited_time: data.last_edited_time, + }, + } + } + + const blocksResponse = await fetch( + `https://api.notion.com/v1/blocks/${pageId}/children?page_size=100`, + { + method: 'GET', + headers: { + Authorization: `Bearer ${accessToken}`, + 'Notion-Version': '2022-06-28', + 'Content-Type': 'application/json', + }, + } + ) + + if (!blocksResponse.ok) { + return { + success: true, + output: { + content: '', + title: pageTitle, + url: data.url, + created_time: data.created_time, + last_edited_time: data.last_edited_time, + }, + } + } + + const blocksData = await blocksResponse.json() + const blocks = blocksData.results || [] + const content = blocks + .map((block: any) => { + if (block.type === 'paragraph') { + return block.paragraph.rich_text.map((text: any) => text.plain_text).join('') + } + if (block.type === 'heading_1') { + return `# ${block.heading_1.rich_text.map((text: any) => text.plain_text).join('')}` + } + if (block.type === 'heading_2') { + return `## ${block.heading_2.rich_text.map((text: any) => text.plain_text).join('')}` + } + if (block.type === 'heading_3') { + return `### ${block.heading_3.rich_text.map((text: any) => text.plain_text).join('')}` + } + if (block.type === 'bulleted_list_item') { + return `• ${block.bulleted_list_item.rich_text.map((text: any) => text.plain_text).join('')}` + } + if (block.type === 'numbered_list_item') { + return `1. ${block.numbered_list_item.rich_text.map((text: any) => text.plain_text).join('')}` + } + if (block.type === 'to_do') { + const checked = block.to_do.checked ? '[x]' : '[ ]' + return `${checked} ${block.to_do.rich_text.map((text: any) => text.plain_text).join('')}` + } + return '' + }) + .filter(Boolean) + .join('\n\n') + + return { + success: true, + output: { + content, + title: pageTitle, + url: data.url, + created_time: data.created_time, + last_edited_time: data.last_edited_time, + }, + } + }, + + outputs: { + content: { type: 'string', description: 'Page content in markdown format' }, + title: { type: 'string', description: 'Page title' }, + url: { type: 'string', description: 'Page URL' }, + created_time: { type: 'string', description: 'Creation timestamp' }, + last_edited_time: { type: 'string', description: 'Last edit timestamp' }, + }, +} diff --git a/apps/sim/tools/notion/read_database.ts b/apps/sim/tools/notion/read_database.ts index 91d78b37fe..c46479e479 100644 --- a/apps/sim/tools/notion/read_database.ts +++ b/apps/sim/tools/notion/read_database.ts @@ -101,3 +101,55 @@ export const notionReadDatabaseTool: ToolConfig + } +} + +export const notionReadDatabaseV2Tool: ToolConfig< + NotionReadDatabaseParams, + NotionReadDatabaseV2Response +> = { + id: 'notion_read_database_v2', + name: 'Read Notion Database', + description: 'Read database information and structure from Notion', + version: '2.0.0', + oauth: notionReadDatabaseTool.oauth, + params: notionReadDatabaseTool.params, + request: notionReadDatabaseTool.request, + + transformResponse: async (response: Response) => { + const data = await response.json() + const title = data.title?.map((t: any) => t.plain_text || '').join('') || 'Untitled Database' + + return { + success: true, + output: { + id: data.id, + title, + url: data.url, + created_time: data.created_time, + last_edited_time: data.last_edited_time, + properties: data.properties || {}, + }, + } + }, + + outputs: { + id: { type: 'string', description: 'Database ID' }, + title: { type: 'string', description: 'Database title' }, + url: { type: 'string', description: 'Database URL' }, + created_time: { type: 'string', description: 'Creation timestamp' }, + last_edited_time: { type: 'string', description: 'Last edit timestamp' }, + properties: { type: 'object', description: 'Database properties schema' }, + }, +} diff --git a/apps/sim/tools/notion/search.ts b/apps/sim/tools/notion/search.ts index 259f23f5f1..ccedb808c7 100644 --- a/apps/sim/tools/notion/search.ts +++ b/apps/sim/tools/notion/search.ts @@ -133,3 +133,59 @@ export const notionSearchTool: ToolConfig = }, }, } + +// V2 Tool with API-aligned outputs +interface NotionSearchV2Response { + success: boolean + output: { + results: any[] + has_more: boolean + next_cursor: string | null + total_results: number + } +} + +export const notionSearchV2Tool: ToolConfig = { + id: 'notion_search_v2', + name: 'Search Notion Workspace', + description: 'Search across all pages and databases in Notion workspace', + version: '2.0.0', + oauth: notionSearchTool.oauth, + params: notionSearchTool.params, + request: notionSearchTool.request, + + transformResponse: async (response: Response) => { + const data = await response.json() + const results = data.results || [] + + return { + success: true, + output: { + results, + has_more: data.has_more || false, + next_cursor: data.next_cursor || null, + total_results: results.length, + }, + } + }, + + outputs: { + results: { + type: 'array', + description: 'Array of search results (pages and databases)', + items: { + type: 'object', + properties: { + id: { type: 'string', description: 'Object ID' }, + object: { type: 'string', description: 'Object type (page or database)' }, + url: { type: 'string', description: 'Object URL' }, + created_time: { type: 'string', description: 'Creation timestamp' }, + last_edited_time: { type: 'string', description: 'Last edit timestamp' }, + }, + }, + }, + has_more: { type: 'boolean', description: 'Whether more results are available' }, + next_cursor: { type: 'string', description: 'Cursor for pagination' }, + total_results: { type: 'number', description: 'Number of results returned' }, + }, +} diff --git a/apps/sim/tools/notion/update_page.ts b/apps/sim/tools/notion/update_page.ts index 1363aaba66..25288c0cd3 100644 --- a/apps/sim/tools/notion/update_page.ts +++ b/apps/sim/tools/notion/update_page.ts @@ -96,3 +96,60 @@ export const notionUpdatePageTool: ToolConfig = { + id: 'notion_update_page_v2', + name: 'Notion Page Updater', + description: 'Update properties of a Notion page', + version: '2.0.0', + oauth: notionUpdatePageTool.oauth, + params: notionUpdatePageTool.params, + request: notionUpdatePageTool.request, + + transformResponse: async (response: Response) => { + const data = await response.json() + let pageTitle = 'Untitled' + + if (data.properties?.title) { + const titleProperty = data.properties.title + if ( + titleProperty.title && + Array.isArray(titleProperty.title) && + titleProperty.title.length > 0 + ) { + pageTitle = titleProperty.title.map((t: any) => t.plain_text || '').join('') + } + } + + return { + success: true, + output: { + id: data.id, + title: pageTitle, + url: data.url, + last_edited_time: data.last_edited_time, + }, + } + }, + + outputs: { + id: { type: 'string', description: 'Page ID' }, + title: { type: 'string', description: 'Page title' }, + url: { type: 'string', description: 'Page URL' }, + last_edited_time: { type: 'string', description: 'Last edit timestamp' }, + }, +} diff --git a/apps/sim/tools/notion/write.ts b/apps/sim/tools/notion/write.ts index bc65c47eb5..acb70699dd 100644 --- a/apps/sim/tools/notion/write.ts +++ b/apps/sim/tools/notion/write.ts @@ -87,3 +87,35 @@ export const notionWriteTool: ToolConfig = { }, }, } + +// V2 Tool with API-aligned outputs +interface NotionWriteV2Response { + success: boolean + output: { + appended: boolean + } +} + +export const notionWriteV2Tool: ToolConfig = { + id: 'notion_write_v2', + name: 'Notion Content Appender', + description: 'Append content to a Notion page', + version: '2.0.0', + oauth: notionWriteTool.oauth, + params: notionWriteTool.params, + request: notionWriteTool.request, + + transformResponse: async (response: Response) => { + await response.json() + return { + success: response.ok, + output: { + appended: response.ok, + }, + } + }, + + outputs: { + appended: { type: 'boolean', description: 'Whether content was successfully appended' }, + }, +} diff --git a/apps/sim/tools/pipedrive/create_activity.ts b/apps/sim/tools/pipedrive/create_activity.ts index 78e936508e..6844db2b6b 100644 --- a/apps/sim/tools/pipedrive/create_activity.ts +++ b/apps/sim/tools/pipedrive/create_activity.ts @@ -123,9 +123,6 @@ export const pipedriveCreateActivityTool: ToolConfig< success: true, output: { activity: data.data, - metadata: { - operation: 'create_activity' as const, - }, success: true, }, } @@ -133,7 +130,6 @@ export const pipedriveCreateActivityTool: ToolConfig< outputs: { activity: { type: 'object', description: 'The created activity object' }, - metadata: { type: 'object', description: 'Operation metadata' }, success: { type: 'boolean', description: 'Operation success status' }, }, } diff --git a/apps/sim/tools/pipedrive/create_deal.ts b/apps/sim/tools/pipedrive/create_deal.ts index e0b4762a33..497aa72e37 100644 --- a/apps/sim/tools/pipedrive/create_deal.ts +++ b/apps/sim/tools/pipedrive/create_deal.ts @@ -123,9 +123,6 @@ export const pipedriveCreateDealTool: ToolConfig< success: true, output: { deal: data.data, - metadata: { - operation: 'create_deal' as const, - }, success: true, }, } @@ -133,7 +130,6 @@ export const pipedriveCreateDealTool: ToolConfig< outputs: { deal: { type: 'object', description: 'The created deal object' }, - metadata: { type: 'object', description: 'Operation metadata' }, success: { type: 'boolean', description: 'Operation success status' }, }, } diff --git a/apps/sim/tools/pipedrive/create_lead.ts b/apps/sim/tools/pipedrive/create_lead.ts index 649bbe7484..1f936137ba 100644 --- a/apps/sim/tools/pipedrive/create_lead.ts +++ b/apps/sim/tools/pipedrive/create_lead.ts @@ -132,9 +132,6 @@ export const pipedriveCreateLeadTool: ToolConfig< success: true, output: { lead: data.data, - metadata: { - operation: 'create_lead' as const, - }, success: true, }, } @@ -142,7 +139,6 @@ export const pipedriveCreateLeadTool: ToolConfig< outputs: { lead: { type: 'object', description: 'The created lead object' }, - metadata: { type: 'object', description: 'Operation metadata' }, success: { type: 'boolean', description: 'Operation success status' }, }, } diff --git a/apps/sim/tools/pipedrive/create_project.ts b/apps/sim/tools/pipedrive/create_project.ts index 70395fba6a..918241644f 100644 --- a/apps/sim/tools/pipedrive/create_project.ts +++ b/apps/sim/tools/pipedrive/create_project.ts @@ -88,9 +88,6 @@ export const pipedriveCreateProjectTool: ToolConfig< success: true, output: { project: data.data, - metadata: { - operation: 'create_project' as const, - }, success: true, }, } @@ -98,7 +95,6 @@ export const pipedriveCreateProjectTool: ToolConfig< outputs: { project: { type: 'object', description: 'The created project object' }, - metadata: { type: 'object', description: 'Operation metadata' }, success: { type: 'boolean', description: 'Operation success status' }, }, } diff --git a/apps/sim/tools/pipedrive/delete_lead.ts b/apps/sim/tools/pipedrive/delete_lead.ts index 10c2635bb6..a5568084bf 100644 --- a/apps/sim/tools/pipedrive/delete_lead.ts +++ b/apps/sim/tools/pipedrive/delete_lead.ts @@ -63,9 +63,6 @@ export const pipedriveDeleteLeadTool: ToolConfig< success: true, output: { data: data.data, - metadata: { - operation: 'delete_lead' as const, - }, success: true, }, } @@ -73,7 +70,6 @@ export const pipedriveDeleteLeadTool: ToolConfig< outputs: { data: { type: 'object', description: 'Deletion confirmation data' }, - metadata: { type: 'object', description: 'Operation metadata' }, success: { type: 'boolean', description: 'Operation success status' }, }, } diff --git a/apps/sim/tools/pipedrive/get_activities.ts b/apps/sim/tools/pipedrive/get_activities.ts index 554f64a6ce..977765de35 100644 --- a/apps/sim/tools/pipedrive/get_activities.ts +++ b/apps/sim/tools/pipedrive/get_activities.ts @@ -103,10 +103,7 @@ export const pipedriveGetActivitiesTool: ToolConfig< success: true, output: { activities, - metadata: { - operation: 'get_activities' as const, - totalItems: activities.length, - }, + total_items: activities.length, success: true, }, } @@ -114,7 +111,7 @@ export const pipedriveGetActivitiesTool: ToolConfig< outputs: { activities: { type: 'array', description: 'Array of activity objects from Pipedrive' }, - metadata: { type: 'object', description: 'Operation metadata' }, + total_items: { type: 'number', description: 'Total number of activities returned' }, success: { type: 'boolean', description: 'Operation success status' }, }, } diff --git a/apps/sim/tools/pipedrive/get_all_deals.ts b/apps/sim/tools/pipedrive/get_all_deals.ts index c9457a6a3f..2307188976 100644 --- a/apps/sim/tools/pipedrive/get_all_deals.ts +++ b/apps/sim/tools/pipedrive/get_all_deals.ts @@ -108,9 +108,8 @@ export const pipedriveGetAllDealsTool: ToolConfig< output: { deals, metadata: { - operation: 'get_all_deals' as const, - totalItems: deals.length, - hasMore, + total_items: deals.length, + has_more: hasMore, }, success: true, }, @@ -119,7 +118,10 @@ export const pipedriveGetAllDealsTool: ToolConfig< outputs: { deals: { type: 'array', description: 'Array of deal objects from Pipedrive' }, - metadata: { type: 'object', description: 'Operation metadata' }, + metadata: { + type: 'object', + description: 'Pagination metadata for the response', + }, success: { type: 'boolean', description: 'Operation success status' }, }, } diff --git a/apps/sim/tools/pipedrive/get_deal.ts b/apps/sim/tools/pipedrive/get_deal.ts index 26600e67a4..3d00a5b425 100644 --- a/apps/sim/tools/pipedrive/get_deal.ts +++ b/apps/sim/tools/pipedrive/get_deal.ts @@ -52,9 +52,6 @@ export const pipedriveGetDealTool: ToolConfig - errorsWhileComputingFlags: boolean + feature_flags: FlagEvaluation + feature_flag_payloads: Record + errors_while_computing_flags: boolean } export const evaluateFlagsTool: ToolConfig = { @@ -113,23 +113,23 @@ export const evaluateFlagsTool: ToolConfig = { columns: data.columns || undefined, types: data.types || undefined, hogql: data.hogql || undefined, - hasMore: data.hasMore || false, + has_more: data.hasMore || false, }, } }, @@ -156,7 +156,7 @@ export const queryTool: ToolConfig = { description: 'The actual HogQL query that was executed', optional: true, }, - hasMore: { + has_more: { type: 'boolean', description: 'Whether there are more results available', optional: true, diff --git a/apps/sim/tools/registry.ts b/apps/sim/tools/registry.ts index dae22573d8..b3a9aab450 100644 --- a/apps/sim/tools/registry.ts +++ b/apps/sim/tools/registry.ts @@ -84,12 +84,19 @@ import { } from '@/tools/confluence' import { cursorAddFollowupTool, + cursorAddFollowupV2Tool, cursorDeleteAgentTool, + cursorDeleteAgentV2Tool, cursorGetAgentTool, + cursorGetAgentV2Tool, cursorGetConversationTool, + cursorGetConversationV2Tool, cursorLaunchAgentTool, + cursorLaunchAgentV2Tool, cursorListAgentsTool, + cursorListAgentsV2Tool, cursorStopAgentTool, + cursorStopAgentV2Tool, } from '@/tools/cursor' import { datadogCancelDowntimeTool, @@ -209,57 +216,109 @@ import { import { functionExecuteTool } from '@/tools/function' import { githubAddAssigneesTool, + githubAddAssigneesV2Tool, githubAddLabelsTool, + githubAddLabelsV2Tool, githubCancelWorkflowRunTool, + githubCancelWorkflowRunV2Tool, githubCloseIssueTool, + githubCloseIssueV2Tool, githubClosePRTool, + githubClosePRV2Tool, githubCommentTool, + githubCommentV2Tool, githubCreateBranchTool, + githubCreateBranchV2Tool, githubCreateFileTool, + githubCreateFileV2Tool, githubCreateIssueTool, + githubCreateIssueV2Tool, githubCreatePRTool, + githubCreatePRV2Tool, githubCreateProjectTool, + githubCreateProjectV2Tool, githubCreateReleaseTool, + githubCreateReleaseV2Tool, githubDeleteBranchTool, + githubDeleteBranchV2Tool, githubDeleteCommentTool, + githubDeleteCommentV2Tool, githubDeleteFileTool, + githubDeleteFileV2Tool, githubDeleteProjectTool, + githubDeleteProjectV2Tool, githubDeleteReleaseTool, + githubDeleteReleaseV2Tool, githubGetBranchProtectionTool, + githubGetBranchProtectionV2Tool, githubGetBranchTool, + githubGetBranchV2Tool, githubGetFileContentTool, + githubGetFileContentV2Tool, githubGetIssueTool, + githubGetIssueV2Tool, githubGetPRFilesTool, + githubGetPRFilesV2Tool, githubGetProjectTool, + githubGetProjectV2Tool, githubGetReleaseTool, + githubGetReleaseV2Tool, githubGetTreeTool, + githubGetTreeV2Tool, githubGetWorkflowRunTool, + githubGetWorkflowRunV2Tool, githubGetWorkflowTool, + githubGetWorkflowV2Tool, githubIssueCommentTool, + githubIssueCommentV2Tool, githubLatestCommitTool, + githubLatestCommitV2Tool, githubListBranchesTool, + githubListBranchesV2Tool, githubListIssueCommentsTool, + githubListIssueCommentsV2Tool, githubListIssuesTool, + githubListIssuesV2Tool, githubListPRCommentsTool, + githubListPRCommentsV2Tool, githubListPRsTool, + githubListPRsV2Tool, githubListProjectsTool, + githubListProjectsV2Tool, githubListReleasesTool, + githubListReleasesV2Tool, githubListWorkflowRunsTool, + githubListWorkflowRunsV2Tool, githubListWorkflowsTool, + githubListWorkflowsV2Tool, githubMergePRTool, + githubMergePRV2Tool, githubPrTool, + githubPrV2Tool, githubRemoveLabelTool, + githubRemoveLabelV2Tool, githubRepoInfoTool, + githubRepoInfoV2Tool, githubRequestReviewersTool, + githubRequestReviewersV2Tool, githubRerunWorkflowTool, + githubRerunWorkflowV2Tool, githubTriggerWorkflowTool, + githubTriggerWorkflowV2Tool, githubUpdateBranchProtectionTool, + githubUpdateBranchProtectionV2Tool, githubUpdateCommentTool, + githubUpdateCommentV2Tool, githubUpdateFileTool, + githubUpdateFileV2Tool, githubUpdateIssueTool, + githubUpdateIssueV2Tool, githubUpdatePRTool, + githubUpdatePRV2Tool, githubUpdateProjectTool, + githubUpdateProjectV2Tool, githubUpdateReleaseTool, + githubUpdateReleaseV2Tool, } from '@/tools/github' import { gitlabCancelPipelineTool, @@ -284,25 +343,42 @@ import { } from '@/tools/gitlab' import { gmailAddLabelTool, + gmailAddLabelV2Tool, gmailArchiveTool, + gmailArchiveV2Tool, gmailDeleteTool, + gmailDeleteV2Tool, gmailDraftTool, + gmailDraftV2Tool, gmailMarkReadTool, + gmailMarkReadV2Tool, gmailMarkUnreadTool, + gmailMarkUnreadV2Tool, gmailMoveTool, + gmailMoveV2Tool, gmailReadTool, + gmailReadV2Tool, gmailRemoveLabelTool, + gmailRemoveLabelV2Tool, gmailSearchTool, + gmailSearchV2Tool, gmailSendTool, + gmailSendV2Tool, gmailUnarchiveTool, + gmailUnarchiveV2Tool, } from '@/tools/gmail' import { googleSearchTool } from '@/tools/google' import { googleCalendarCreateTool, + googleCalendarCreateV2Tool, googleCalendarGetTool, + googleCalendarGetV2Tool, googleCalendarInviteTool, + googleCalendarInviteV2Tool, googleCalendarListTool, + googleCalendarListV2Tool, googleCalendarQuickAddTool, + googleCalendarQuickAddV2Tool, } from '@/tools/google_calendar' import { googleDocsCreateTool, googleDocsReadTool, googleDocsWriteTool } from '@/tools/google_docs' import { @@ -461,21 +537,37 @@ import { } from '@/tools/incidentio' import { intercomCreateCompanyTool, + intercomCreateCompanyV2Tool, intercomCreateContactTool, + intercomCreateContactV2Tool, intercomCreateMessageTool, + intercomCreateMessageV2Tool, intercomCreateTicketTool, + intercomCreateTicketV2Tool, intercomDeleteContactTool, + intercomDeleteContactV2Tool, intercomGetCompanyTool, + intercomGetCompanyV2Tool, intercomGetContactTool, + intercomGetContactV2Tool, intercomGetConversationTool, + intercomGetConversationV2Tool, intercomGetTicketTool, + intercomGetTicketV2Tool, intercomListCompaniesTool, + intercomListCompaniesV2Tool, intercomListContactsTool, + intercomListContactsV2Tool, intercomListConversationsTool, + intercomListConversationsV2Tool, intercomReplyConversationTool, + intercomReplyConversationV2Tool, intercomSearchContactsTool, + intercomSearchContactsV2Tool, intercomSearchConversationsTool, + intercomSearchConversationsV2Tool, intercomUpdateContactTool, + intercomUpdateContactV2Tool, } from '@/tools/intercom' import { jinaReadUrlTool, jinaSearchTool } from '@/tools/jina' import { @@ -781,12 +873,20 @@ import { } from '@/tools/neo4j' import { notionCreateDatabaseTool, + notionCreateDatabaseV2Tool, notionCreatePageTool, + notionCreatePageV2Tool, notionQueryDatabaseTool, + notionQueryDatabaseV2Tool, notionReadDatabaseTool, + notionReadDatabaseV2Tool, notionReadTool, + notionReadV2Tool, notionSearchTool, + notionSearchV2Tool, + notionUpdatePageV2Tool, notionWriteTool, + notionWriteV2Tool, } from '@/tools/notion' import { onedriveCreateFolderTool, @@ -1607,7 +1707,9 @@ export const tools: Record = { slack_delete_message: slackDeleteMessageTool, slack_add_reaction: slackAddReactionTool, github_repo_info: githubRepoInfoTool, + github_repo_info_v2: githubRepoInfoV2Tool, github_latest_commit: githubLatestCommitTool, + github_latest_commit_v2: githubLatestCommitV2Tool, serper_search: serperSearchTool, servicenow_create_record: servicenowCreateRecordTool, servicenow_read_record: servicenowReadRecordTool, @@ -1670,18 +1772,39 @@ export const tools: Record = { notion_query_database: notionQueryDatabaseTool, notion_search: notionSearchTool, notion_create_database: notionCreateDatabaseTool, + // Notion V2 tools + notion_read_v2: notionReadV2Tool, + notion_read_database_v2: notionReadDatabaseV2Tool, + notion_write_v2: notionWriteV2Tool, + notion_create_page_v2: notionCreatePageV2Tool, + notion_query_database_v2: notionQueryDatabaseV2Tool, + notion_search_v2: notionSearchV2Tool, + notion_create_database_v2: notionCreateDatabaseV2Tool, + notion_update_page_v2: notionUpdatePageV2Tool, gmail_send: gmailSendTool, + gmail_send_v2: gmailSendV2Tool, gmail_read: gmailReadTool, + gmail_read_v2: gmailReadV2Tool, gmail_search: gmailSearchTool, + gmail_search_v2: gmailSearchV2Tool, gmail_draft: gmailDraftTool, + gmail_draft_v2: gmailDraftV2Tool, gmail_move: gmailMoveTool, + gmail_move_v2: gmailMoveV2Tool, gmail_mark_read: gmailMarkReadTool, + gmail_mark_read_v2: gmailMarkReadV2Tool, gmail_mark_unread: gmailMarkUnreadTool, + gmail_mark_unread_v2: gmailMarkUnreadV2Tool, gmail_archive: gmailArchiveTool, + gmail_archive_v2: gmailArchiveV2Tool, gmail_unarchive: gmailUnarchiveTool, + gmail_unarchive_v2: gmailUnarchiveV2Tool, gmail_delete: gmailDeleteTool, + gmail_delete_v2: gmailDeleteV2Tool, gmail_add_label: gmailAddLabelTool, + gmail_add_label_v2: gmailAddLabelV2Tool, gmail_remove_label: gmailRemoveLabelTool, + gmail_remove_label_v2: gmailRemoveLabelV2Tool, whatsapp_send_message: whatsappSendMessageTool, x_write: xWriteTool, x_read: xReadTool, @@ -1754,55 +1877,105 @@ export const tools: Record = { neo4j_delete: neo4jDeleteTool, neo4j_execute: neo4jExecuteTool, github_pr: githubPrTool, + github_pr_v2: githubPrV2Tool, github_comment: githubCommentTool, + github_comment_v2: githubCommentV2Tool, github_issue_comment: githubIssueCommentTool, + github_issue_comment_v2: githubIssueCommentV2Tool, github_list_issue_comments: githubListIssueCommentsTool, + github_list_issue_comments_v2: githubListIssueCommentsV2Tool, github_update_comment: githubUpdateCommentTool, + github_update_comment_v2: githubUpdateCommentV2Tool, github_delete_comment: githubDeleteCommentTool, + github_delete_comment_v2: githubDeleteCommentV2Tool, github_list_pr_comments: githubListPRCommentsTool, + github_list_pr_comments_v2: githubListPRCommentsV2Tool, github_create_pr: githubCreatePRTool, + github_create_pr_v2: githubCreatePRV2Tool, github_update_pr: githubUpdatePRTool, + github_update_pr_v2: githubUpdatePRV2Tool, github_merge_pr: githubMergePRTool, + github_merge_pr_v2: githubMergePRV2Tool, github_list_prs: githubListPRsTool, + github_list_prs_v2: githubListPRsV2Tool, github_get_pr_files: githubGetPRFilesTool, + github_get_pr_files_v2: githubGetPRFilesV2Tool, github_close_pr: githubClosePRTool, + github_close_pr_v2: githubClosePRV2Tool, github_request_reviewers: githubRequestReviewersTool, + github_request_reviewers_v2: githubRequestReviewersV2Tool, github_get_file_content: githubGetFileContentTool, + github_get_file_content_v2: githubGetFileContentV2Tool, github_create_file: githubCreateFileTool, + github_create_file_v2: githubCreateFileV2Tool, github_update_file: githubUpdateFileTool, + github_update_file_v2: githubUpdateFileV2Tool, github_delete_file: githubDeleteFileTool, + github_delete_file_v2: githubDeleteFileV2Tool, github_get_tree: githubGetTreeTool, + github_get_tree_v2: githubGetTreeV2Tool, github_list_branches: githubListBranchesTool, + github_list_branches_v2: githubListBranchesV2Tool, github_get_branch: githubGetBranchTool, + github_get_branch_v2: githubGetBranchV2Tool, github_create_branch: githubCreateBranchTool, + github_create_branch_v2: githubCreateBranchV2Tool, github_delete_branch: githubDeleteBranchTool, + github_delete_branch_v2: githubDeleteBranchV2Tool, github_get_branch_protection: githubGetBranchProtectionTool, + github_get_branch_protection_v2: githubGetBranchProtectionV2Tool, github_update_branch_protection: githubUpdateBranchProtectionTool, + github_update_branch_protection_v2: githubUpdateBranchProtectionV2Tool, github_create_issue: githubCreateIssueTool, + github_create_issue_v2: githubCreateIssueV2Tool, github_update_issue: githubUpdateIssueTool, + github_update_issue_v2: githubUpdateIssueV2Tool, github_list_issues: githubListIssuesTool, + github_list_issues_v2: githubListIssuesV2Tool, github_get_issue: githubGetIssueTool, + github_get_issue_v2: githubGetIssueV2Tool, github_close_issue: githubCloseIssueTool, + github_close_issue_v2: githubCloseIssueV2Tool, github_add_labels: githubAddLabelsTool, + github_add_labels_v2: githubAddLabelsV2Tool, github_remove_label: githubRemoveLabelTool, + github_remove_label_v2: githubRemoveLabelV2Tool, github_add_assignees: githubAddAssigneesTool, + github_add_assignees_v2: githubAddAssigneesV2Tool, github_create_release: githubCreateReleaseTool, + github_create_release_v2: githubCreateReleaseV2Tool, github_update_release: githubUpdateReleaseTool, + github_update_release_v2: githubUpdateReleaseV2Tool, github_list_releases: githubListReleasesTool, + github_list_releases_v2: githubListReleasesV2Tool, github_get_release: githubGetReleaseTool, + github_get_release_v2: githubGetReleaseV2Tool, github_delete_release: githubDeleteReleaseTool, + github_delete_release_v2: githubDeleteReleaseV2Tool, github_list_workflows: githubListWorkflowsTool, + github_list_workflows_v2: githubListWorkflowsV2Tool, github_get_workflow: githubGetWorkflowTool, + github_get_workflow_v2: githubGetWorkflowV2Tool, github_trigger_workflow: githubTriggerWorkflowTool, + github_trigger_workflow_v2: githubTriggerWorkflowV2Tool, github_list_workflow_runs: githubListWorkflowRunsTool, + github_list_workflow_runs_v2: githubListWorkflowRunsV2Tool, github_get_workflow_run: githubGetWorkflowRunTool, + github_get_workflow_run_v2: githubGetWorkflowRunV2Tool, github_cancel_workflow_run: githubCancelWorkflowRunTool, + github_cancel_workflow_run_v2: githubCancelWorkflowRunV2Tool, github_rerun_workflow: githubRerunWorkflowTool, + github_rerun_workflow_v2: githubRerunWorkflowV2Tool, github_list_projects: githubListProjectsTool, + github_list_projects_v2: githubListProjectsV2Tool, github_get_project: githubGetProjectTool, + github_get_project_v2: githubGetProjectV2Tool, github_create_project: githubCreateProjectTool, + github_create_project_v2: githubCreateProjectV2Tool, github_update_project: githubUpdateProjectTool, + github_update_project_v2: githubUpdateProjectV2Tool, github_delete_project: githubDeleteProjectTool, + github_delete_project_v2: githubDeleteProjectV2Tool, gitlab_list_projects: gitlabListProjectsTool, gitlab_get_project: gitlabGetProjectTool, gitlab_list_issues: gitlabListIssuesTool, @@ -1959,12 +2132,19 @@ export const tools: Record = { confluence_get_space: confluenceGetSpaceTool, confluence_list_spaces: confluenceListSpacesTool, cursor_list_agents: cursorListAgentsTool, + cursor_list_agents_v2: cursorListAgentsV2Tool, cursor_get_agent: cursorGetAgentTool, + cursor_get_agent_v2: cursorGetAgentV2Tool, cursor_get_conversation: cursorGetConversationTool, + cursor_get_conversation_v2: cursorGetConversationV2Tool, cursor_launch_agent: cursorLaunchAgentTool, + cursor_launch_agent_v2: cursorLaunchAgentV2Tool, cursor_add_followup: cursorAddFollowupTool, + cursor_add_followup_v2: cursorAddFollowupV2Tool, cursor_stop_agent: cursorStopAgentTool, + cursor_stop_agent_v2: cursorStopAgentV2Tool, cursor_delete_agent: cursorDeleteAgentTool, + cursor_delete_agent_v2: cursorDeleteAgentV2Tool, trello_list_lists: trelloListListsTool, trello_list_cards: trelloListCardsTool, trello_create_card: trelloCreateCardTool, @@ -2262,10 +2442,15 @@ export const tools: Record = { microsoft_planner_get_task_details: microsoftPlannerGetTaskDetailsTool, microsoft_planner_update_task_details: microsoftPlannerUpdateTaskDetailsTool, google_calendar_create: googleCalendarCreateTool, + google_calendar_create_v2: googleCalendarCreateV2Tool, google_calendar_get: googleCalendarGetTool, + google_calendar_get_v2: googleCalendarGetV2Tool, google_calendar_list: googleCalendarListTool, + google_calendar_list_v2: googleCalendarListV2Tool, google_calendar_quick_add: googleCalendarQuickAddTool, + google_calendar_quick_add_v2: googleCalendarQuickAddV2Tool, google_calendar_invite: googleCalendarInviteTool, + google_calendar_invite_v2: googleCalendarInviteV2Tool, google_forms_get_responses: googleFormsGetResponsesTool, workflow_executor: workflowExecutorTool, wealthbox_read_contact: wealthboxReadContactTool, @@ -2575,21 +2760,37 @@ export const tools: Record = { zendesk_search: zendeskSearchTool, zendesk_search_count: zendeskSearchCountTool, intercom_create_contact: intercomCreateContactTool, + intercom_create_contact_v2: intercomCreateContactV2Tool, intercom_get_contact: intercomGetContactTool, + intercom_get_contact_v2: intercomGetContactV2Tool, intercom_update_contact: intercomUpdateContactTool, + intercom_update_contact_v2: intercomUpdateContactV2Tool, intercom_list_contacts: intercomListContactsTool, + intercom_list_contacts_v2: intercomListContactsV2Tool, intercom_search_contacts: intercomSearchContactsTool, + intercom_search_contacts_v2: intercomSearchContactsV2Tool, intercom_delete_contact: intercomDeleteContactTool, + intercom_delete_contact_v2: intercomDeleteContactV2Tool, intercom_create_company: intercomCreateCompanyTool, + intercom_create_company_v2: intercomCreateCompanyV2Tool, intercom_get_company: intercomGetCompanyTool, + intercom_get_company_v2: intercomGetCompanyV2Tool, intercom_list_companies: intercomListCompaniesTool, + intercom_list_companies_v2: intercomListCompaniesV2Tool, intercom_get_conversation: intercomGetConversationTool, + intercom_get_conversation_v2: intercomGetConversationV2Tool, intercom_list_conversations: intercomListConversationsTool, + intercom_list_conversations_v2: intercomListConversationsV2Tool, intercom_reply_conversation: intercomReplyConversationTool, + intercom_reply_conversation_v2: intercomReplyConversationV2Tool, intercom_search_conversations: intercomSearchConversationsTool, + intercom_search_conversations_v2: intercomSearchConversationsV2Tool, intercom_create_ticket: intercomCreateTicketTool, + intercom_create_ticket_v2: intercomCreateTicketV2Tool, intercom_get_ticket: intercomGetTicketTool, + intercom_get_ticket_v2: intercomGetTicketV2Tool, intercom_create_message: intercomCreateMessageTool, + intercom_create_message_v2: intercomCreateMessageV2Tool, sentry_issues_list: listIssuesTool, sentry_issues_get: getIssueTool, sentry_issues_update: updateIssueTool, diff --git a/apps/sim/tools/salesforce/create_account.ts b/apps/sim/tools/salesforce/create_account.ts index 01f4f4496e..c7043a440c 100644 --- a/apps/sim/tools/salesforce/create_account.ts +++ b/apps/sim/tools/salesforce/create_account.ts @@ -203,9 +203,6 @@ export const salesforceCreateAccountTool: ToolConfig< id: data.id, success: data.success, created: true, - metadata: { - operation: 'create_account' as const, - }, }, } }, @@ -219,7 +216,6 @@ export const salesforceCreateAccountTool: ToolConfig< id: { type: 'string', description: 'Created account ID' }, success: { type: 'boolean', description: 'Salesforce operation success' }, created: { type: 'boolean', description: 'Whether account was created' }, - metadata: { type: 'object', description: 'Operation metadata' }, }, }, }, diff --git a/apps/sim/tools/salesforce/create_case.ts b/apps/sim/tools/salesforce/create_case.ts index 09214ac2e4..bb873c5979 100644 --- a/apps/sim/tools/salesforce/create_case.ts +++ b/apps/sim/tools/salesforce/create_case.ts @@ -108,13 +108,20 @@ export const salesforceCreateCaseTool: ToolConfig< id: data.id, success: data.success, created: true, - metadata: { operation: 'create_case' }, }, } }, outputs: { - success: { type: 'boolean', description: 'Success' }, - output: { type: 'object', description: 'Created case' }, + success: { type: 'boolean', description: 'Operation success status' }, + output: { + type: 'object', + description: 'Created case data', + properties: { + id: { type: 'string', description: 'Created case ID' }, + success: { type: 'boolean', description: 'Salesforce operation success' }, + created: { type: 'boolean', description: 'Whether case was created' }, + }, + }, }, } diff --git a/apps/sim/tools/salesforce/create_contact.ts b/apps/sim/tools/salesforce/create_contact.ts index 68241198b1..8b464bcb1e 100644 --- a/apps/sim/tools/salesforce/create_contact.ts +++ b/apps/sim/tools/salesforce/create_contact.ts @@ -142,7 +142,6 @@ export const salesforceCreateContactTool: ToolConfig< id: data.id, success: data.success, created: true, - metadata: { operation: 'create_contact' as const }, }, } }, @@ -156,7 +155,6 @@ export const salesforceCreateContactTool: ToolConfig< id: { type: 'string', description: 'Created contact ID' }, success: { type: 'boolean', description: 'Salesforce operation success' }, created: { type: 'boolean', description: 'Whether contact was created' }, - metadata: { type: 'object', description: 'Operation metadata' }, }, }, }, diff --git a/apps/sim/tools/salesforce/create_lead.ts b/apps/sim/tools/salesforce/create_lead.ts index 93d92f0c2c..7cc1e0d53e 100644 --- a/apps/sim/tools/salesforce/create_lead.ts +++ b/apps/sim/tools/salesforce/create_lead.ts @@ -94,13 +94,20 @@ export const salesforceCreateLeadTool: ToolConfig< id: data.id, success: data.success, created: true, - metadata: { operation: 'create_lead' }, }, } }, outputs: { - success: { type: 'boolean', description: 'Success' }, - output: { type: 'object', description: 'Created lead' }, + success: { type: 'boolean', description: 'Operation success status' }, + output: { + type: 'object', + description: 'Created lead data', + properties: { + id: { type: 'string', description: 'Created lead ID' }, + success: { type: 'boolean', description: 'Salesforce operation success' }, + created: { type: 'boolean', description: 'Whether lead was created' }, + }, + }, }, } diff --git a/apps/sim/tools/salesforce/create_opportunity.ts b/apps/sim/tools/salesforce/create_opportunity.ts index eba10e3b6a..7971459742 100644 --- a/apps/sim/tools/salesforce/create_opportunity.ts +++ b/apps/sim/tools/salesforce/create_opportunity.ts @@ -99,13 +99,20 @@ export const salesforceCreateOpportunityTool: ToolConfig< id: data.id, success: data.success, created: true, - metadata: { operation: 'create_opportunity' }, }, } }, outputs: { - success: { type: 'boolean', description: 'Success' }, - output: { type: 'object', description: 'Created opportunity' }, + success: { type: 'boolean', description: 'Operation success status' }, + output: { + type: 'object', + description: 'Created opportunity data', + properties: { + id: { type: 'string', description: 'Created opportunity ID' }, + success: { type: 'boolean', description: 'Salesforce operation success' }, + created: { type: 'boolean', description: 'Whether opportunity was created' }, + }, + }, }, } diff --git a/apps/sim/tools/salesforce/create_task.ts b/apps/sim/tools/salesforce/create_task.ts index c815185d75..a1c726b6ca 100644 --- a/apps/sim/tools/salesforce/create_task.ts +++ b/apps/sim/tools/salesforce/create_task.ts @@ -108,13 +108,20 @@ export const salesforceCreateTaskTool: ToolConfig< id: data.id, success: data.success, created: true, - metadata: { operation: 'create_task' }, }, } }, outputs: { - success: { type: 'boolean', description: 'Success' }, - output: { type: 'object', description: 'Created task' }, + success: { type: 'boolean', description: 'Operation success status' }, + output: { + type: 'object', + description: 'Created task data', + properties: { + id: { type: 'string', description: 'Created task ID' }, + success: { type: 'boolean', description: 'Salesforce operation success' }, + created: { type: 'boolean', description: 'Whether task was created' }, + }, + }, }, } diff --git a/apps/sim/tools/salesforce/delete_account.ts b/apps/sim/tools/salesforce/delete_account.ts index 5d51d3c5c0..5693df781e 100644 --- a/apps/sim/tools/salesforce/delete_account.ts +++ b/apps/sim/tools/salesforce/delete_account.ts @@ -109,9 +109,6 @@ export const salesforceDeleteAccountTool: ToolConfig< output: { id: params?.accountId || '', deleted: true, - metadata: { - operation: 'delete_account' as const, - }, }, } }, @@ -124,7 +121,6 @@ export const salesforceDeleteAccountTool: ToolConfig< properties: { id: { type: 'string', description: 'Deleted account ID' }, deleted: { type: 'boolean', description: 'Whether account was deleted' }, - metadata: { type: 'object', description: 'Operation metadata' }, }, }, }, diff --git a/apps/sim/tools/salesforce/delete_case.ts b/apps/sim/tools/salesforce/delete_case.ts index d2fbbb31ea..29d9b01de0 100644 --- a/apps/sim/tools/salesforce/delete_case.ts +++ b/apps/sim/tools/salesforce/delete_case.ts @@ -62,13 +62,19 @@ export const salesforceDeleteCaseTool: ToolConfig< output: { id: params?.caseId || '', deleted: true, - metadata: { operation: 'delete_case' }, }, } }, outputs: { - success: { type: 'boolean', description: 'Success' }, - output: { type: 'object', description: 'Deleted case' }, + success: { type: 'boolean', description: 'Operation success status' }, + output: { + type: 'object', + description: 'Deleted case data', + properties: { + id: { type: 'string', description: 'Deleted case ID' }, + deleted: { type: 'boolean', description: 'Whether case was deleted' }, + }, + }, }, } diff --git a/apps/sim/tools/salesforce/delete_contact.ts b/apps/sim/tools/salesforce/delete_contact.ts index c91fbed196..2aee53caae 100644 --- a/apps/sim/tools/salesforce/delete_contact.ts +++ b/apps/sim/tools/salesforce/delete_contact.ts @@ -56,7 +56,6 @@ export const salesforceDeleteContactTool: ToolConfig< output: { id: params?.contactId || '', deleted: true, - metadata: { operation: 'delete_contact' as const }, }, } }, @@ -69,7 +68,6 @@ export const salesforceDeleteContactTool: ToolConfig< properties: { id: { type: 'string', description: 'Deleted contact ID' }, deleted: { type: 'boolean', description: 'Whether contact was deleted' }, - metadata: { type: 'object', description: 'Operation metadata' }, }, }, }, diff --git a/apps/sim/tools/salesforce/delete_lead.ts b/apps/sim/tools/salesforce/delete_lead.ts index aa8dc2f2bc..aee2a1c32e 100644 --- a/apps/sim/tools/salesforce/delete_lead.ts +++ b/apps/sim/tools/salesforce/delete_lead.ts @@ -48,13 +48,19 @@ export const salesforceDeleteLeadTool: ToolConfig< output: { id: params?.leadId || '', deleted: true, - metadata: { operation: 'delete_lead' }, }, } }, outputs: { - success: { type: 'boolean', description: 'Success' }, - output: { type: 'object', description: 'Deleted lead' }, + success: { type: 'boolean', description: 'Operation success status' }, + output: { + type: 'object', + description: 'Deleted lead data', + properties: { + id: { type: 'string', description: 'Deleted lead ID' }, + deleted: { type: 'boolean', description: 'Whether lead was deleted' }, + }, + }, }, } diff --git a/apps/sim/tools/salesforce/delete_opportunity.ts b/apps/sim/tools/salesforce/delete_opportunity.ts index 826c2a9639..aef1142865 100644 --- a/apps/sim/tools/salesforce/delete_opportunity.ts +++ b/apps/sim/tools/salesforce/delete_opportunity.ts @@ -48,13 +48,19 @@ export const salesforceDeleteOpportunityTool: ToolConfig< output: { id: params?.opportunityId || '', deleted: true, - metadata: { operation: 'delete_opportunity' }, }, } }, outputs: { - success: { type: 'boolean', description: 'Success' }, - output: { type: 'object', description: 'Deleted opportunity' }, + success: { type: 'boolean', description: 'Operation success status' }, + output: { + type: 'object', + description: 'Deleted opportunity data', + properties: { + id: { type: 'string', description: 'Deleted opportunity ID' }, + deleted: { type: 'boolean', description: 'Whether opportunity was deleted' }, + }, + }, }, } diff --git a/apps/sim/tools/salesforce/delete_task.ts b/apps/sim/tools/salesforce/delete_task.ts index ec606fbefc..659adaf0b5 100644 --- a/apps/sim/tools/salesforce/delete_task.ts +++ b/apps/sim/tools/salesforce/delete_task.ts @@ -62,13 +62,19 @@ export const salesforceDeleteTaskTool: ToolConfig< output: { id: params?.taskId || '', deleted: true, - metadata: { operation: 'delete_task' }, }, } }, outputs: { - success: { type: 'boolean', description: 'Success' }, - output: { type: 'object', description: 'Deleted task' }, + success: { type: 'boolean', description: 'Operation success status' }, + output: { + type: 'object', + description: 'Deleted task data', + properties: { + id: { type: 'string', description: 'Deleted task ID' }, + deleted: { type: 'boolean', description: 'Whether task was deleted' }, + }, + }, }, } diff --git a/apps/sim/tools/salesforce/describe_object.ts b/apps/sim/tools/salesforce/describe_object.ts index 74f357c827..40c098c15e 100644 --- a/apps/sim/tools/salesforce/describe_object.ts +++ b/apps/sim/tools/salesforce/describe_object.ts @@ -81,17 +81,14 @@ export const salesforceDescribeObjectTool: ToolConfig< deletable: data.deletable, childRelationships: data.childRelationships, recordTypeInfos: data.recordTypeInfos, - metadata: { - operation: 'describe_object', - fieldCount: data.fields?.length || 0, - }, + fieldCount: data.fields?.length || 0, success: true, }, } }, outputs: { - success: { type: 'boolean', description: 'Success status' }, + success: { type: 'boolean', description: 'Operation success status' }, output: { type: 'object', description: 'Object metadata', @@ -107,8 +104,8 @@ export const salesforceDescribeObjectTool: ToolConfig< deletable: { type: 'boolean', description: 'Whether records can be deleted' }, childRelationships: { type: 'array', description: 'Child relationship definitions' }, recordTypeInfos: { type: 'array', description: 'Record type information' }, - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success status' }, + fieldCount: { type: 'number', description: 'Number of fields in the object' }, + success: { type: 'boolean', description: 'Salesforce operation success' }, }, }, }, diff --git a/apps/sim/tools/salesforce/get_accounts.ts b/apps/sim/tools/salesforce/get_accounts.ts index f861af7065..4b3d4a504a 100644 --- a/apps/sim/tools/salesforce/get_accounts.ts +++ b/apps/sim/tools/salesforce/get_accounts.ts @@ -143,7 +143,6 @@ export const salesforceGetAccountsTool: ToolConfig< done: data.done !== false, }, metadata: { - operation: 'get_accounts' as const, totalReturned: accounts.length, hasMore: !data.done, }, @@ -158,19 +157,25 @@ export const salesforceGetAccountsTool: ToolConfig< type: 'object', description: 'Accounts data', properties: { - accounts: { - type: 'array', - description: 'Array of account objects', - }, + accounts: { type: 'array', description: 'Array of account objects' }, paging: { type: 'object', description: 'Pagination information', + properties: { + nextRecordsUrl: { type: 'string', description: 'URL for next page of results' }, + totalSize: { type: 'number', description: 'Total number of records' }, + done: { type: 'boolean', description: 'Whether all records returned' }, + }, }, metadata: { type: 'object', - description: 'Operation metadata', + description: 'Response metadata', + properties: { + totalReturned: { type: 'number', description: 'Number of accounts returned' }, + hasMore: { type: 'boolean', description: 'Whether more records exist' }, + }, }, - success: { type: 'boolean', description: 'Operation success status' }, + success: { type: 'boolean', description: 'Salesforce operation success' }, }, }, }, diff --git a/apps/sim/tools/salesforce/get_cases.ts b/apps/sim/tools/salesforce/get_cases.ts index 469bc4e4f8..06c3c394e5 100644 --- a/apps/sim/tools/salesforce/get_cases.ts +++ b/apps/sim/tools/salesforce/get_cases.ts @@ -74,7 +74,7 @@ export const salesforceGetCasesTool: ToolConfig< if (params?.caseId) { return { success: true, - output: { case: data, metadata: { operation: 'get_cases' }, success: true }, + output: { case: data, success: true }, } } const cases = data.records || [] @@ -87,14 +87,42 @@ export const salesforceGetCasesTool: ToolConfig< totalSize: data.totalSize || cases.length, done: data.done !== false, }, - metadata: { operation: 'get_cases', totalReturned: cases.length, hasMore: !data.done }, + metadata: { + totalReturned: cases.length, + hasMore: !data.done, + }, success: true, }, } }, outputs: { - success: { type: 'boolean', description: 'Success' }, - output: { type: 'object', description: 'Case data' }, + success: { type: 'boolean', description: 'Operation success status' }, + output: { + type: 'object', + description: 'Case data', + properties: { + case: { type: 'object', description: 'Single case object (when caseId provided)' }, + cases: { type: 'array', description: 'Array of case objects (when listing)' }, + paging: { + type: 'object', + description: 'Pagination information', + properties: { + nextRecordsUrl: { type: 'string', description: 'URL for next page of results' }, + totalSize: { type: 'number', description: 'Total number of records' }, + done: { type: 'boolean', description: 'Whether all records returned' }, + }, + }, + metadata: { + type: 'object', + description: 'Response metadata', + properties: { + totalReturned: { type: 'number', description: 'Number of cases returned' }, + hasMore: { type: 'boolean', description: 'Whether more records exist' }, + }, + }, + success: { type: 'boolean', description: 'Operation success status' }, + }, + }, }, } diff --git a/apps/sim/tools/salesforce/get_contacts.ts b/apps/sim/tools/salesforce/get_contacts.ts index 11408c8196..3d39db232d 100644 --- a/apps/sim/tools/salesforce/get_contacts.ts +++ b/apps/sim/tools/salesforce/get_contacts.ts @@ -95,10 +95,7 @@ export const salesforceGetContactsTool: ToolConfig< success: true, output: { contact: data, - metadata: { - operation: 'get_contacts' as const, - singleContact: true, - }, + singleContact: true, success: true, }, } @@ -116,11 +113,10 @@ export const salesforceGetContactsTool: ToolConfig< done: data.done !== false, }, metadata: { - operation: 'get_contacts' as const, totalReturned: contacts.length, hasMore: !data.done, - singleContact: false, }, + singleContact: false, success: true, }, } @@ -134,9 +130,25 @@ export const salesforceGetContactsTool: ToolConfig< properties: { contacts: { type: 'array', description: 'Array of contacts (list query)' }, contact: { type: 'object', description: 'Single contact (by ID)' }, - paging: { type: 'object', description: 'Pagination info (list query)' }, - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success' }, + paging: { + type: 'object', + description: 'Pagination information', + properties: { + nextRecordsUrl: { type: 'string', description: 'URL for next page of results' }, + totalSize: { type: 'number', description: 'Total number of records' }, + done: { type: 'boolean', description: 'Whether all records returned' }, + }, + }, + metadata: { + type: 'object', + description: 'Response metadata', + properties: { + totalReturned: { type: 'number', description: 'Number of contacts returned' }, + hasMore: { type: 'boolean', description: 'Whether more records exist' }, + }, + }, + singleContact: { type: 'boolean', description: 'Whether single contact was returned' }, + success: { type: 'boolean', description: 'Salesforce operation success' }, }, }, }, diff --git a/apps/sim/tools/salesforce/get_dashboard.ts b/apps/sim/tools/salesforce/get_dashboard.ts index 246443e911..402f67196d 100644 --- a/apps/sim/tools/salesforce/get_dashboard.ts +++ b/apps/sim/tools/salesforce/get_dashboard.ts @@ -71,19 +71,16 @@ export const salesforceGetDashboardTool: ToolConfig< dashboard: data, dashboardId: params?.dashboardId || '', components: data.componentData || [], - metadata: { - operation: 'get_dashboard', - dashboardName: data.name, - folderId: data.folderId, - runningUser: data.runningUser, - }, + dashboardName: data.name, + folderId: data.folderId, + runningUser: data.runningUser, success: true, }, } }, outputs: { - success: { type: 'boolean', description: 'Success status' }, + success: { type: 'boolean', description: 'Operation success status' }, output: { type: 'object', description: 'Dashboard data', @@ -91,8 +88,10 @@ export const salesforceGetDashboardTool: ToolConfig< dashboard: { type: 'object', description: 'Dashboard details' }, dashboardId: { type: 'string', description: 'Dashboard ID' }, components: { type: 'array', description: 'Dashboard component data' }, - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success status' }, + dashboardName: { type: 'string', description: 'Dashboard name' }, + folderId: { type: 'string', description: 'Folder ID containing the dashboard' }, + runningUser: { type: 'object', description: 'Running user information' }, + success: { type: 'boolean', description: 'Salesforce operation success' }, }, }, }, diff --git a/apps/sim/tools/salesforce/get_leads.ts b/apps/sim/tools/salesforce/get_leads.ts index de6834abce..c04c8f04ae 100644 --- a/apps/sim/tools/salesforce/get_leads.ts +++ b/apps/sim/tools/salesforce/get_leads.ts @@ -75,7 +75,7 @@ export const salesforceGetLeadsTool: ToolConfig< success: true, output: { lead: data, - metadata: { operation: 'get_leads', singleLead: true }, + singleLead: true, success: true, }, } @@ -90,14 +90,43 @@ export const salesforceGetLeadsTool: ToolConfig< totalSize: data.totalSize || leads.length, done: data.done !== false, }, - metadata: { operation: 'get_leads', totalReturned: leads.length, hasMore: !data.done }, + metadata: { + totalReturned: leads.length, + hasMore: !data.done, + }, success: true, }, } }, outputs: { - success: { type: 'boolean', description: 'Success status' }, - output: { type: 'object', description: 'Lead data' }, + success: { type: 'boolean', description: 'Operation success status' }, + output: { + type: 'object', + description: 'Lead data', + properties: { + lead: { type: 'object', description: 'Single lead object (when leadId provided)' }, + leads: { type: 'array', description: 'Array of lead objects (when listing)' }, + paging: { + type: 'object', + description: 'Pagination information', + properties: { + nextRecordsUrl: { type: 'string', description: 'URL for next page of results' }, + totalSize: { type: 'number', description: 'Total number of records' }, + done: { type: 'boolean', description: 'Whether all records returned' }, + }, + }, + metadata: { + type: 'object', + description: 'Response metadata', + properties: { + totalReturned: { type: 'number', description: 'Number of leads returned' }, + hasMore: { type: 'boolean', description: 'Whether more records exist' }, + }, + }, + singleLead: { type: 'boolean', description: 'Whether single lead was returned' }, + success: { type: 'boolean', description: 'Operation success status' }, + }, + }, }, } diff --git a/apps/sim/tools/salesforce/get_opportunities.ts b/apps/sim/tools/salesforce/get_opportunities.ts index 084459b21c..1fc49f25bf 100644 --- a/apps/sim/tools/salesforce/get_opportunities.ts +++ b/apps/sim/tools/salesforce/get_opportunities.ts @@ -76,7 +76,7 @@ export const salesforceGetOpportunitiesTool: ToolConfig< if (params?.opportunityId) { return { success: true, - output: { opportunity: data, metadata: { operation: 'get_opportunities' }, success: true }, + output: { opportunity: data, success: true }, } } const opportunities = data.records || [] @@ -90,7 +90,6 @@ export const salesforceGetOpportunitiesTool: ToolConfig< done: data.done !== false, }, metadata: { - operation: 'get_opportunities', totalReturned: opportunities.length, hasMore: !data.done, }, @@ -100,7 +99,38 @@ export const salesforceGetOpportunitiesTool: ToolConfig< }, outputs: { - success: { type: 'boolean', description: 'Success' }, - output: { type: 'object', description: 'Opportunity data' }, + success: { type: 'boolean', description: 'Operation success status' }, + output: { + type: 'object', + description: 'Opportunity data', + properties: { + opportunity: { + type: 'object', + description: 'Single opportunity object (when opportunityId provided)', + }, + opportunities: { + type: 'array', + description: 'Array of opportunity objects (when listing)', + }, + paging: { + type: 'object', + description: 'Pagination information', + properties: { + nextRecordsUrl: { type: 'string', description: 'URL for next page of results' }, + totalSize: { type: 'number', description: 'Total number of records' }, + done: { type: 'boolean', description: 'Whether all records returned' }, + }, + }, + metadata: { + type: 'object', + description: 'Response metadata', + properties: { + totalReturned: { type: 'number', description: 'Number of opportunities returned' }, + hasMore: { type: 'boolean', description: 'Whether more records exist' }, + }, + }, + success: { type: 'boolean', description: 'Operation success status' }, + }, + }, }, } diff --git a/apps/sim/tools/salesforce/get_report.ts b/apps/sim/tools/salesforce/get_report.ts index 49ddbfb4bf..b05ba7f060 100644 --- a/apps/sim/tools/salesforce/get_report.ts +++ b/apps/sim/tools/salesforce/get_report.ts @@ -70,24 +70,20 @@ export const salesforceGetReportTool: ToolConfig< output: { report: data, reportId: params?.reportId || '', - metadata: { - operation: 'get_report', - }, success: true, }, } }, outputs: { - success: { type: 'boolean', description: 'Success status' }, + success: { type: 'boolean', description: 'Operation success status' }, output: { type: 'object', description: 'Report metadata', properties: { report: { type: 'object', description: 'Report metadata object' }, reportId: { type: 'string', description: 'Report ID' }, - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success status' }, + success: { type: 'boolean', description: 'Salesforce operation success' }, }, }, }, diff --git a/apps/sim/tools/salesforce/get_tasks.ts b/apps/sim/tools/salesforce/get_tasks.ts index 358dfa29ac..dfd8848341 100644 --- a/apps/sim/tools/salesforce/get_tasks.ts +++ b/apps/sim/tools/salesforce/get_tasks.ts @@ -85,7 +85,7 @@ export const salesforceGetTasksTool: ToolConfig< if (params?.taskId) { return { success: true, - output: { task: data, metadata: { operation: 'get_tasks' }, success: true }, + output: { task: data, success: true }, } } const tasks = data.records || [] @@ -98,14 +98,42 @@ export const salesforceGetTasksTool: ToolConfig< totalSize: data.totalSize || tasks.length, done: data.done !== false, }, - metadata: { operation: 'get_tasks', totalReturned: tasks.length, hasMore: !data.done }, + metadata: { + totalReturned: tasks.length, + hasMore: !data.done, + }, success: true, }, } }, outputs: { - success: { type: 'boolean', description: 'Success' }, - output: { type: 'object', description: 'Task data' }, + success: { type: 'boolean', description: 'Operation success status' }, + output: { + type: 'object', + description: 'Task data', + properties: { + task: { type: 'object', description: 'Single task object (when taskId provided)' }, + tasks: { type: 'array', description: 'Array of task objects (when listing)' }, + paging: { + type: 'object', + description: 'Pagination information', + properties: { + nextRecordsUrl: { type: 'string', description: 'URL for next page of results' }, + totalSize: { type: 'number', description: 'Total number of records' }, + done: { type: 'boolean', description: 'Whether all records returned' }, + }, + }, + metadata: { + type: 'object', + description: 'Response metadata', + properties: { + totalReturned: { type: 'number', description: 'Number of tasks returned' }, + hasMore: { type: 'boolean', description: 'Whether more records exist' }, + }, + }, + success: { type: 'boolean', description: 'Operation success status' }, + }, + }, }, } diff --git a/apps/sim/tools/salesforce/list_dashboards.ts b/apps/sim/tools/salesforce/list_dashboards.ts index cbbb5df757..519a399e04 100644 --- a/apps/sim/tools/salesforce/list_dashboards.ts +++ b/apps/sim/tools/salesforce/list_dashboards.ts @@ -75,24 +75,21 @@ export const salesforceListDashboardsTool: ToolConfig< success: true, output: { dashboards, - metadata: { - operation: 'list_dashboards', - totalReturned: dashboards.length, - }, + totalReturned: dashboards.length, success: true, }, } }, outputs: { - success: { type: 'boolean', description: 'Success status' }, + success: { type: 'boolean', description: 'Operation success status' }, output: { type: 'object', description: 'Dashboards data', properties: { dashboards: { type: 'array', description: 'Array of dashboard objects' }, - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success status' }, + totalReturned: { type: 'number', description: 'Number of dashboards returned' }, + success: { type: 'boolean', description: 'Salesforce operation success' }, }, }, }, diff --git a/apps/sim/tools/salesforce/list_objects.ts b/apps/sim/tools/salesforce/list_objects.ts index dc4f3aff03..24064bf6ec 100644 --- a/apps/sim/tools/salesforce/list_objects.ts +++ b/apps/sim/tools/salesforce/list_objects.ts @@ -64,17 +64,14 @@ export const salesforceListObjectsTool: ToolConfig< objects, encoding: data.encoding, maxBatchSize: data.maxBatchSize, - metadata: { - operation: 'list_objects', - totalReturned: objects.length, - }, + totalReturned: objects.length, success: true, }, } }, outputs: { - success: { type: 'boolean', description: 'Success status' }, + success: { type: 'boolean', description: 'Operation success status' }, output: { type: 'object', description: 'Objects list', @@ -82,8 +79,8 @@ export const salesforceListObjectsTool: ToolConfig< objects: { type: 'array', description: 'Array of available Salesforce objects' }, encoding: { type: 'string', description: 'Encoding used' }, maxBatchSize: { type: 'number', description: 'Maximum batch size' }, - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success status' }, + totalReturned: { type: 'number', description: 'Number of objects returned' }, + success: { type: 'boolean', description: 'Salesforce operation success' }, }, }, }, diff --git a/apps/sim/tools/salesforce/list_report_types.ts b/apps/sim/tools/salesforce/list_report_types.ts index 3c5ff278a5..10dfd40086 100644 --- a/apps/sim/tools/salesforce/list_report_types.ts +++ b/apps/sim/tools/salesforce/list_report_types.ts @@ -60,24 +60,21 @@ export const salesforceListReportTypesTool: ToolConfig< success: true, output: { reportTypes: data, - metadata: { - operation: 'list_report_types', - totalReturned: Array.isArray(data) ? data.length : 0, - }, + totalReturned: Array.isArray(data) ? data.length : 0, success: true, }, } }, outputs: { - success: { type: 'boolean', description: 'Success status' }, + success: { type: 'boolean', description: 'Operation success status' }, output: { type: 'object', description: 'Report types data', properties: { reportTypes: { type: 'array', description: 'Array of report type objects' }, - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success status' }, + totalReturned: { type: 'number', description: 'Number of report types returned' }, + success: { type: 'boolean', description: 'Salesforce operation success' }, }, }, }, diff --git a/apps/sim/tools/salesforce/list_reports.ts b/apps/sim/tools/salesforce/list_reports.ts index 546256f229..af225c6649 100644 --- a/apps/sim/tools/salesforce/list_reports.ts +++ b/apps/sim/tools/salesforce/list_reports.ts @@ -90,24 +90,21 @@ export const salesforceListReportsTool: ToolConfig< success: true, output: { reports, - metadata: { - operation: 'list_reports', - totalReturned: reports.length, - }, + totalReturned: reports.length, success: true, }, } }, outputs: { - success: { type: 'boolean', description: 'Success status' }, + success: { type: 'boolean', description: 'Operation success status' }, output: { type: 'object', description: 'Reports data', properties: { reports: { type: 'array', description: 'Array of report objects' }, - metadata: { type: 'object', description: 'Operation metadata' }, - success: { type: 'boolean', description: 'Operation success status' }, + totalReturned: { type: 'number', description: 'Number of reports returned' }, + success: { type: 'boolean', description: 'Salesforce operation success' }, }, }, }, diff --git a/apps/sim/tools/salesforce/query.ts b/apps/sim/tools/salesforce/query.ts index 88c2c2f970..5c4416fe43 100644 --- a/apps/sim/tools/salesforce/query.ts +++ b/apps/sim/tools/salesforce/query.ts @@ -73,7 +73,6 @@ export const salesforceQueryTool: ToolConfig + metadata: { + type: string | null + value: string | null + function: string | null + } numComments: number assignedTo: { id: string @@ -62,8 +67,10 @@ export interface SentryListIssuesParams extends SentryBaseParams { export interface SentryListIssuesResponse extends ToolResponse { output: { issues: SentryIssue[] - nextCursor?: string - hasMore: boolean + metadata: { + nextCursor?: string + hasMore: boolean + } } } @@ -92,10 +99,9 @@ export interface SentryUpdateIssueResponse extends ToolResponse { } } -// ============================================================================ -// PROJECT TYPES -// ============================================================================ - +/** + * Sentry project representation + */ export interface SentryProject { id: string slug: string @@ -143,8 +149,10 @@ export interface SentryListProjectsParams extends SentryBaseParams { export interface SentryListProjectsResponse extends ToolResponse { output: { projects: SentryProject[] - nextCursor?: string - hasMore: boolean + metadata: { + nextCursor?: string + hasMore: boolean + } } } @@ -188,10 +196,9 @@ export interface SentryUpdateProjectResponse extends ToolResponse { } } -// ============================================================================ -// EVENT TYPES -// ============================================================================ - +/** + * Sentry event representation + */ export interface SentryEvent { id: string eventID: string @@ -217,7 +224,11 @@ export interface SentryEvent { contexts: Record platform: string type: string - metadata: Record + metadata: { + type: string | null + value: string | null + function: string | null + } entries: Array<{ type: string data: Record @@ -247,8 +258,10 @@ export interface SentryListEventsParams extends SentryBaseParams { export interface SentryListEventsResponse extends ToolResponse { output: { events: SentryEvent[] - nextCursor?: string - hasMore: boolean + metadata: { + nextCursor?: string + hasMore: boolean + } } } @@ -263,10 +276,9 @@ export interface SentryGetEventResponse extends ToolResponse { } } -// ============================================================================ -// RELEASE TYPES -// ============================================================================ - +/** + * Sentry release representation + */ export interface SentryRelease { id: string version: string @@ -328,8 +340,10 @@ export interface SentryListReleasesParams extends SentryBaseParams { export interface SentryListReleasesResponse extends ToolResponse { output: { releases: SentryRelease[] - nextCursor?: string - hasMore: boolean + metadata: { + nextCursor?: string + hasMore: boolean + } } } @@ -337,9 +351,9 @@ export interface SentryCreateReleaseParams extends SentryBaseParams { version: string ref?: string url?: string - projects: string // Comma-separated list of project slugs + projects: string dateReleased?: string - commits?: string // JSON string of commit objects + commits?: string } export interface SentryCreateReleaseResponse extends ToolResponse { @@ -370,10 +384,9 @@ export interface SentryCreateDeployResponse extends ToolResponse { } } -// ============================================================================ -// UNION RESPONSE TYPE -// ============================================================================ - +/** + * Union response type for all Sentry operations + */ export type SentryResponse = | SentryListIssuesResponse | SentryGetIssueResponse diff --git a/apps/sim/tools/stripe/cancel_payment_intent.ts b/apps/sim/tools/stripe/cancel_payment_intent.ts index 4487c11150..0ed05fdbc5 100644 --- a/apps/sim/tools/stripe/cancel_payment_intent.ts +++ b/apps/sim/tools/stripe/cancel_payment_intent.ts @@ -72,6 +72,13 @@ export const stripeCancelPaymentIntentTool: ToolConfig< metadata: { type: 'json', description: 'Payment Intent metadata including ID, status, amount, and currency', + + properties: { + id: { type: 'string', description: 'Stripe unique identifier' }, + status: { type: 'string', description: 'Current state of the resource' }, + amount: { type: 'number', description: 'Amount in smallest currency unit (e.g., cents)' }, + currency: { type: 'string', description: 'Three-letter ISO currency code (lowercase)' }, + }, }, }, } diff --git a/apps/sim/tools/stripe/cancel_subscription.ts b/apps/sim/tools/stripe/cancel_subscription.ts index 1d9722abf7..5b27816f52 100644 --- a/apps/sim/tools/stripe/cancel_subscription.ts +++ b/apps/sim/tools/stripe/cancel_subscription.ts @@ -81,6 +81,12 @@ export const stripeCancelSubscriptionTool: ToolConfig< metadata: { type: 'json', description: 'Subscription metadata including ID, status, and customer', + + properties: { + id: { type: 'string', description: 'Stripe unique identifier' }, + status: { type: 'string', description: 'Current state of the resource' }, + customer: { type: 'string', description: 'Associated customer ID' }, + }, }, }, } diff --git a/apps/sim/tools/stripe/capture_charge.ts b/apps/sim/tools/stripe/capture_charge.ts index f5086fcf1f..69529ee8db 100644 --- a/apps/sim/tools/stripe/capture_charge.ts +++ b/apps/sim/tools/stripe/capture_charge.ts @@ -69,6 +69,14 @@ export const stripeCaptureChargeTool: ToolConfig metadata: { type: 'json', description: 'Price metadata', + properties: { + id: { type: 'string', description: 'Stripe unique identifier' }, + product: { type: 'string', description: 'Associated product ID' }, + unit_amount: { + type: 'number', + description: 'Amount in smallest currency unit (e.g., cents)', + }, + currency: { type: 'string', description: 'Three-letter ISO currency code (lowercase)' }, + }, }, }, } diff --git a/apps/sim/tools/stripe/create_product.ts b/apps/sim/tools/stripe/create_product.ts index aa7ba507f7..ba72925eb9 100644 --- a/apps/sim/tools/stripe/create_product.ts +++ b/apps/sim/tools/stripe/create_product.ts @@ -99,6 +99,11 @@ export const stripeCreateProductTool: ToolConfig metadata: { type: 'json', description: 'Invoice metadata', + + properties: { + id: { type: 'string', description: 'Stripe unique identifier' }, + status: { type: 'string', description: 'Current state of the resource' }, + amount_due: { + type: 'number', + description: 'Amount remaining to be paid in smallest currency unit', + }, + currency: { type: 'string', description: 'Three-letter ISO currency code (lowercase)' }, + }, }, }, } diff --git a/apps/sim/tools/stripe/resume_subscription.ts b/apps/sim/tools/stripe/resume_subscription.ts index a2512be07e..ed3e0c2750 100644 --- a/apps/sim/tools/stripe/resume_subscription.ts +++ b/apps/sim/tools/stripe/resume_subscription.ts @@ -61,6 +61,12 @@ export const stripeResumeSubscriptionTool: ToolConfig< metadata: { type: 'json', description: 'Subscription metadata including ID, status, and customer', + + properties: { + id: { type: 'string', description: 'Stripe unique identifier' }, + status: { type: 'string', description: 'Current state of the resource' }, + customer: { type: 'string', description: 'Associated customer ID' }, + }, }, }, } diff --git a/apps/sim/tools/stripe/retrieve_charge.ts b/apps/sim/tools/stripe/retrieve_charge.ts index 8d2d719857..c411912a1b 100644 --- a/apps/sim/tools/stripe/retrieve_charge.ts +++ b/apps/sim/tools/stripe/retrieve_charge.ts @@ -56,6 +56,14 @@ export const stripeRetrieveChargeTool: ToolConfig metadata: { type: 'json', description: 'Price metadata', + properties: { + id: { type: 'string', description: 'Stripe unique identifier' }, + product: { type: 'string', description: 'Associated product ID' }, + unit_amount: { + type: 'number', + description: 'Amount in smallest currency unit (e.g., cents)', + }, + currency: { type: 'string', description: 'Three-letter ISO currency code (lowercase)' }, + }, }, }, } diff --git a/apps/sim/tools/stripe/update_product.ts b/apps/sim/tools/stripe/update_product.ts index 3eafb4b1d7..99b5bd1f68 100644 --- a/apps/sim/tools/stripe/update_product.ts +++ b/apps/sim/tools/stripe/update_product.ts @@ -105,6 +105,11 @@ export const stripeUpdateProductTool: ToolConfig { + transformResponse: async (response: Response) => { const data = await response.json() // Format contact information into readable content @@ -82,8 +82,8 @@ export const wealthboxReadContactTool: ToolConfig { + transformResponse: async (response: Response) => { const data = await response.json() // Format note information into readable content @@ -86,8 +86,8 @@ export const wealthboxReadNoteTool: ToolConfig { + transformResponse: async (response: Response) => { const data = await response.json() // Format task information into readable content @@ -84,8 +84,8 @@ export const wealthboxReadTaskTool: ToolConfig { output: { note: undefined, metadata: { - operation: 'write_note' as const, itemType: 'note' as const, }, }, @@ -121,25 +120,21 @@ export const formatNoteResponse = (data: any): WealthboxWriteResponse => { note: data, success: true, metadata: { - operation: 'write_note' as const, itemId: data.id?.toString() || '', + noteId: data.id?.toString() || '', itemType: 'note' as const, }, }, } } -export const formatTaskResponse = ( - data: any, - params?: WealthboxWriteParams -): WealthboxWriteResponse => { +export const formatTaskResponse = (data: any): WealthboxWriteResponse => { if (!data) { return { success: false, output: { task: undefined, metadata: { - operation: 'write_task' as const, itemType: 'task' as const, }, }, @@ -152,8 +147,8 @@ export const formatTaskResponse = ( task: data, success: true, metadata: { - operation: 'write_task' as const, - itemId: data.id?.toString() || params?.taskId || '', + itemId: data.id?.toString() || '', + taskId: data.id?.toString() || '', itemType: 'task' as const, }, }, diff --git a/apps/sim/tools/wealthbox/write_contact.ts b/apps/sim/tools/wealthbox/write_contact.ts index 13011055ee..6a4b2a331d 100644 --- a/apps/sim/tools/wealthbox/write_contact.ts +++ b/apps/sim/tools/wealthbox/write_contact.ts @@ -92,7 +92,7 @@ export const wealthboxWriteContactTool: ToolConfig { + transformResponse: async (response: Response) => { const data = await response.json() - return formatTaskResponse(data, params) + return formatTaskResponse(data) }, outputs: { @@ -83,8 +83,8 @@ export const wealthboxWriteTaskTool: ToolConfig { success: boolean output: { data?: T paging?: ZendeskPagingInfo - metadata: { - operation: string - [key: string]: any - } + metadata?: ZendeskListMetadata success: boolean } } diff --git a/apps/sim/tools/zendesk/update_organization.ts b/apps/sim/tools/zendesk/update_organization.ts index 8024062134..21093cb168 100644 --- a/apps/sim/tools/zendesk/update_organization.ts +++ b/apps/sim/tools/zendesk/update_organization.ts @@ -21,10 +21,7 @@ export interface ZendeskUpdateOrganizationResponse { success: boolean output: { organization: any - metadata: { - operation: 'update_organization' - organizationId: string - } + organization_id: number success: boolean } } @@ -147,17 +144,14 @@ export const zendeskUpdateOrganizationTool: ToolConfig< success: true, output: { organization: data.organization, - metadata: { - operation: 'update_organization' as const, - organizationId: data.organization?.id, - }, + organization_id: data.organization?.id, success: true, }, } }, outputs: { - organization: { type: 'object', description: 'Updated organization object' }, - metadata: { type: 'object', description: 'Operation metadata' }, + organization: { type: 'json', description: 'Updated organization object' }, + organization_id: { type: 'number', description: 'The updated organization ID' }, }, } diff --git a/apps/sim/tools/zendesk/update_ticket.ts b/apps/sim/tools/zendesk/update_ticket.ts index 5377c6bdf0..de9e9cb586 100644 --- a/apps/sim/tools/zendesk/update_ticket.ts +++ b/apps/sim/tools/zendesk/update_ticket.ts @@ -24,10 +24,7 @@ export interface ZendeskUpdateTicketResponse { success: boolean output: { ticket: any - metadata: { - operation: 'update_ticket' - ticketId: string - } + ticket_id: number success: boolean } } @@ -171,10 +168,7 @@ export const zendeskUpdateTicketTool: ToolConfig< success: true, output: { ticket: data.ticket, - metadata: { - operation: 'update_ticket' as const, - ticketId: data.ticket?.id, - }, + ticket_id: data.ticket?.id, success: true, }, } @@ -182,6 +176,6 @@ export const zendeskUpdateTicketTool: ToolConfig< outputs: { ticket: { type: 'object', description: 'Updated ticket object' }, - metadata: { type: 'object', description: 'Operation metadata' }, + ticket_id: { type: 'number', description: 'The updated ticket ID' }, }, } diff --git a/apps/sim/tools/zendesk/update_tickets_bulk.ts b/apps/sim/tools/zendesk/update_tickets_bulk.ts index aafa14841e..220709bdce 100644 --- a/apps/sim/tools/zendesk/update_tickets_bulk.ts +++ b/apps/sim/tools/zendesk/update_tickets_bulk.ts @@ -19,11 +19,8 @@ export interface ZendeskUpdateTicketsBulkParams { export interface ZendeskUpdateTicketsBulkResponse { success: boolean output: { - jobStatus: any - metadata: { - operation: 'update_tickets_bulk' - jobId?: string - } + job_status: any + job_id?: string success: boolean } } @@ -130,18 +127,15 @@ export const zendeskUpdateTicketsBulkTool: ToolConfig< return { success: true, output: { - jobStatus: data.job_status, - metadata: { - operation: 'update_tickets_bulk' as const, - jobId: data.job_status?.id, - }, + job_status: data.job_status, + job_id: data.job_status?.id, success: true, }, } }, outputs: { - jobStatus: { type: 'object', description: 'Job status object' }, - metadata: { type: 'object', description: 'Operation metadata' }, + job_status: { type: 'object', description: 'Job status object' }, + job_id: { type: 'string', description: 'The bulk operation job ID' }, }, } diff --git a/apps/sim/tools/zendesk/update_user.ts b/apps/sim/tools/zendesk/update_user.ts index 261a971b9b..22ff2df6d9 100644 --- a/apps/sim/tools/zendesk/update_user.ts +++ b/apps/sim/tools/zendesk/update_user.ts @@ -23,10 +23,7 @@ export interface ZendeskUpdateUserResponse { success: boolean output: { user: any - metadata: { - operation: 'update_user' - userId: string - } + user_id: number success: boolean } } @@ -160,17 +157,14 @@ export const zendeskUpdateUserTool: ToolConfig> { for (const blockFile of blockFiles) { const fileContent = fs.readFileSync(blockFile, 'utf-8') - const blockConfig = extractBlockConfig(fileContent) + // Get ALL block configs from file (already filters hideFromToolbar: true) + const blockConfigs = extractAllBlockConfigs(fileContent) - if (!blockConfig?.type || !blockConfig.iconName) { - continue - } + for (const blockConfig of blockConfigs) { + if (!blockConfig?.type || !blockConfig.iconName) { + continue + } - // Skip blocks that don't have documentation (same logic as generateBlockDoc) - if ( - blockConfig.type.includes('_trigger') || - blockConfig.type.includes('_webhook') || - blockConfig.type.includes('rss') - ) { - continue - } + // Skip blocks that don't have documentation (same logic as generateBlockDoc) + if ( + blockConfig.type.includes('_trigger') || + blockConfig.type.includes('_webhook') || + blockConfig.type.includes('rss') + ) { + continue + } - if ( - (blockConfig.category === 'blocks' && - blockConfig.type !== 'memory' && - blockConfig.type !== 'knowledge') || - blockConfig.type === 'evaluator' || - blockConfig.type === 'number' || - blockConfig.type === 'webhook' || - blockConfig.type === 'schedule' || - blockConfig.type === 'mcp' || - blockConfig.type === 'generic_webhook' || - blockConfig.type === 'rss' - ) { - continue - } + if ( + (blockConfig.category === 'blocks' && + blockConfig.type !== 'memory' && + blockConfig.type !== 'knowledge') || + blockConfig.type === 'evaluator' || + blockConfig.type === 'number' || + blockConfig.type === 'webhook' || + blockConfig.type === 'schedule' || + blockConfig.type === 'mcp' || + blockConfig.type === 'generic_webhook' || + blockConfig.type === 'rss' + ) { + continue + } - iconMapping[blockConfig.type] = blockConfig.iconName + iconMapping[blockConfig.type] = blockConfig.iconName + } } console.log(`✓ Generated icon mapping for ${Object.keys(iconMapping).length} blocks`) @@ -159,31 +162,72 @@ ${mappingEntries} } } -function extractBlockConfig(fileContent: string): BlockConfig | null { - try { - const exportMatch = fileContent.match(/export\s+const\s+(\w+)Block\s*:/) +/** + * Extract ALL block configs from a file, filtering out hidden blocks + */ +function extractAllBlockConfigs(fileContent: string): BlockConfig[] { + const configs: BlockConfig[] = [] - if (!exportMatch) { - console.warn('No block export found in file') - return null + // Find all block exports in the file + const exportRegex = /export\s+const\s+(\w+)Block\s*:\s*BlockConfig[^=]*=\s*\{/g + let match + + while ((match = exportRegex.exec(fileContent)) !== null) { + const blockName = match[1] + const startIndex = match.index + match[0].length - 1 // Position of opening brace + + // Extract the block content by matching braces + let braceCount = 1 + let endIndex = startIndex + 1 + + while (endIndex < fileContent.length && braceCount > 0) { + if (fileContent[endIndex] === '{') braceCount++ + else if (fileContent[endIndex] === '}') braceCount-- + endIndex++ } - const blockName = exportMatch[1] - const blockType = findBlockType(fileContent, blockName) + if (braceCount === 0) { + const blockContent = fileContent.substring(startIndex, endIndex) + + // Check if this block has hideFromToolbar: true + const hideFromToolbar = /hideFromToolbar\s*:\s*true/.test(blockContent) + if (hideFromToolbar) { + console.log(`Skipping ${blockName}Block - hideFromToolbar is true`) + continue + } - const name = extractStringProperty(fileContent, 'name') || `${blockName} Block` - const description = extractStringProperty(fileContent, 'description') || '' - const longDescription = extractStringProperty(fileContent, 'longDescription') || '' - const category = extractStringProperty(fileContent, 'category') || 'misc' - const bgColor = extractStringProperty(fileContent, 'bgColor') || '#F5F5F5' - const iconName = extractIconName(fileContent) || '' + const config = extractBlockConfigFromContent(blockContent, blockName) + if (config) { + configs.push(config) + } + } + } - const outputs = extractOutputs(fileContent) + return configs +} - const toolsAccess = extractToolsAccess(fileContent) +/** + * Extract block config from a specific block's content + */ +function extractBlockConfigFromContent( + blockContent: string, + blockName: string +): BlockConfig | null { + try { + const blockType = + extractStringPropertyFromContent(blockContent, 'type') || blockName.toLowerCase() + const name = extractStringPropertyFromContent(blockContent, 'name') || `${blockName} Block` + const description = extractStringPropertyFromContent(blockContent, 'description') || '' + const longDescription = extractStringPropertyFromContent(blockContent, 'longDescription') || '' + const category = extractStringPropertyFromContent(blockContent, 'category') || 'misc' + const bgColor = extractStringPropertyFromContent(blockContent, 'bgColor') || '#F5F5F5' + const iconName = extractIconNameFromContent(blockContent) || '' + + const outputs = extractOutputsFromContent(blockContent) + const toolsAccess = extractToolsAccessFromContent(blockContent) return { - type: blockType || blockName.toLowerCase(), + type: blockType, name, description, longDescription, @@ -196,11 +240,128 @@ function extractBlockConfig(fileContent: string): BlockConfig | null { }, } } catch (error) { - console.error('Error extracting block configuration:', error) + console.error(`Error extracting block configuration for ${blockName}:`, error) return null } } +function extractStringPropertyFromContent(content: string, propName: string): string | null { + const singleQuoteMatch = content.match(new RegExp(`${propName}\\s*:\\s*'([^']*)'`, 'm')) + if (singleQuoteMatch) return singleQuoteMatch[1] + + const doubleQuoteMatch = content.match(new RegExp(`${propName}\\s*:\\s*"([^"]*)"`, 'm')) + if (doubleQuoteMatch) return doubleQuoteMatch[1] + + const templateMatch = content.match(new RegExp(`${propName}\\s*:\\s*\`([^\`]+)\``, 's')) + if (templateMatch) { + let templateContent = templateMatch[1] + templateContent = templateContent.replace(/\$\{[^}]+\}/g, '') + templateContent = templateContent.replace(/\s+/g, ' ').trim() + return templateContent + } + + return null +} + +function extractIconNameFromContent(content: string): string | null { + const iconMatch = content.match(/icon\s*:\s*(\w+Icon)/) + return iconMatch ? iconMatch[1] : null +} + +function extractOutputsFromContent(content: string): Record { + const outputsStart = content.search(/outputs\s*:\s*{/) + if (outputsStart === -1) return {} + + const openBracePos = content.indexOf('{', outputsStart) + if (openBracePos === -1) return {} + + let braceCount = 1 + let pos = openBracePos + 1 + + while (pos < content.length && braceCount > 0) { + if (content[pos] === '{') braceCount++ + else if (content[pos] === '}') braceCount-- + pos++ + } + + if (braceCount === 0) { + const outputsContent = content.substring(openBracePos + 1, pos - 1).trim() + const outputs: Record = {} + + const fieldRegex = /(\w+)\s*:\s*{/g + let match + const fieldPositions: Array<{ name: string; start: number }> = [] + + while ((match = fieldRegex.exec(outputsContent)) !== null) { + fieldPositions.push({ + name: match[1], + start: match.index + match[0].length - 1, + }) + } + + fieldPositions.forEach((field) => { + const startPos = field.start + let braceCount = 1 + let endPos = startPos + 1 + + while (endPos < outputsContent.length && braceCount > 0) { + if (outputsContent[endPos] === '{') braceCount++ + else if (outputsContent[endPos] === '}') braceCount-- + endPos++ + } + + if (braceCount === 0) { + const fieldContent = outputsContent.substring(startPos + 1, endPos - 1).trim() + + const typeMatch = fieldContent.match(/type\s*:\s*['"](.*?)['"]/) + const descriptionMatch = fieldContent.match(/description\s*:\s*['"](.*?)['"]/) + + if (typeMatch) { + outputs[field.name] = { + type: typeMatch[1], + description: descriptionMatch + ? descriptionMatch[1] + : `${field.name} output from the block`, + } + } + } + }) + + if (Object.keys(outputs).length > 0) { + return outputs + } + } + + return {} +} + +function extractToolsAccessFromContent(content: string): string[] { + const accessMatch = content.match(/access\s*:\s*\[\s*([^\]]+)\s*\]/) + if (!accessMatch) return [] + + const accessContent = accessMatch[1] + const tools: string[] = [] + + const toolMatches = accessContent.match(/['"]([^'"]+)['"]/g) + if (toolMatches) { + toolMatches.forEach((toolText) => { + const match = toolText.match(/['"]([^'"]+)['"]/) + if (match) { + tools.push(match[1]) + } + }) + } + + return tools +} + +// Legacy function for backward compatibility (icon mapping, etc.) +function extractBlockConfig(fileContent: string): BlockConfig | null { + const configs = extractAllBlockConfigs(fileContent) + // Return first non-hidden block for legacy code paths + return configs.length > 0 ? configs[0] : null +} + function findBlockType(content: string, blockName: string): string { const blockExportRegex = new RegExp( `export\\s+const\\s+${blockName}Block\\s*:[^{]*{[\\s\\S]*?type\\s*:\\s*['"]([^'"]+)['"][\\s\\S]*?}`, @@ -899,54 +1060,63 @@ async function generateBlockDoc(blockPath: string) { const fileContent = fs.readFileSync(blockPath, 'utf-8') - const blockConfig = extractBlockConfig(fileContent) + // Extract ALL block configs from the file (already filters out hideFromToolbar: true) + const blockConfigs = extractAllBlockConfigs(fileContent) - if (!blockConfig || !blockConfig.type) { - console.warn(`Skipping ${blockFileName} - not a valid block config`) + if (blockConfigs.length === 0) { + console.warn(`Skipping ${blockFileName} - no valid block configs found`) return } - if ( - blockConfig.type.includes('_trigger') || - blockConfig.type.includes('_webhook') || - blockConfig.type.includes('rss') - ) { - console.log(`Skipping ${blockConfig.type} - contains '_trigger'`) - return - } + // Process each block config + for (const blockConfig of blockConfigs) { + if (!blockConfig.type) { + continue + } - if ( - (blockConfig.category === 'blocks' && - blockConfig.type !== 'memory' && - blockConfig.type !== 'knowledge') || - blockConfig.type === 'evaluator' || - blockConfig.type === 'number' || - blockConfig.type === 'webhook' || - blockConfig.type === 'schedule' || - blockConfig.type === 'mcp' || - blockConfig.type === 'generic_webhook' || - blockConfig.type === 'rss' - ) { - return - } + if ( + blockConfig.type.includes('_trigger') || + blockConfig.type.includes('_webhook') || + blockConfig.type.includes('rss') + ) { + console.log(`Skipping ${blockConfig.type} - contains '_trigger'`) + continue + } - const outputFilePath = path.join(DOCS_OUTPUT_PATH, `${blockConfig.type}.mdx`) + if ( + (blockConfig.category === 'blocks' && + blockConfig.type !== 'memory' && + blockConfig.type !== 'knowledge') || + blockConfig.type === 'evaluator' || + blockConfig.type === 'number' || + blockConfig.type === 'webhook' || + blockConfig.type === 'schedule' || + blockConfig.type === 'mcp' || + blockConfig.type === 'generic_webhook' || + blockConfig.type === 'rss' + ) { + continue + } - let existingContent: string | null = null - if (fs.existsSync(outputFilePath)) { - existingContent = fs.readFileSync(outputFilePath, 'utf-8') - } + const outputFilePath = path.join(DOCS_OUTPUT_PATH, `${blockConfig.type}.mdx`) + + let existingContent: string | null = null + if (fs.existsSync(outputFilePath)) { + existingContent = fs.readFileSync(outputFilePath, 'utf-8') + } - const manualSections = existingContent ? extractManualContent(existingContent) : {} + const manualSections = existingContent ? extractManualContent(existingContent) : {} - const markdown = await generateMarkdownForBlock(blockConfig) + const markdown = await generateMarkdownForBlock(blockConfig) - let finalContent = markdown - if (Object.keys(manualSections).length > 0) { - finalContent = mergeWithManualContent(markdown, existingContent, manualSections) - } + let finalContent = markdown + if (Object.keys(manualSections).length > 0) { + finalContent = mergeWithManualContent(markdown, existingContent, manualSections) + } - fs.writeFileSync(outputFilePath, finalContent) + fs.writeFileSync(outputFilePath, finalContent) + console.log(`✓ Generated docs for ${blockConfig.type}`) + } } catch (error) { console.error(`Error processing ${blockPath}:`, error) } @@ -1142,6 +1312,80 @@ ${toolsSection} ` } +/** + * Extract all hidden block types (blocks with hideFromToolbar: true) + */ +async function getHiddenBlockTypes(): Promise> { + const hiddenTypes = new Set() + const blockFiles = (await glob(`${BLOCKS_PATH}/*.ts`)).sort() + + for (const blockFile of blockFiles) { + const fileContent = fs.readFileSync(blockFile, 'utf-8') + + // Find all block exports + const exportRegex = /export\s+const\s+(\w+)Block\s*:\s*BlockConfig[^=]*=\s*\{/g + let match + + while ((match = exportRegex.exec(fileContent)) !== null) { + const startIndex = match.index + match[0].length - 1 + + // Extract the block content + let braceCount = 1 + let endIndex = startIndex + 1 + + while (endIndex < fileContent.length && braceCount > 0) { + if (fileContent[endIndex] === '{') braceCount++ + else if (fileContent[endIndex] === '}') braceCount-- + endIndex++ + } + + if (braceCount === 0) { + const blockContent = fileContent.substring(startIndex, endIndex) + + // Check if this block has hideFromToolbar: true + if (/hideFromToolbar\s*:\s*true/.test(blockContent)) { + const blockType = extractStringPropertyFromContent(blockContent, 'type') + if (blockType) { + hiddenTypes.add(blockType) + } + } + } + } + } + + return hiddenTypes +} + +/** + * Remove documentation files for hidden blocks + */ +function cleanupHiddenBlockDocs(hiddenTypes: Set): void { + console.log('Cleaning up docs for hidden blocks...') + + const existingDocs = fs + .readdirSync(DOCS_OUTPUT_PATH) + .filter((file: string) => file.endsWith('.mdx')) + + let removedCount = 0 + + for (const docFile of existingDocs) { + const blockType = path.basename(docFile, '.mdx') + + if (hiddenTypes.has(blockType)) { + const docPath = path.join(DOCS_OUTPUT_PATH, docFile) + fs.unlinkSync(docPath) + console.log(`✓ Removed docs for hidden block: ${blockType}`) + removedCount++ + } + } + + if (removedCount > 0) { + console.log(`✓ Cleaned up ${removedCount} doc files for hidden blocks`) + } else { + console.log('✓ No hidden block docs to clean up') + } +} + async function generateAllBlockDocs() { try { // Copy icons from sim app to docs app @@ -1151,6 +1395,13 @@ async function generateAllBlockDocs() { const iconMapping = await generateIconMapping() writeIconMapping(iconMapping) + // Get hidden block types before generating docs + const hiddenTypes = await getHiddenBlockTypes() + console.log(`Found ${hiddenTypes.size} hidden blocks: ${[...hiddenTypes].join(', ')}`) + + // Clean up docs for hidden blocks + cleanupHiddenBlockDocs(hiddenTypes) + const blockFiles = (await glob(`${BLOCKS_PATH}/*.ts`)).sort() for (const blockFile of blockFiles) { From e52f0f1f9bc1951e665e680ab6657b479a021f08 Mon Sep 17 00:00:00 2001 From: Vikhyath Mondreti Date: Sat, 10 Jan 2026 23:08:32 -0800 Subject: [PATCH 2/2] add back icons --- apps/docs/components/ui/icon-mapping.ts | 10 + .../content/docs/en/tools/intercom_v2.mdx | 530 ++++-------------- scripts/generate-docs.ts | 94 +++- 3 files changed, 189 insertions(+), 445 deletions(-) diff --git a/apps/docs/components/ui/icon-mapping.ts b/apps/docs/components/ui/icon-mapping.ts index 2d7b6ffed5..65fbaef833 100644 --- a/apps/docs/components/ui/icon-mapping.ts +++ b/apps/docs/components/ui/icon-mapping.ts @@ -16,6 +16,7 @@ import { CirclebackIcon, ClayIcon, ConfluenceIcon, + CursorIcon, DatadogIcon, DiscordIcon, DocumentIcon, @@ -28,7 +29,10 @@ import { EyeIcon, FirecrawlIcon, FirefliesIcon, + GithubIcon, GitLabIcon, + GmailIcon, + GoogleCalendarIcon, GoogleDocsIcon, GoogleDriveIcon, GoogleFormsIcon, @@ -45,6 +49,7 @@ import { HunterIOIcon, ImageIcon, IncidentioIcon, + IntercomIcon, JinaAIIcon, JiraIcon, JiraServiceManagementIcon, @@ -132,6 +137,7 @@ export const blockTypeToIconMap: Record = { circleback: CirclebackIcon, clay: ClayIcon, confluence: ConfluenceIcon, + cursor_v2: CursorIcon, datadog: DatadogIcon, discord: DiscordIcon, dropbox: DropboxIcon, @@ -143,7 +149,10 @@ export const blockTypeToIconMap: Record = { file: DocumentIcon, firecrawl: FirecrawlIcon, fireflies: FirefliesIcon, + github_v2: GithubIcon, gitlab: GitLabIcon, + gmail_v2: GmailIcon, + google_calendar_v2: GoogleCalendarIcon, google_docs: GoogleDocsIcon, google_drive: GoogleDriveIcon, google_forms: GoogleFormsIcon, @@ -161,6 +170,7 @@ export const blockTypeToIconMap: Record = { image_generator: ImageIcon, imap: MailServerIcon, incidentio: IncidentioIcon, + intercom_v2: IntercomIcon, jina: JinaAIIcon, jira: JiraIcon, jira_service_management: JiraServiceManagementIcon, diff --git a/apps/docs/content/docs/en/tools/intercom_v2.mdx b/apps/docs/content/docs/en/tools/intercom_v2.mdx index 291ae02d45..6a5dca7b81 100644 --- a/apps/docs/content/docs/en/tools/intercom_v2.mdx +++ b/apps/docs/content/docs/en/tools/intercom_v2.mdx @@ -1,6 +1,6 @@ --- title: Intercom -description: Contact object from contact operations +description: Contact object with id, type, role, email, phone, name, external_id, created_at, updated_at --- import { BlockInfoCard } from "@/components/ui/block-info-card" @@ -25,41 +25,22 @@ import { BlockInfoCard } from "@/components/ui/block-info-card" | Parameter | Type | Description | | --------- | ---- | ----------- | -| `contact` | object | Contact object from contact operations | -| `properties` | number | Current page number | -| `id` | string | ID of the deleted item \(for delete operations\) | -| `type` | string | Type of the message | -| `role` | string | Role of the contact \(user or lead\) | -| `email` | string | Email address of the contact | -| `phone` | string | Phone number of the contact | -| `name` | string | Name of the company | -| `external_id` | string | External identifier for the contact | -| `created_at` | number | Unix timestamp when contact was created | -| `updated_at` | number | Unix timestamp when contact was last updated | +| `contact` | json | Contact object with id, type, role, email, phone, name, external_id, created_at, updated_at | | `contactId` | string | ID of the contact \(for create/update operations\) | | `contacts` | array | Array of contacts \(for list/search operations\) | -| `company` | object | Company object from company operations | -| `company_id` | string | Your unique identifier for the company | -| `website` | string | Company website URL | +| `company` | json | Company object with id, company_id, name, website | | `companyId` | string | ID of the company \(for create operations\) | | `companies` | array | Array of companies \(for list operations\) | -| `conversation` | object | Conversation object from conversation operations | -| `title` | string | Title of the conversation | -| `state` | string | State of the conversation | -| `open` | boolean | Whether the conversation is open | +| `conversation` | json | Conversation object with id, title, state, open | | `conversationId` | string | ID of the conversation \(for reply operations\) | | `conversations` | array | Array of conversations \(for list/search operations\) | -| `ticket` | object | Ticket object from ticket operations | -| `ticket_id` | string | Ticket ID | -| `ticket_state` | string | State of the ticket | +| `ticket` | json | Ticket object with id, ticket_id, ticket_state | | `ticketId` | string | ID of the ticket \(for create operations\) | -| `message` | object | Message object from message operations | +| `message` | json | Message object with id, type | | `messageId` | string | ID of the message \(for create operations\) | | `total_count` | number | Total count \(for list/search operations\) | -| `pages` | object | Pagination information | -| `page` | number | Current page number | -| `per_page` | number | Number of results per page | -| `total_pages` | number | Total number of pages | +| `pages` | json | Pagination info with page, per_page, total_pages | +| `id` | string | ID of the deleted item \(for delete operations\) | | `deleted` | boolean | Whether the item was deleted \(for delete operations\) | ### `intercom_get_contact_v2` @@ -73,41 +54,22 @@ import { BlockInfoCard } from "@/components/ui/block-info-card" | Parameter | Type | Description | | --------- | ---- | ----------- | -| `contact` | object | Contact object from contact operations | -| `properties` | number | Current page number | -| `id` | string | ID of the deleted item \(for delete operations\) | -| `type` | string | Type of the message | -| `role` | string | Role of the contact \(user or lead\) | -| `email` | string | Email address of the contact | -| `phone` | string | Phone number of the contact | -| `name` | string | Name of the company | -| `external_id` | string | External identifier for the contact | -| `created_at` | number | Unix timestamp when contact was created | -| `updated_at` | number | Unix timestamp when contact was last updated | +| `contact` | json | Contact object with id, type, role, email, phone, name, external_id, created_at, updated_at | | `contactId` | string | ID of the contact \(for create/update operations\) | | `contacts` | array | Array of contacts \(for list/search operations\) | -| `company` | object | Company object from company operations | -| `company_id` | string | Your unique identifier for the company | -| `website` | string | Company website URL | +| `company` | json | Company object with id, company_id, name, website | | `companyId` | string | ID of the company \(for create operations\) | | `companies` | array | Array of companies \(for list operations\) | -| `conversation` | object | Conversation object from conversation operations | -| `title` | string | Title of the conversation | -| `state` | string | State of the conversation | -| `open` | boolean | Whether the conversation is open | +| `conversation` | json | Conversation object with id, title, state, open | | `conversationId` | string | ID of the conversation \(for reply operations\) | | `conversations` | array | Array of conversations \(for list/search operations\) | -| `ticket` | object | Ticket object from ticket operations | -| `ticket_id` | string | Ticket ID | -| `ticket_state` | string | State of the ticket | +| `ticket` | json | Ticket object with id, ticket_id, ticket_state | | `ticketId` | string | ID of the ticket \(for create operations\) | -| `message` | object | Message object from message operations | +| `message` | json | Message object with id, type | | `messageId` | string | ID of the message \(for create operations\) | | `total_count` | number | Total count \(for list/search operations\) | -| `pages` | object | Pagination information | -| `page` | number | Current page number | -| `per_page` | number | Number of results per page | -| `total_pages` | number | Total number of pages | +| `pages` | json | Pagination info with page, per_page, total_pages | +| `id` | string | ID of the deleted item \(for delete operations\) | | `deleted` | boolean | Whether the item was deleted \(for delete operations\) | ### `intercom_update_contact_v2` @@ -121,41 +83,22 @@ import { BlockInfoCard } from "@/components/ui/block-info-card" | Parameter | Type | Description | | --------- | ---- | ----------- | -| `contact` | object | Contact object from contact operations | -| `properties` | number | Current page number | -| `id` | string | ID of the deleted item \(for delete operations\) | -| `type` | string | Type of the message | -| `role` | string | Role of the contact \(user or lead\) | -| `email` | string | Email address of the contact | -| `phone` | string | Phone number of the contact | -| `name` | string | Name of the company | -| `external_id` | string | External identifier for the contact | -| `created_at` | number | Unix timestamp when contact was created | -| `updated_at` | number | Unix timestamp when contact was last updated | +| `contact` | json | Contact object with id, type, role, email, phone, name, external_id, created_at, updated_at | | `contactId` | string | ID of the contact \(for create/update operations\) | | `contacts` | array | Array of contacts \(for list/search operations\) | -| `company` | object | Company object from company operations | -| `company_id` | string | Your unique identifier for the company | -| `website` | string | Company website URL | +| `company` | json | Company object with id, company_id, name, website | | `companyId` | string | ID of the company \(for create operations\) | | `companies` | array | Array of companies \(for list operations\) | -| `conversation` | object | Conversation object from conversation operations | -| `title` | string | Title of the conversation | -| `state` | string | State of the conversation | -| `open` | boolean | Whether the conversation is open | +| `conversation` | json | Conversation object with id, title, state, open | | `conversationId` | string | ID of the conversation \(for reply operations\) | | `conversations` | array | Array of conversations \(for list/search operations\) | -| `ticket` | object | Ticket object from ticket operations | -| `ticket_id` | string | Ticket ID | -| `ticket_state` | string | State of the ticket | +| `ticket` | json | Ticket object with id, ticket_id, ticket_state | | `ticketId` | string | ID of the ticket \(for create operations\) | -| `message` | object | Message object from message operations | +| `message` | json | Message object with id, type | | `messageId` | string | ID of the message \(for create operations\) | | `total_count` | number | Total count \(for list/search operations\) | -| `pages` | object | Pagination information | -| `page` | number | Current page number | -| `per_page` | number | Number of results per page | -| `total_pages` | number | Total number of pages | +| `pages` | json | Pagination info with page, per_page, total_pages | +| `id` | string | ID of the deleted item \(for delete operations\) | | `deleted` | boolean | Whether the item was deleted \(for delete operations\) | ### `intercom_list_contacts_v2` @@ -169,41 +112,22 @@ import { BlockInfoCard } from "@/components/ui/block-info-card" | Parameter | Type | Description | | --------- | ---- | ----------- | -| `contact` | object | Contact object from contact operations | -| `properties` | number | Current page number | -| `id` | string | ID of the deleted item \(for delete operations\) | -| `type` | string | Type of the message | -| `role` | string | Role of the contact \(user or lead\) | -| `email` | string | Email address of the contact | -| `phone` | string | Phone number of the contact | -| `name` | string | Name of the company | -| `external_id` | string | External identifier for the contact | -| `created_at` | number | Unix timestamp when contact was created | -| `updated_at` | number | Unix timestamp when contact was last updated | +| `contact` | json | Contact object with id, type, role, email, phone, name, external_id, created_at, updated_at | | `contactId` | string | ID of the contact \(for create/update operations\) | | `contacts` | array | Array of contacts \(for list/search operations\) | -| `company` | object | Company object from company operations | -| `company_id` | string | Your unique identifier for the company | -| `website` | string | Company website URL | +| `company` | json | Company object with id, company_id, name, website | | `companyId` | string | ID of the company \(for create operations\) | | `companies` | array | Array of companies \(for list operations\) | -| `conversation` | object | Conversation object from conversation operations | -| `title` | string | Title of the conversation | -| `state` | string | State of the conversation | -| `open` | boolean | Whether the conversation is open | +| `conversation` | json | Conversation object with id, title, state, open | | `conversationId` | string | ID of the conversation \(for reply operations\) | | `conversations` | array | Array of conversations \(for list/search operations\) | -| `ticket` | object | Ticket object from ticket operations | -| `ticket_id` | string | Ticket ID | -| `ticket_state` | string | State of the ticket | +| `ticket` | json | Ticket object with id, ticket_id, ticket_state | | `ticketId` | string | ID of the ticket \(for create operations\) | -| `message` | object | Message object from message operations | +| `message` | json | Message object with id, type | | `messageId` | string | ID of the message \(for create operations\) | | `total_count` | number | Total count \(for list/search operations\) | -| `pages` | object | Pagination information | -| `page` | number | Current page number | -| `per_page` | number | Number of results per page | -| `total_pages` | number | Total number of pages | +| `pages` | json | Pagination info with page, per_page, total_pages | +| `id` | string | ID of the deleted item \(for delete operations\) | | `deleted` | boolean | Whether the item was deleted \(for delete operations\) | ### `intercom_search_contacts_v2` @@ -217,41 +141,22 @@ import { BlockInfoCard } from "@/components/ui/block-info-card" | Parameter | Type | Description | | --------- | ---- | ----------- | -| `contact` | object | Contact object from contact operations | -| `properties` | number | Current page number | -| `id` | string | ID of the deleted item \(for delete operations\) | -| `type` | string | Type of the message | -| `role` | string | Role of the contact \(user or lead\) | -| `email` | string | Email address of the contact | -| `phone` | string | Phone number of the contact | -| `name` | string | Name of the company | -| `external_id` | string | External identifier for the contact | -| `created_at` | number | Unix timestamp when contact was created | -| `updated_at` | number | Unix timestamp when contact was last updated | +| `contact` | json | Contact object with id, type, role, email, phone, name, external_id, created_at, updated_at | | `contactId` | string | ID of the contact \(for create/update operations\) | | `contacts` | array | Array of contacts \(for list/search operations\) | -| `company` | object | Company object from company operations | -| `company_id` | string | Your unique identifier for the company | -| `website` | string | Company website URL | +| `company` | json | Company object with id, company_id, name, website | | `companyId` | string | ID of the company \(for create operations\) | | `companies` | array | Array of companies \(for list operations\) | -| `conversation` | object | Conversation object from conversation operations | -| `title` | string | Title of the conversation | -| `state` | string | State of the conversation | -| `open` | boolean | Whether the conversation is open | +| `conversation` | json | Conversation object with id, title, state, open | | `conversationId` | string | ID of the conversation \(for reply operations\) | | `conversations` | array | Array of conversations \(for list/search operations\) | -| `ticket` | object | Ticket object from ticket operations | -| `ticket_id` | string | Ticket ID | -| `ticket_state` | string | State of the ticket | +| `ticket` | json | Ticket object with id, ticket_id, ticket_state | | `ticketId` | string | ID of the ticket \(for create operations\) | -| `message` | object | Message object from message operations | +| `message` | json | Message object with id, type | | `messageId` | string | ID of the message \(for create operations\) | | `total_count` | number | Total count \(for list/search operations\) | -| `pages` | object | Pagination information | -| `page` | number | Current page number | -| `per_page` | number | Number of results per page | -| `total_pages` | number | Total number of pages | +| `pages` | json | Pagination info with page, per_page, total_pages | +| `id` | string | ID of the deleted item \(for delete operations\) | | `deleted` | boolean | Whether the item was deleted \(for delete operations\) | ### `intercom_delete_contact_v2` @@ -265,41 +170,22 @@ import { BlockInfoCard } from "@/components/ui/block-info-card" | Parameter | Type | Description | | --------- | ---- | ----------- | -| `contact` | object | Contact object from contact operations | -| `properties` | number | Current page number | -| `id` | string | ID of the deleted item \(for delete operations\) | -| `type` | string | Type of the message | -| `role` | string | Role of the contact \(user or lead\) | -| `email` | string | Email address of the contact | -| `phone` | string | Phone number of the contact | -| `name` | string | Name of the company | -| `external_id` | string | External identifier for the contact | -| `created_at` | number | Unix timestamp when contact was created | -| `updated_at` | number | Unix timestamp when contact was last updated | +| `contact` | json | Contact object with id, type, role, email, phone, name, external_id, created_at, updated_at | | `contactId` | string | ID of the contact \(for create/update operations\) | | `contacts` | array | Array of contacts \(for list/search operations\) | -| `company` | object | Company object from company operations | -| `company_id` | string | Your unique identifier for the company | -| `website` | string | Company website URL | +| `company` | json | Company object with id, company_id, name, website | | `companyId` | string | ID of the company \(for create operations\) | | `companies` | array | Array of companies \(for list operations\) | -| `conversation` | object | Conversation object from conversation operations | -| `title` | string | Title of the conversation | -| `state` | string | State of the conversation | -| `open` | boolean | Whether the conversation is open | +| `conversation` | json | Conversation object with id, title, state, open | | `conversationId` | string | ID of the conversation \(for reply operations\) | | `conversations` | array | Array of conversations \(for list/search operations\) | -| `ticket` | object | Ticket object from ticket operations | -| `ticket_id` | string | Ticket ID | -| `ticket_state` | string | State of the ticket | +| `ticket` | json | Ticket object with id, ticket_id, ticket_state | | `ticketId` | string | ID of the ticket \(for create operations\) | -| `message` | object | Message object from message operations | +| `message` | json | Message object with id, type | | `messageId` | string | ID of the message \(for create operations\) | | `total_count` | number | Total count \(for list/search operations\) | -| `pages` | object | Pagination information | -| `page` | number | Current page number | -| `per_page` | number | Number of results per page | -| `total_pages` | number | Total number of pages | +| `pages` | json | Pagination info with page, per_page, total_pages | +| `id` | string | ID of the deleted item \(for delete operations\) | | `deleted` | boolean | Whether the item was deleted \(for delete operations\) | ### `intercom_create_company_v2` @@ -313,41 +199,22 @@ import { BlockInfoCard } from "@/components/ui/block-info-card" | Parameter | Type | Description | | --------- | ---- | ----------- | -| `contact` | object | Contact object from contact operations | -| `properties` | number | Current page number | -| `id` | string | ID of the deleted item \(for delete operations\) | -| `type` | string | Type of the message | -| `role` | string | Role of the contact \(user or lead\) | -| `email` | string | Email address of the contact | -| `phone` | string | Phone number of the contact | -| `name` | string | Name of the company | -| `external_id` | string | External identifier for the contact | -| `created_at` | number | Unix timestamp when contact was created | -| `updated_at` | number | Unix timestamp when contact was last updated | +| `contact` | json | Contact object with id, type, role, email, phone, name, external_id, created_at, updated_at | | `contactId` | string | ID of the contact \(for create/update operations\) | | `contacts` | array | Array of contacts \(for list/search operations\) | -| `company` | object | Company object from company operations | -| `company_id` | string | Your unique identifier for the company | -| `website` | string | Company website URL | +| `company` | json | Company object with id, company_id, name, website | | `companyId` | string | ID of the company \(for create operations\) | | `companies` | array | Array of companies \(for list operations\) | -| `conversation` | object | Conversation object from conversation operations | -| `title` | string | Title of the conversation | -| `state` | string | State of the conversation | -| `open` | boolean | Whether the conversation is open | +| `conversation` | json | Conversation object with id, title, state, open | | `conversationId` | string | ID of the conversation \(for reply operations\) | | `conversations` | array | Array of conversations \(for list/search operations\) | -| `ticket` | object | Ticket object from ticket operations | -| `ticket_id` | string | Ticket ID | -| `ticket_state` | string | State of the ticket | +| `ticket` | json | Ticket object with id, ticket_id, ticket_state | | `ticketId` | string | ID of the ticket \(for create operations\) | -| `message` | object | Message object from message operations | +| `message` | json | Message object with id, type | | `messageId` | string | ID of the message \(for create operations\) | | `total_count` | number | Total count \(for list/search operations\) | -| `pages` | object | Pagination information | -| `page` | number | Current page number | -| `per_page` | number | Number of results per page | -| `total_pages` | number | Total number of pages | +| `pages` | json | Pagination info with page, per_page, total_pages | +| `id` | string | ID of the deleted item \(for delete operations\) | | `deleted` | boolean | Whether the item was deleted \(for delete operations\) | ### `intercom_get_company_v2` @@ -361,41 +228,22 @@ import { BlockInfoCard } from "@/components/ui/block-info-card" | Parameter | Type | Description | | --------- | ---- | ----------- | -| `contact` | object | Contact object from contact operations | -| `properties` | number | Current page number | -| `id` | string | ID of the deleted item \(for delete operations\) | -| `type` | string | Type of the message | -| `role` | string | Role of the contact \(user or lead\) | -| `email` | string | Email address of the contact | -| `phone` | string | Phone number of the contact | -| `name` | string | Name of the company | -| `external_id` | string | External identifier for the contact | -| `created_at` | number | Unix timestamp when contact was created | -| `updated_at` | number | Unix timestamp when contact was last updated | +| `contact` | json | Contact object with id, type, role, email, phone, name, external_id, created_at, updated_at | | `contactId` | string | ID of the contact \(for create/update operations\) | | `contacts` | array | Array of contacts \(for list/search operations\) | -| `company` | object | Company object from company operations | -| `company_id` | string | Your unique identifier for the company | -| `website` | string | Company website URL | +| `company` | json | Company object with id, company_id, name, website | | `companyId` | string | ID of the company \(for create operations\) | | `companies` | array | Array of companies \(for list operations\) | -| `conversation` | object | Conversation object from conversation operations | -| `title` | string | Title of the conversation | -| `state` | string | State of the conversation | -| `open` | boolean | Whether the conversation is open | +| `conversation` | json | Conversation object with id, title, state, open | | `conversationId` | string | ID of the conversation \(for reply operations\) | | `conversations` | array | Array of conversations \(for list/search operations\) | -| `ticket` | object | Ticket object from ticket operations | -| `ticket_id` | string | Ticket ID | -| `ticket_state` | string | State of the ticket | +| `ticket` | json | Ticket object with id, ticket_id, ticket_state | | `ticketId` | string | ID of the ticket \(for create operations\) | -| `message` | object | Message object from message operations | +| `message` | json | Message object with id, type | | `messageId` | string | ID of the message \(for create operations\) | | `total_count` | number | Total count \(for list/search operations\) | -| `pages` | object | Pagination information | -| `page` | number | Current page number | -| `per_page` | number | Number of results per page | -| `total_pages` | number | Total number of pages | +| `pages` | json | Pagination info with page, per_page, total_pages | +| `id` | string | ID of the deleted item \(for delete operations\) | | `deleted` | boolean | Whether the item was deleted \(for delete operations\) | ### `intercom_list_companies_v2` @@ -409,41 +257,22 @@ import { BlockInfoCard } from "@/components/ui/block-info-card" | Parameter | Type | Description | | --------- | ---- | ----------- | -| `contact` | object | Contact object from contact operations | -| `properties` | number | Current page number | -| `id` | string | ID of the deleted item \(for delete operations\) | -| `type` | string | Type of the message | -| `role` | string | Role of the contact \(user or lead\) | -| `email` | string | Email address of the contact | -| `phone` | string | Phone number of the contact | -| `name` | string | Name of the company | -| `external_id` | string | External identifier for the contact | -| `created_at` | number | Unix timestamp when contact was created | -| `updated_at` | number | Unix timestamp when contact was last updated | +| `contact` | json | Contact object with id, type, role, email, phone, name, external_id, created_at, updated_at | | `contactId` | string | ID of the contact \(for create/update operations\) | | `contacts` | array | Array of contacts \(for list/search operations\) | -| `company` | object | Company object from company operations | -| `company_id` | string | Your unique identifier for the company | -| `website` | string | Company website URL | +| `company` | json | Company object with id, company_id, name, website | | `companyId` | string | ID of the company \(for create operations\) | | `companies` | array | Array of companies \(for list operations\) | -| `conversation` | object | Conversation object from conversation operations | -| `title` | string | Title of the conversation | -| `state` | string | State of the conversation | -| `open` | boolean | Whether the conversation is open | +| `conversation` | json | Conversation object with id, title, state, open | | `conversationId` | string | ID of the conversation \(for reply operations\) | | `conversations` | array | Array of conversations \(for list/search operations\) | -| `ticket` | object | Ticket object from ticket operations | -| `ticket_id` | string | Ticket ID | -| `ticket_state` | string | State of the ticket | +| `ticket` | json | Ticket object with id, ticket_id, ticket_state | | `ticketId` | string | ID of the ticket \(for create operations\) | -| `message` | object | Message object from message operations | +| `message` | json | Message object with id, type | | `messageId` | string | ID of the message \(for create operations\) | | `total_count` | number | Total count \(for list/search operations\) | -| `pages` | object | Pagination information | -| `page` | number | Current page number | -| `per_page` | number | Number of results per page | -| `total_pages` | number | Total number of pages | +| `pages` | json | Pagination info with page, per_page, total_pages | +| `id` | string | ID of the deleted item \(for delete operations\) | | `deleted` | boolean | Whether the item was deleted \(for delete operations\) | ### `intercom_get_conversation_v2` @@ -457,41 +286,22 @@ import { BlockInfoCard } from "@/components/ui/block-info-card" | Parameter | Type | Description | | --------- | ---- | ----------- | -| `contact` | object | Contact object from contact operations | -| `properties` | number | Current page number | -| `id` | string | ID of the deleted item \(for delete operations\) | -| `type` | string | Type of the message | -| `role` | string | Role of the contact \(user or lead\) | -| `email` | string | Email address of the contact | -| `phone` | string | Phone number of the contact | -| `name` | string | Name of the company | -| `external_id` | string | External identifier for the contact | -| `created_at` | number | Unix timestamp when contact was created | -| `updated_at` | number | Unix timestamp when contact was last updated | +| `contact` | json | Contact object with id, type, role, email, phone, name, external_id, created_at, updated_at | | `contactId` | string | ID of the contact \(for create/update operations\) | | `contacts` | array | Array of contacts \(for list/search operations\) | -| `company` | object | Company object from company operations | -| `company_id` | string | Your unique identifier for the company | -| `website` | string | Company website URL | +| `company` | json | Company object with id, company_id, name, website | | `companyId` | string | ID of the company \(for create operations\) | | `companies` | array | Array of companies \(for list operations\) | -| `conversation` | object | Conversation object from conversation operations | -| `title` | string | Title of the conversation | -| `state` | string | State of the conversation | -| `open` | boolean | Whether the conversation is open | +| `conversation` | json | Conversation object with id, title, state, open | | `conversationId` | string | ID of the conversation \(for reply operations\) | | `conversations` | array | Array of conversations \(for list/search operations\) | -| `ticket` | object | Ticket object from ticket operations | -| `ticket_id` | string | Ticket ID | -| `ticket_state` | string | State of the ticket | +| `ticket` | json | Ticket object with id, ticket_id, ticket_state | | `ticketId` | string | ID of the ticket \(for create operations\) | -| `message` | object | Message object from message operations | +| `message` | json | Message object with id, type | | `messageId` | string | ID of the message \(for create operations\) | | `total_count` | number | Total count \(for list/search operations\) | -| `pages` | object | Pagination information | -| `page` | number | Current page number | -| `per_page` | number | Number of results per page | -| `total_pages` | number | Total number of pages | +| `pages` | json | Pagination info with page, per_page, total_pages | +| `id` | string | ID of the deleted item \(for delete operations\) | | `deleted` | boolean | Whether the item was deleted \(for delete operations\) | ### `intercom_list_conversations_v2` @@ -505,41 +315,22 @@ import { BlockInfoCard } from "@/components/ui/block-info-card" | Parameter | Type | Description | | --------- | ---- | ----------- | -| `contact` | object | Contact object from contact operations | -| `properties` | number | Current page number | -| `id` | string | ID of the deleted item \(for delete operations\) | -| `type` | string | Type of the message | -| `role` | string | Role of the contact \(user or lead\) | -| `email` | string | Email address of the contact | -| `phone` | string | Phone number of the contact | -| `name` | string | Name of the company | -| `external_id` | string | External identifier for the contact | -| `created_at` | number | Unix timestamp when contact was created | -| `updated_at` | number | Unix timestamp when contact was last updated | +| `contact` | json | Contact object with id, type, role, email, phone, name, external_id, created_at, updated_at | | `contactId` | string | ID of the contact \(for create/update operations\) | | `contacts` | array | Array of contacts \(for list/search operations\) | -| `company` | object | Company object from company operations | -| `company_id` | string | Your unique identifier for the company | -| `website` | string | Company website URL | +| `company` | json | Company object with id, company_id, name, website | | `companyId` | string | ID of the company \(for create operations\) | | `companies` | array | Array of companies \(for list operations\) | -| `conversation` | object | Conversation object from conversation operations | -| `title` | string | Title of the conversation | -| `state` | string | State of the conversation | -| `open` | boolean | Whether the conversation is open | +| `conversation` | json | Conversation object with id, title, state, open | | `conversationId` | string | ID of the conversation \(for reply operations\) | | `conversations` | array | Array of conversations \(for list/search operations\) | -| `ticket` | object | Ticket object from ticket operations | -| `ticket_id` | string | Ticket ID | -| `ticket_state` | string | State of the ticket | +| `ticket` | json | Ticket object with id, ticket_id, ticket_state | | `ticketId` | string | ID of the ticket \(for create operations\) | -| `message` | object | Message object from message operations | +| `message` | json | Message object with id, type | | `messageId` | string | ID of the message \(for create operations\) | | `total_count` | number | Total count \(for list/search operations\) | -| `pages` | object | Pagination information | -| `page` | number | Current page number | -| `per_page` | number | Number of results per page | -| `total_pages` | number | Total number of pages | +| `pages` | json | Pagination info with page, per_page, total_pages | +| `id` | string | ID of the deleted item \(for delete operations\) | | `deleted` | boolean | Whether the item was deleted \(for delete operations\) | ### `intercom_reply_conversation_v2` @@ -553,41 +344,22 @@ import { BlockInfoCard } from "@/components/ui/block-info-card" | Parameter | Type | Description | | --------- | ---- | ----------- | -| `contact` | object | Contact object from contact operations | -| `properties` | number | Current page number | -| `id` | string | ID of the deleted item \(for delete operations\) | -| `type` | string | Type of the message | -| `role` | string | Role of the contact \(user or lead\) | -| `email` | string | Email address of the contact | -| `phone` | string | Phone number of the contact | -| `name` | string | Name of the company | -| `external_id` | string | External identifier for the contact | -| `created_at` | number | Unix timestamp when contact was created | -| `updated_at` | number | Unix timestamp when contact was last updated | +| `contact` | json | Contact object with id, type, role, email, phone, name, external_id, created_at, updated_at | | `contactId` | string | ID of the contact \(for create/update operations\) | | `contacts` | array | Array of contacts \(for list/search operations\) | -| `company` | object | Company object from company operations | -| `company_id` | string | Your unique identifier for the company | -| `website` | string | Company website URL | +| `company` | json | Company object with id, company_id, name, website | | `companyId` | string | ID of the company \(for create operations\) | | `companies` | array | Array of companies \(for list operations\) | -| `conversation` | object | Conversation object from conversation operations | -| `title` | string | Title of the conversation | -| `state` | string | State of the conversation | -| `open` | boolean | Whether the conversation is open | +| `conversation` | json | Conversation object with id, title, state, open | | `conversationId` | string | ID of the conversation \(for reply operations\) | | `conversations` | array | Array of conversations \(for list/search operations\) | -| `ticket` | object | Ticket object from ticket operations | -| `ticket_id` | string | Ticket ID | -| `ticket_state` | string | State of the ticket | +| `ticket` | json | Ticket object with id, ticket_id, ticket_state | | `ticketId` | string | ID of the ticket \(for create operations\) | -| `message` | object | Message object from message operations | +| `message` | json | Message object with id, type | | `messageId` | string | ID of the message \(for create operations\) | | `total_count` | number | Total count \(for list/search operations\) | -| `pages` | object | Pagination information | -| `page` | number | Current page number | -| `per_page` | number | Number of results per page | -| `total_pages` | number | Total number of pages | +| `pages` | json | Pagination info with page, per_page, total_pages | +| `id` | string | ID of the deleted item \(for delete operations\) | | `deleted` | boolean | Whether the item was deleted \(for delete operations\) | ### `intercom_search_conversations_v2` @@ -601,41 +373,22 @@ import { BlockInfoCard } from "@/components/ui/block-info-card" | Parameter | Type | Description | | --------- | ---- | ----------- | -| `contact` | object | Contact object from contact operations | -| `properties` | number | Current page number | -| `id` | string | ID of the deleted item \(for delete operations\) | -| `type` | string | Type of the message | -| `role` | string | Role of the contact \(user or lead\) | -| `email` | string | Email address of the contact | -| `phone` | string | Phone number of the contact | -| `name` | string | Name of the company | -| `external_id` | string | External identifier for the contact | -| `created_at` | number | Unix timestamp when contact was created | -| `updated_at` | number | Unix timestamp when contact was last updated | +| `contact` | json | Contact object with id, type, role, email, phone, name, external_id, created_at, updated_at | | `contactId` | string | ID of the contact \(for create/update operations\) | | `contacts` | array | Array of contacts \(for list/search operations\) | -| `company` | object | Company object from company operations | -| `company_id` | string | Your unique identifier for the company | -| `website` | string | Company website URL | +| `company` | json | Company object with id, company_id, name, website | | `companyId` | string | ID of the company \(for create operations\) | | `companies` | array | Array of companies \(for list operations\) | -| `conversation` | object | Conversation object from conversation operations | -| `title` | string | Title of the conversation | -| `state` | string | State of the conversation | -| `open` | boolean | Whether the conversation is open | +| `conversation` | json | Conversation object with id, title, state, open | | `conversationId` | string | ID of the conversation \(for reply operations\) | | `conversations` | array | Array of conversations \(for list/search operations\) | -| `ticket` | object | Ticket object from ticket operations | -| `ticket_id` | string | Ticket ID | -| `ticket_state` | string | State of the ticket | +| `ticket` | json | Ticket object with id, ticket_id, ticket_state | | `ticketId` | string | ID of the ticket \(for create operations\) | -| `message` | object | Message object from message operations | +| `message` | json | Message object with id, type | | `messageId` | string | ID of the message \(for create operations\) | | `total_count` | number | Total count \(for list/search operations\) | -| `pages` | object | Pagination information | -| `page` | number | Current page number | -| `per_page` | number | Number of results per page | -| `total_pages` | number | Total number of pages | +| `pages` | json | Pagination info with page, per_page, total_pages | +| `id` | string | ID of the deleted item \(for delete operations\) | | `deleted` | boolean | Whether the item was deleted \(for delete operations\) | ### `intercom_create_ticket_v2` @@ -649,41 +402,22 @@ import { BlockInfoCard } from "@/components/ui/block-info-card" | Parameter | Type | Description | | --------- | ---- | ----------- | -| `contact` | object | Contact object from contact operations | -| `properties` | number | Current page number | -| `id` | string | ID of the deleted item \(for delete operations\) | -| `type` | string | Type of the message | -| `role` | string | Role of the contact \(user or lead\) | -| `email` | string | Email address of the contact | -| `phone` | string | Phone number of the contact | -| `name` | string | Name of the company | -| `external_id` | string | External identifier for the contact | -| `created_at` | number | Unix timestamp when contact was created | -| `updated_at` | number | Unix timestamp when contact was last updated | +| `contact` | json | Contact object with id, type, role, email, phone, name, external_id, created_at, updated_at | | `contactId` | string | ID of the contact \(for create/update operations\) | | `contacts` | array | Array of contacts \(for list/search operations\) | -| `company` | object | Company object from company operations | -| `company_id` | string | Your unique identifier for the company | -| `website` | string | Company website URL | +| `company` | json | Company object with id, company_id, name, website | | `companyId` | string | ID of the company \(for create operations\) | | `companies` | array | Array of companies \(for list operations\) | -| `conversation` | object | Conversation object from conversation operations | -| `title` | string | Title of the conversation | -| `state` | string | State of the conversation | -| `open` | boolean | Whether the conversation is open | +| `conversation` | json | Conversation object with id, title, state, open | | `conversationId` | string | ID of the conversation \(for reply operations\) | | `conversations` | array | Array of conversations \(for list/search operations\) | -| `ticket` | object | Ticket object from ticket operations | -| `ticket_id` | string | Ticket ID | -| `ticket_state` | string | State of the ticket | +| `ticket` | json | Ticket object with id, ticket_id, ticket_state | | `ticketId` | string | ID of the ticket \(for create operations\) | -| `message` | object | Message object from message operations | +| `message` | json | Message object with id, type | | `messageId` | string | ID of the message \(for create operations\) | | `total_count` | number | Total count \(for list/search operations\) | -| `pages` | object | Pagination information | -| `page` | number | Current page number | -| `per_page` | number | Number of results per page | -| `total_pages` | number | Total number of pages | +| `pages` | json | Pagination info with page, per_page, total_pages | +| `id` | string | ID of the deleted item \(for delete operations\) | | `deleted` | boolean | Whether the item was deleted \(for delete operations\) | ### `intercom_get_ticket_v2` @@ -697,41 +431,22 @@ import { BlockInfoCard } from "@/components/ui/block-info-card" | Parameter | Type | Description | | --------- | ---- | ----------- | -| `contact` | object | Contact object from contact operations | -| `properties` | number | Current page number | -| `id` | string | ID of the deleted item \(for delete operations\) | -| `type` | string | Type of the message | -| `role` | string | Role of the contact \(user or lead\) | -| `email` | string | Email address of the contact | -| `phone` | string | Phone number of the contact | -| `name` | string | Name of the company | -| `external_id` | string | External identifier for the contact | -| `created_at` | number | Unix timestamp when contact was created | -| `updated_at` | number | Unix timestamp when contact was last updated | +| `contact` | json | Contact object with id, type, role, email, phone, name, external_id, created_at, updated_at | | `contactId` | string | ID of the contact \(for create/update operations\) | | `contacts` | array | Array of contacts \(for list/search operations\) | -| `company` | object | Company object from company operations | -| `company_id` | string | Your unique identifier for the company | -| `website` | string | Company website URL | +| `company` | json | Company object with id, company_id, name, website | | `companyId` | string | ID of the company \(for create operations\) | | `companies` | array | Array of companies \(for list operations\) | -| `conversation` | object | Conversation object from conversation operations | -| `title` | string | Title of the conversation | -| `state` | string | State of the conversation | -| `open` | boolean | Whether the conversation is open | +| `conversation` | json | Conversation object with id, title, state, open | | `conversationId` | string | ID of the conversation \(for reply operations\) | | `conversations` | array | Array of conversations \(for list/search operations\) | -| `ticket` | object | Ticket object from ticket operations | -| `ticket_id` | string | Ticket ID | -| `ticket_state` | string | State of the ticket | +| `ticket` | json | Ticket object with id, ticket_id, ticket_state | | `ticketId` | string | ID of the ticket \(for create operations\) | -| `message` | object | Message object from message operations | +| `message` | json | Message object with id, type | | `messageId` | string | ID of the message \(for create operations\) | | `total_count` | number | Total count \(for list/search operations\) | -| `pages` | object | Pagination information | -| `page` | number | Current page number | -| `per_page` | number | Number of results per page | -| `total_pages` | number | Total number of pages | +| `pages` | json | Pagination info with page, per_page, total_pages | +| `id` | string | ID of the deleted item \(for delete operations\) | | `deleted` | boolean | Whether the item was deleted \(for delete operations\) | ### `intercom_create_message_v2` @@ -745,41 +460,22 @@ import { BlockInfoCard } from "@/components/ui/block-info-card" | Parameter | Type | Description | | --------- | ---- | ----------- | -| `contact` | object | Contact object from contact operations | -| `properties` | number | Current page number | -| `id` | string | ID of the deleted item \(for delete operations\) | -| `type` | string | Type of the message | -| `role` | string | Role of the contact \(user or lead\) | -| `email` | string | Email address of the contact | -| `phone` | string | Phone number of the contact | -| `name` | string | Name of the company | -| `external_id` | string | External identifier for the contact | -| `created_at` | number | Unix timestamp when contact was created | -| `updated_at` | number | Unix timestamp when contact was last updated | +| `contact` | json | Contact object with id, type, role, email, phone, name, external_id, created_at, updated_at | | `contactId` | string | ID of the contact \(for create/update operations\) | | `contacts` | array | Array of contacts \(for list/search operations\) | -| `company` | object | Company object from company operations | -| `company_id` | string | Your unique identifier for the company | -| `website` | string | Company website URL | +| `company` | json | Company object with id, company_id, name, website | | `companyId` | string | ID of the company \(for create operations\) | | `companies` | array | Array of companies \(for list operations\) | -| `conversation` | object | Conversation object from conversation operations | -| `title` | string | Title of the conversation | -| `state` | string | State of the conversation | -| `open` | boolean | Whether the conversation is open | +| `conversation` | json | Conversation object with id, title, state, open | | `conversationId` | string | ID of the conversation \(for reply operations\) | | `conversations` | array | Array of conversations \(for list/search operations\) | -| `ticket` | object | Ticket object from ticket operations | -| `ticket_id` | string | Ticket ID | -| `ticket_state` | string | State of the ticket | +| `ticket` | json | Ticket object with id, ticket_id, ticket_state | | `ticketId` | string | ID of the ticket \(for create operations\) | -| `message` | object | Message object from message operations | +| `message` | json | Message object with id, type | | `messageId` | string | ID of the message \(for create operations\) | | `total_count` | number | Total count \(for list/search operations\) | -| `pages` | object | Pagination information | -| `page` | number | Current page number | -| `per_page` | number | Number of results per page | -| `total_pages` | number | Total number of pages | +| `pages` | json | Pagination info with page, per_page, total_pages | +| `id` | string | ID of the deleted item \(for delete operations\) | | `deleted` | boolean | Whether the item was deleted \(for delete operations\) | diff --git a/scripts/generate-docs.ts b/scripts/generate-docs.ts index b36f46cc57..4987f4bb37 100755 --- a/scripts/generate-docs.ts +++ b/scripts/generate-docs.ts @@ -75,39 +75,77 @@ async function generateIconMapping(): Promise> { for (const blockFile of blockFiles) { const fileContent = fs.readFileSync(blockFile, 'utf-8') - // Get ALL block configs from file (already filters hideFromToolbar: true) - const blockConfigs = extractAllBlockConfigs(fileContent) - for (const blockConfig of blockConfigs) { - if (!blockConfig?.type || !blockConfig.iconName) { - continue - } + // For icon mapping, we need ALL blocks including hidden ones + // because V2 blocks inherit icons from legacy blocks via spread + // First, extract the primary icon from the file (usually the legacy block's icon) + const primaryIcon = extractIconName(fileContent) - // Skip blocks that don't have documentation (same logic as generateBlockDoc) - if ( - blockConfig.type.includes('_trigger') || - blockConfig.type.includes('_webhook') || - blockConfig.type.includes('rss') - ) { - continue - } + // Find all block exports and their types + const exportRegex = /export\s+const\s+(\w+)Block\s*:\s*BlockConfig[^=]*=\s*\{/g + let match - if ( - (blockConfig.category === 'blocks' && - blockConfig.type !== 'memory' && - blockConfig.type !== 'knowledge') || - blockConfig.type === 'evaluator' || - blockConfig.type === 'number' || - blockConfig.type === 'webhook' || - blockConfig.type === 'schedule' || - blockConfig.type === 'mcp' || - blockConfig.type === 'generic_webhook' || - blockConfig.type === 'rss' - ) { - continue + while ((match = exportRegex.exec(fileContent)) !== null) { + const blockName = match[1] + const startIndex = match.index + match[0].length - 1 + + // Extract the block content + let braceCount = 1 + let endIndex = startIndex + 1 + + while (endIndex < fileContent.length && braceCount > 0) { + if (fileContent[endIndex] === '{') braceCount++ + else if (fileContent[endIndex] === '}') braceCount-- + endIndex++ } - iconMapping[blockConfig.type] = blockConfig.iconName + if (braceCount === 0) { + const blockContent = fileContent.substring(startIndex, endIndex) + + // Check hideFromToolbar - skip hidden blocks for docs but NOT for icon mapping + const hideFromToolbar = /hideFromToolbar\s*:\s*true/.test(blockContent) + + // Get block type + const blockType = + extractStringPropertyFromContent(blockContent, 'type') || blockName.toLowerCase() + + // Get icon - either from this block or inherited from primary + const iconName = extractIconNameFromContent(blockContent) || primaryIcon + + if (!blockType || !iconName) { + continue + } + + // Skip trigger/webhook/rss blocks + if ( + blockType.includes('_trigger') || + blockType.includes('_webhook') || + blockType.includes('rss') + ) { + continue + } + + // Get category for additional filtering + const category = extractStringPropertyFromContent(blockContent, 'category') || 'misc' + + if ( + (category === 'blocks' && blockType !== 'memory' && blockType !== 'knowledge') || + blockType === 'evaluator' || + blockType === 'number' || + blockType === 'webhook' || + blockType === 'schedule' || + blockType === 'mcp' || + blockType === 'generic_webhook' || + blockType === 'rss' + ) { + continue + } + + // Only add non-hidden blocks to icon mapping (docs won't be generated for hidden) + if (!hideFromToolbar) { + iconMapping[blockType] = iconName + } + } } }