@devries-cameron20 / composio-1 / commits / fe94fa0c0
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

feat: add response error and request union changelog

shreysingla11 committed Jan 7, 2026 at 15:59 UTC fe94fa0c0a5cb4589640d7fc1d83017f7fd3c59a
1 file changed +84
fern/pages/src/changelog/01-07-26.md new
+84
@@ -0,0 +1,84 @@
1 +# Consistent Error Response Structure
2 +
3 +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.
4 +
5 +## What Changed
6 +
7 +All error responses from tool execution now include:
8 +- `data.status_code`: HTTP status code (or `null` for non-HTTP errors)
9 +- `data.message`: Detailed error message
10 +- `error`: Same detailed message at the top level
11 +
12 +## Before vs After
13 +
14 +**Previous error response:**
15 +```json
16 +{
17 + "data": {},
18 + "successfull": false,
19 + "error": "404 Client Error: Not Found for url: ...",
20 +}
21 +```
22 +
23 +**New error response:**
24 +```json
25 +{
26 + "data": {
27 + "http_error": "404 Client Error: Not Found for url: ...",
28 + "status_code": 404,
29 + "message": "Resource not found: The requested item does not exist"
30 + },
31 + "successfull": false,
32 + "error": "Resource not found: The requested item does not exist",
33 +}
34 +```
35 +
36 +## Why This Matters
37 +
38 +- **Easier parsing**: Agents and code can reliably access error details from `data.message` without special-casing empty `data` objects
39 +- **Better debugging**: Detailed error messages replace generic HTTP error strings
40 +- **Consistent schema**: Same response shape whether the tool succeeds or fails
41 +
42 +---
43 +
44 +# Union Types Preserved in Schemas
45 +
46 +Tool request and response schemas now preserve `anyOf` (Union types) instead of flattening them to a single type.
47 +
48 +## What Changed
49 +
50 +Previously, when a field had multiple possible types (e.g., `string | number | null`), the schema parser would discard all but the first type. Now the full `anyOf` array is retained, giving you accurate type information.
51 +
52 +## Before vs After
53 +
54 +**Previous (flattened, losing type info):**
55 +```json
56 +{
57 + "properties": {
58 + "value": {
59 + "type": "string",
60 + "nullable": true
61 + }
62 + }
63 +}
64 +```
65 +
66 +**Now (Union types preserved):**
67 +```json
68 +{
69 + "properties": {
70 + "value": {
71 + "anyOf": [
72 + { "type": "string" },
73 + { "type": "integer" },
74 + { "type": "null" }
75 + ]
76 + }
77 + }
78 +}
79 +```
80 +
81 +## Why This Matters
82 +
83 +- **Accurate schemas**: LLMs and code generators see the full set of allowed types
84 +- **Better validation**: Input validation can now correctly accept all valid types, not just the first one
\ No newline at end of file