1
+---
2
+title: "Consistent Error Response Structure & Union Types Preserved"
3
+date: "2026-01-07"
4
+---
5
+
6
+## Consistent Error Response Structure
7
+
8
+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.
9
+
10
+### What Changed
11
+
12
+All error responses from tool execution now include:
13
+- `data.status_code`: HTTP status code (or `null` for non-HTTP errors)
14
+- `data.message`: Detailed error message
15
+- `error`: Same detailed message at the top level
16
+
17
+### Before vs After
18
+
19
+**Previous error response:**
20
+```json
21
+{
22
+ "data": {},
23
+ "successfull": false,
24
+ "error": "404 Client Error: Not Found for url: ...",
25
+}
26
+```
27
+
28
+**New error response:**
29
+```json
30
+{
31
+ "data": {
32
+ "http_error": "404 Client Error: Not Found for url: ...",
33
+ "status_code": 404,
34
+ "message": "Resource not found: The requested item does not exist"
35
+ },
36
+ "successfull": false,
37
+ "error": "Resource not found: The requested item does not exist",
38
+}
39
+```
40
+
41
+### Why This Matters
42
+
43
+- **Easier parsing**: Agents and code can reliably access error details from `data.message` without special-casing empty `data` objects
44
+- **Better debugging**: Detailed error messages replace generic HTTP error strings
45
+- **Consistent schema**: Same response shape whether the tool succeeds or fails
46
+
47
+---
48
+
49
+## Union Types Preserved in Tool Schemas
50
+
51
+Tool schemas now use standard JSON Schema `anyOf` for union types, providing accurate type information for LLMs and code generators.
52
+
53
+### What Changed
54
+
55
+Two changes affect how types appear in request/response schemas:
56
+
57
+| Change | Scope | Description |
58
+|--------|-------|-------------|
59
+| **Nullable fields** | **All toolkits** | Fields that accept `null` now use `anyOf: [{type}, {type: "null"}]` instead of `type` + `nullable: true` |
60
+| **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 |
61
+
62
+<Accordions>
63
+<Accordion title="Toolkits with multi-type union fields (157 total)">
64
+
65
+### CRM & Sales
66
+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
67
+
68
+### Marketing & Email
69
+active_trail, beamer, delighted, dripcel, enginemailer, mailerlite, moosend, mopinion, sendspark, toneden
70
+
71
+### Communication & Collaboration
72
+chmeetings, discord, helpdesk, helpwise, missive, slack, textit
73
+
74
+### Productivity & Project Management
75
+basecamp, clicksend, clientary, dart, fibery, monday, notion, onedesk, productboard, rocketlane, todoist
76
+
77
+### Developer Tools & APIs
78
+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
79
+
80
+### E-commerce & Payments
81
+brex, btcpay_server, coupa, flutterwave, gift_up, lemon_squeezy, quaderno, ramp, shopify, stripe, zoho_invoice
82
+
83
+### HR & Recruiting
84
+ashby, bamboohr, recruitee
85
+
86
+### Data & Analytics
87
+amplitude, census_bureau, college_football_data, currencyscoop, diffbot, ip2location, mixpanel, nasa, rosette_text_analytics, securitytrails, textrazor, twelve_data
88
+
89
+### Documents & Files
90
+carbone, doc_certs, documenso, dropbox, excel, files_com, grist, pdf_co, share_point
91
+
92
+### Design & Media
93
+canva, canvas, claid_ai, deepimage, heygen, metatextai
94
+
95
+### Customer Support
96
+freshdesk, retently, servicem8, sevdesk, storeganise
97
+
98
+### Calendar & Scheduling
99
+calendly, deadline_funnel, etermin, googlecalendar
100
+
101
+### Social Media
102
+facebook, instagram, reddit
103
+
104
+### Location & Maps
105
+addresszen, geoapify, google_maps, mapbox
106
+
107
+### Email Verification & Validation
108
+clearout, icypeas, neverbounce, zerobounce
109
+
110
+### Other Integrations
111
+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
112
+
113
+</Accordion>
114
+</Accordions>
115
+
116
+### Before vs After
117
+For example, the `GOOGLECALENDAR_GET_CURRENT_DATE_TIME` request schema changes:
118
+
119
+**Previous (only a single type):**
120
+```json
121
+{
122
+ "timezone": {
123
+ "default": 0,
124
+ "description": "Timezone specification...",
125
+ "title": "Timezone",
126
+ "type": "string"
127
+ }
128
+}
129
+```
130
+
131
+**Now (Union types preserved):**
132
+```json
133
+{
134
+ "timezone": {
135
+ "anyOf": [
136
+ { "type": "string" },
137
+ { "type": "number" }
138
+ ],
139
+ "default": 0,
140
+ "description": "Timezone specification...",
141
+ "title": "Timezone"
142
+ }
143
+}
144
+```
145
+
146
+Similarly, nullable fields like `page_token` in `GOOGLECALENDAR_LIST_CALENDARS`:
147
+
148
+**Previous:**
149
+```json
150
+{
151
+ "page_token": {
152
+ "default": null,
153
+ "description": "Token for the page of results to return...",
154
+ "nullable": true,
155
+ "title": "Page Token",
156
+ "type": "string"
157
+ }
158
+}
159
+```
160
+
161
+**Now:**
162
+```json
163
+{
164
+ "page_token": {
165
+ "anyOf": [
166
+ { "type": "string" },
167
+ { "type": "null" }
168
+ ],
169
+ "default": null,
170
+ "description": "Token for the page of results to return...",
171
+ "title": "Page Token"
172
+ }
173
+}
174
+```
175
+
176
+### Why This Matters
177
+
178
+- **Accurate schemas**: LLMs and code generators see the full set of allowed types
179
+- **Better validation**: Input validation can now correctly accept all valid types, not just the first one