<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/onboarding-agent-from-scratch-part-3-a-shape-the-model-can-t-break-xgxuqzfha" -->

---
title: Onboarding Agent from Scratch. Part 3: A Shape the Model...
description: Part 3 of a series building an onboarding agent from scratch focuses on enforcing structured output from an LLM using forced tool use rather than...
canonical: https://daily.dev/posts/onboarding-agent-from-scratch-part-3-a-shape-the-model-can-t-break-xgxuqzfha
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Onboarding Agent from Scratch. Part 3: A Shape the Model Can’t Break | daily.dev
og:description: Part 3 of a series building an onboarding agent from scratch focuses on enforcing structured output from an LLM using forced tool use rather than...
og:url: https://daily.dev/posts/onboarding-agent-from-scratch-part-3-a-shape-the-model-can-t-break-xgxuqzfha
og:image: https://api.daily.dev/og/posts/xgxUqZfHa.png
og:image:alt: Onboarding Agent from Scratch. Part 3: A Shape the Model Can’t Break
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Onboarding Agent from Scratch. Part 3: A Shape the Model Can’t Break

**[Medium](https://daily.dev/sources/medium_js)** · 5 min read · 0 upvotes · 0 comments

## Summary

Part 3 of a series building an onboarding agent from scratch focuses on enforcing structured output from an LLM using forced tool use rather than prompt-engineered JSON. The key insight is that asking a model to 'respond only with JSON' is a convention it can break, while registering a tool schema and setting tool_choice forces the API to always return a validated, parsed dict. The implementation adds a structured_qa.py script that returns a strict {answer, source, confidence} object for onboarding questions. A notable finding: claude-opus-4 doesn't accept a temperature parameter at all, so determinism comes from forced tool_choice rather than temperature=0. Verification confirmed the contract held across multiple runs, including correct handling of out-of-scope questions.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://medium.com/@spodsky/onboarding-agent-from-scratch-part-3-a-shape-the-model-cant-break-c566d88153af>

## Similar posts on daily.dev

- [Onboarding Agent from Scratch. Part 5: From Chatbot to Agent](https://daily.dev/posts/onboarding-agent-from-scratch-part-5-from-chatbot-to-agent-2zhnlvdly) · Medium · 2 upvotes · 0 comments
- [Your LLM Can Return Perfect JSON and Still Be Wrong](https://daily.dev/posts/your-llm-can-return-perfect-json-and-still-be-wrong-o3ogkexgv) · Towards Data Science · 1 upvotes · 0 comments
- [AI Agent Tool Design 2026: Schemas, Descriptions, And Pitfalls](https://daily.dev/posts/ai-agent-tool-design-2026-schemas-descriptions-and-pitfalls-uspdt00cj) · Alex CloudStar · 0 upvotes · 0 comments

---

Tags: [#ai-agents](https://daily.dev/tags/ai-agents), [#anthropic](https://daily.dev/tags/anthropic), [#llm](https://daily.dev/tags/llm)

[View this post on daily.dev](https://daily.dev/posts/onboarding-agent-from-scratch-part-3-a-shape-the-model-can-t-break-xgxuqzfha)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Onboarding Agent from Scratch. Part 3: A Shape the Model Can’t Break","url":"https://daily.dev/posts/onboarding-agent-from-scratch-part-3-a-shape-the-model-can-t-break-xgxuqzfha","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/onboarding-agent-from-scratch-part-3-a-shape-the-model-can-t-break-xgxuqzfha"},"datePublished":"2026-07-22T18:11:04.122Z","dateModified":"2026-10-15T02:22:14.960Z","description":"Part 3 of a series building an onboarding agent from scratch focuses on enforcing structured output from an LLM using forced tool use rather than...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/18cb78cbbbf2efa5657fe83f9840038a?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/18cb78cbbbf2efa5657fe83f9840038a?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Medium","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Medium","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/medium","url":"https://daily.dev/sources/medium_js"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/onboarding-agent-from-scratch-part-3-a-shape-the-model-can-t-break-xgxuqzfha","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"ai-agents,anthropic,llm","timeRequired":"PT5M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Medium","item":"https://daily.dev/sources/medium_js"},{"@type":"ListItem","position":3,"name":"Onboarding Agent from Scratch. Part 3: A Shape the Model Can’t Break"}]}
```

