Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Mirrored from https://github.com/Camo67/composio.git
Synced Nov 21, 03:37 UTC
| 1 | --- |
| 2 | title: "Consistent Error Response Structure" |
| 3 | description: "Tool execution errors now return standardized response format with status_code and message fields" |
| 4 | date: "2026-01-07" |
| 5 | --- |
| 6 | |
| 7 | Tool execution errors now return a standardized response format across all failure types. Previously, the `data` field was empty on errors—now it always includes `status_code` and `message`, matching the structure of successful responses. |
| 8 | |
| 9 | ## What Changed |
| 10 | |
| 11 | All error responses from tool execution now include: |
| 12 | - `data.status_code`: HTTP status code (or `null` for non-HTTP errors) |
| 13 | - `data.message`: Detailed error message |
| 14 | - `error`: Same detailed message at the top level |
| 15 | |
| 16 | ## Before vs After |
| 17 | |
| 18 | **Previous error response:** |
| 19 | ```json |
| 20 | { |
| 21 | "data": {}, |
| 22 | "successfull": false, |
| 23 | "error": "404 Client Error: Not Found for url: ...", |
| 24 | } |
| 25 | ``` |
| 26 | |
| 27 | **New error response:** |
| 28 | ```json |
| 29 | { |
| 30 | "data": { |
| 31 | "http_error": "404 Client Error: Not Found for url: ...", |
| 32 | "status_code": 404, |
| 33 | "message": "Resource not found: The requested item does not exist" |
| 34 | }, |
| 35 | "successfull": false, |
| 36 | "error": "Resource not found: The requested item does not exist", |
| 37 | } |
| 38 | ``` |
| 39 | |
| 40 | ## Why This Matters |
| 41 | |
| 42 | - **Easier parsing**: Agents and code can reliably access error details from `data.message` without special-casing empty `data` objects |
| 43 | - **Better debugging**: Detailed error messages replace generic HTTP error strings |
| 44 | - **Consistent schema**: Same response shape whether the tool succeeds or fails |
| 45 | |
| 46 | --- |
| 47 | |
| 48 | ## Union Types Preserved in Tool Schemas |
| 49 | |
| 50 | Tool schemas now use standard JSON Schema `anyOf` for union types, providing accurate type information for LLMs and code generators. |
| 51 | |
| 52 | ## What Changed |
| 53 | |
| 54 | Two changes affect how types appear in request/response schemas: |
| 55 | |
| 56 | | Change | Scope | Description | |
| 57 | |--------|-------|-------------| |
| 58 | | **Nullable fields** | **All toolkits** | Fields that accept `null` now use `anyOf: [{type}, {type: "null"}]` instead of `type` + `nullable: true` | |
| 59 | | **Multi-type fields** | 157 toolkits | Fields accepting multiple value types (e.g., `string \| number`) preserve the full `anyOf` array instead of flattening to the first type | |
| 60 | |
| 61 | <Accordions> |
| 62 | <Accordion title="Toolkits with multi-type union fields (157 total)"> |
| 63 | |
| 64 | **CRM & Sales:** active_campaign, apollo, attio, autobound, capsule_crm, firmao, forcemanager, gong, hubspot, instantly, intercom, kommo, leadfeeder, lever, magnetic, pipedrive, pipeline_crm, salesforce, salesforce_service_cloud, zoominfo |
| 65 | |
| 66 | **Marketing & Email:** active_trail, beamer, delighted, dripcel, enginemailer, mailerlite, moosend, mopinion, sendspark, toneden |
| 67 | |
| 68 | **Communication & Collaboration:** chmeetings, discord, helpdesk, helpwise, missive, slack, textit |
| 69 | |
| 70 | **Productivity & Project Management:** basecamp, clicksend, clientary, dart, fibery, monday, notion, onedesk, productboard, rocketlane, todoist |
| 71 | |
| 72 | **Developer Tools & APIs:** algolia, anonyflow, api_ninjas, api_sports, apify, appdrag, backendless, browserless, bubble, cloudconvert, cloudinary, cloudlayer, convertapi, databricks, datadog, datarobot, deepseek, deployhq, digital_ocean, docmosis, docugenerate, encodian, gitea, gitlab, globalping, groqcloud, hookdeck, hyperbrowser, imgbb, imgix, kibana, neutrino, npm, openai, openrouter, parsera, parseur, phantombuster, pinecone, prismic, procfu, replicate, scrape_do, serpapi, shotstack, snowflake, supabase, tavily, v0, vercel, writer, zenrows |
| 73 | |
| 74 | **E-commerce & Payments:** brex, btcpay_server, coupa, flutterwave, gift_up, lemon_squeezy, quaderno, ramp, shopify, stripe, zoho_invoice |
| 75 | |
| 76 | **HR & Recruiting:** ashby, bamboohr, recruitee |
| 77 | |
| 78 | **Data & Analytics:** amplitude, census_bureau, college_football_data, currencyscoop, diffbot, ip2location, mixpanel, nasa, rosette_text_analytics, securitytrails, textrazor, twelve_data |
| 79 | |
| 80 | **Documents & Files:** carbone, doc_certs, documenso, dropbox, excel, files_com, grist, pdf_co, share_point |
| 81 | |
| 82 | **Design & Media:** canva, canvas, claid_ai, deepimage, heygen, metatextai |
| 83 | |
| 84 | **Customer Support:** freshdesk, retently, servicem8, sevdesk, storeganise |
| 85 | |
| 86 | **Calendar & Scheduling:** calendly, deadline_funnel, etermin, googlecalendar |
| 87 | |
| 88 | **Social Media:** facebook, instagram, reddit |
| 89 | |
| 90 | **Location & Maps:** addresszen, geoapify, google_maps, mapbox |
| 91 | |
| 92 | **Email Verification & Validation:** clearout, icypeas, neverbounce, zerobounce |
| 93 | |
| 94 | **Other Integrations:** bitwarden, canny, cardly, castingwords, confluence, formdesk, getform, habitica, headout, highergov, jira, keen_io, landbot, moonclerk, one_drive, outlook, googlesheets, resend, ritekit, sms_alert, tapfiliate, thanks_io, uptimerobot |
| 95 | |
| 96 | </Accordion> |
| 97 | </Accordions> |
| 98 | |
| 99 | ## Before vs After |
| 100 | For example, the `GOOGLECALENDAR_GET_CURRENT_DATE_TIME` request schema changes: |
| 101 | **Previous (only a single type):** |
| 102 | ```json |
| 103 | { |
| 104 | "timezone": { |
| 105 | "default": 0, |
| 106 | "description": "Timezone specification...", |
| 107 | "title": "Timezone", |
| 108 | "type": "string" |
| 109 | } |
| 110 | } |
| 111 | ``` |
| 112 | |
| 113 | **Now (Union types preserved):** |
| 114 | ```json |
| 115 | { |
| 116 | "timezone": { |
| 117 | "anyOf": [ |
| 118 | { "type": "string" }, |
| 119 | { "type": "number" } |
| 120 | ], |
| 121 | "default": 0, |
| 122 | "description": "Timezone specification...", |
| 123 | "title": "Timezone" |
| 124 | } |
| 125 | } |
| 126 | ``` |
| 127 | |
| 128 | Similarly, nullable fields like `page_token` in `GOOGLECALENDAR_LIST_CALENDARS`: |
| 129 | |
| 130 | **Previous:** |
| 131 | ```json |
| 132 | { |
| 133 | "page_token": { |
| 134 | "default": null, |
| 135 | "description": "Token for the page of results to return...", |
| 136 | "nullable": true, |
| 137 | "title": "Page Token", |
| 138 | "type": "string" |
| 139 | } |
| 140 | } |
| 141 | ``` |
| 142 | |
| 143 | **Now:** |
| 144 | ```json |
| 145 | { |
| 146 | "page_token": { |
| 147 | "anyOf": [ |
| 148 | { "type": "string" }, |
| 149 | { "type": "null" } |
| 150 | ], |
| 151 | "default": null, |
| 152 | "description": "Token for the page of results to return...", |
| 153 | "title": "Page Token" |
| 154 | } |
| 155 | } |
| 156 | ``` |
| 157 | |
| 158 | ## Why This Matters |
| 159 | |
| 160 | - **Accurate schemas**: LLMs and code generators see the full set of allowed types |
| 161 | - **Better validation**: Input validation can now correctly accept all valid types, not just the first one |