What is your goal?
I’m calling the Anthropic Claude API via Make’s HTTP module. I need to pass an array of objects (about 5 Google Places API candidates) into the Claude API’s user message content as part of the prompt text.
The Anthropic Messages API only accepts these top-level fields: model, max_tokens, tools, tool_choice, messages, system. The candidates have to live inside messages[1].content as text, not as a separate top-level field.
I need the user message content to look like this when sent to Claude:
Here is intake data and a list of candidates: [{“place_id”:“abc”,“name”:“Hill”,“formatted_address”:“804 Nicholas Pkwy”},{“place_id”:“def”,“name”:“Cape Coral Tax”}]
Pick the matching candidate.
What is the correct Make pattern to serialize an array of collections (from an Array Aggregator) into a clean JSON string that can be embedded inside another module’s text field?
What is the problem & what have you tried?
My scenario flow:
- HTTP module calls Google Places API findplacefromtext, returns a candidates array of collections
- Iterator module walks each candidate
- Array Aggregator combines them back into an array with fields: place_id, name, formatted_address, rating
- JSON > Create JSON module builds the Claude API request body
- HTTP module sends the body to https://api.anthropic.com/v1/messages
Approaches I’ve tried:
-
Using toString(aggregator.array) inside the content string — returns literal text “[{object},{object},{object}]” with no actual data, just the word “object” repeated.
-
Adding “candidates” as a separate top-level field in the JSON Create module — Anthropic API rejects with error: “candidates: Extra inputs are not permitted”
-
Using {{json(55.array)}} — error: “Function ‘json’ not found”
-
Referencing the aggregator array directly inside the content string — produces invalid JSON, Claude API rejects the body.
I’m running in Make Cloud (not Workfront Fusion). I need the production-quality pattern, not a workaround.
Error messages or input/output bundles
Error from Claude API when candidates is a top-level field:
{“type”:“error”,“error”:{“type”:“invalid_request_error”,“message”:“candidates: Extra inputs are not permitted”}}
Error from Make when using {{json(55.array)}}:
Failed to map ‘0.content’: Function ‘json’ not found!
Error from toString approach — the body sent to Claude:
“content”: “…PLACES API CANDIDATES (JSON):\n[{object},{object},{object},{object},{object}]\n…”
