The three input mistakes models make repeatedly, and how the runtime repairs them.
The schema a model is handed is generated by the contract, not the one you wrote
— so it can accept forms the wire never will. Three mistakes models make
reliably are absorbed at the boundary instead of coming back as a failed call.There is a fourth mistake that is deliberately not absorbed, and it is the
last section on this page: an argument the schema does not declare is refused
rather than dropped.
Models sometimes serialize a nested object as a JSON string instead of passing
it as an object. A model_validator(mode="before") finds any
BaseModel/list/dict-typed field whose value is a string starting with {
or [, and parses it before field validation runs.
Models send camelCase keys inside nested objects, matching the API’s own docs. A
schema that answered only to its own field names would drop the key as unknown:
the field stays None, the API receives {}, and returns a confusing 400 with
no local validation error at all.So the contract answers to all three spellings. Every field carries camelCase,
PascalCase and snake_case aliases — dateTime, DateTime and date_time are
all valid input — and this holds whichever convention the schema’s author wrote
in. Stripe’s schemas are snake_case and Gmail’s are camelCase; both resolve in
both directions.All three are declared aliases rather than merely tolerated ones, which is
what makes the refusal in the next section safe: with unknown keys refused, a
spelling that is only “also allowed” would become an error.model_dump() is unaffected — it still returns snake_case field names, so the
key-case conversion at serialization time works exactly as before.
An argument the schema does not declare is refused
Pydantic’s default is to ignore unknown keys. At a tool boundary that is the
worst available behaviour, because the result is not an error — it is a wrong
answer that nothing marks as wrong.A model that invents a filter, or mistypes a real one, previously got a
successful call and an unfiltered page:
# `created` is not a field on this tool.await stripe.customers_list.ainvoke({"limit": 2, "created": {"gt": 1704067200}})
That sent limit=2, returned two arbitrary customers, and said nothing
anywhere about the filter it had thrown away. The agent then reasons over rows
it believes were filtered. The same happens for a plausible typo — emails for
email — which is the more likely mistake of the two.So generated schemas set extra="forbid", and the call above raises
ToolValidationError before the
network:
Validation error:- **created**: Extra inputs are not permitted
which is a message a model can read and correct, in the
retry loop this library already has.
to_json_schema() carries additionalProperties: false for the same reason, on
the root and on every nested object — so a provider enforcing strict schemas
mostly prevents the mistake before a call is made at all.
This tightened in a way a host application can notice. If you were passing an
extra key to ainvoke and relying on it being ignored, that call now raises.
The fix is to remove the key, or to declare it on the schema if it should have
been on the wire. Per-call headers are unaffected: they are a keyword-only
argument, not part of the schema, and never were.
Left to the agent framework, a rejected call comes back wrapped in that
framework’s own template, with the entire kwargs payload dumped at the model:
Error invoking tool 'documents_update' with kwargs {'document_id': '...', 'body': '...'}with error: body: Input should be a valid dictionary ... Please fix the error and try again.
When the JSON-string coercion above fails, the naive behaviour is to pass the
string through and let type checking complain:
Validation error:- **body**: Input should be a valid dictionary or instance of BatchUpdateRequestBody_LLM
That is a type error. The model concludes it sent the wrong structure, retries
with different content and the same broken syntax, and loops forever — because
the real problem was a syntax error, such as one extra closing brace.Charter raises with the decoder’s own detail:
Validation error:- **(input)**: 'body' looks like JSON but is malformed — fix the syntax and retry. Detail: Expecting ',' delimiter: line 1 column 105
Now the model knows it is a syntax problem and where. The check is unambiguous: a
string starting with { or [ for a BaseModel/list/dict-typed field is
always an attempted JSON serialization — there is no other case.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Charter Docs","description":"Charter is an open-source Python library for agents that act in your customers' accounts through APIs. Every call is checked field by field before it's sent, and your app says whose account it is for.","colors":{"primary":"#C72C41","light":"#E8586B","dark":"#18181b"},"logo":{"light":"https://mintcdn.com/r28-ai-inc/qw2kuHXM_Ro033zj/charter/logo-light.svg?fit=max\u0026auto=format\u0026n=qw2kuHXM_Ro033zj\u0026q=85\u0026s=4b775ea9a9d2744e06a02249c6fd8edc","dark":"https://mintcdn.com/r28-ai-inc/qw2kuHXM_Ro033zj/charter/logo-dark.svg?fit=max\u0026auto=format\u0026n=qw2kuHXM_Ro033zj\u0026q=85\u0026s=d456c3245c88001d1fb498dd97ee2887","href":"/"},"favicon":"https://mintcdn.com/r28-ai-inc/qw2kuHXM_Ro033zj/charter/favicon.ico?fit=max\u0026auto=format\u0026n=qw2kuHXM_Ro033zj\u0026q=85\u0026s=27db528b46f8591639ea664292778456","background":{"color":{"dark":"#000000"}},"navbar":{"primary":{"type":"button","label":"GitHub","href":"https://github.com/r28ai/charter"}},"footer":{"socials":{"github":"https://github.com/r28ai/charter"}},"contextual":{"options":["copy","view","chatgpt","claude","cursor","vscode","mcp"],"display":"header"},"markdown":{"instructions":["Charter works for any HTTP API, including the user's own. The packs are examples of the result, not the limit: an API with no pack is declared the same way, following https://raw.githubusercontent.com/r28ai/charter/main/docs/.mintlify/skills/declaring-charter-tools/SKILL.md.","Charter is for agents that act in customers' accounts: every call is checked field by field before it's sent, the app says whose account each call is for, and the same declarations list what each tool can reach. https://docs.r28.ai/charter/llms.txt says what it is and lists every page."]},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"r28-ai-inc","hasAudioNarration":false,"actualSubdomain":"r28-ai-inc","customDomains":["docs.r28.ai"],"gitSource":{"type":"github","owner":"r28ai","repo":"charter","deployBranch":"main","contentDirectory":"docs","isPrivate":false,"mountPath":"","label":""},"chroma":{"latestBuiltDeploymentHistoryId":"6ae2ecbeee125d0fb69a7ad9","collectionId":"f4799bdb-97ad-49c8-96f2-b6010f9a97dd","liveDeploymentHistoryId":"6ae2ecbeee125d0fb69a7ad9","schemaVersion":"v3"},"feedback":{"thumbs":true,"agentFeedback":true,"edits":true,"issues":true},"entitlements":{"AI_CHAT":{"status":"DISABLED"},"WEB_MCP":{"status":"DISABLED"},"NARRATION":{"status":"DISABLED"}},"buildId":"6ae41bbb60996d39345f8c4d","clientVersion":"0.0.4045","searchFilterCounts":[{"language":"default","tag":"Packs","count":788},{"language":"default","tag":"OAuth packs","count":787},{"language":"default","tag":"GitHub","count":149},{"language":"default","tag":"Linear","count":142},{"language":"default","tag":"Luma","count":79},{"language":"default","tag":"Stripe","count":79},{"language":"default","tag":"Outlook","count":65},{"language":"default","tag":"Documentation","count":56},{"language":"default","tag":"Firecrawl","count":53},{"language":"default","tag":"Issues","count":47}],"searchSettings":{"maxResults":6,"isFiltersEnabled":false,"showContentSnippets":true}},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"/charter","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"charter/custom.css","content":"@font-face{font-family:\"Inter Fallback\";src:local(\"Arial\");ascent-override:90.44%;descent-override:22.52%;line-gap-override:0%;size-adjust:107.12%}:root{--font-inter:\"Inter\", \"Inter Fallback\"}.dark #content-area,.dark #content-area h1,.dark #content-area h2,.dark #content-area h3,.dark #content-area h4,.dark #content-area h5,.dark #content-area h6,.dark #content-area li,.dark #content-area p,.dark #content-area td,.dark #content-area th{color:#fff!important}nav#sidebar a[style*=padding-left],nav#sidebar button[style*=padding-left]{border-radius:6px!important;color:rgba(24,24,27,.78)!important;text-shadow:none!important}nav#sidebar a[style*=padding-left]:hover,nav#sidebar button[style*=padding-left]:hover{background-color:rgba(0,0,0,.05)!important;color:#18181b!important}nav#sidebar a[class*=bg-primary],nav#sidebar button[class*=bg-primary]{background-color:rgba(0,0,0,.075)!important;color:#18181b!important;font-weight:500!important}.dark nav#sidebar a[style*=padding-left],.dark nav#sidebar button[style*=padding-left]{color:rgba(255,255,255,.88)!important}.dark nav#sidebar a[style*=padding-left]:hover,.dark nav#sidebar button[style*=padding-left]:hover{background-color:rgba(255,255,255,.08)!important;color:#fff!important}.dark nav#sidebar a[class*=bg-primary],.dark nav#sidebar button[class*=bg-primary]{background-color:rgba(255,255,255,.13)!important;color:#fff!important}nav#sidebar .sidebar-group-header{font-weight:400!important;color:rgba(24,24,27,.55)!important}.dark #table-of-contents nav>h2 button,.dark nav#sidebar .sidebar-group-header{color:rgba(255,255,255,.45)!important}#header .eyebrow{display:none!important}body:has(#navigation-items a[href*=\"/packs/\"]) #header .eyebrow{display:block!important;visibility:hidden;height:auto!important;min-height:20px;font-weight:400!important;color:rgba(24,24,27,.5)!important}body:has(#navigation-items a[href*=\"/packs/\"]) #header .eyebrow.breadcrumb-trail{visibility:visible}#header .eyebrow .breadcrumb-current{color:#18181b}#header .eyebrow .breadcrumb-separator{margin:0 7px;color:rgba(24,24,27,.28)}.dark body:has(#navigation-items a[href*=\"/packs/\"]) #header .eyebrow{color:rgba(255,255,255,.55)!important}.dark #header .eyebrow .breadcrumb-current{color:rgba(255,255,255,.92)}.dark #header .eyebrow .breadcrumb-separator{color:rgba(255,255,255,.3)}body:has(.nav-tabs a[data-active=true]:not([href*=\"/packs\"]):not([href*=\"/reference\"])) #header>div[class~=text-lg]{display:none!important}body:has(#navigation-items a[href*=\"/packs/\"]) #header .eyebrow+div{margin-top:24px!important}#content-area>#content{margin-bottom:24px!important}#page-context-menu>button{border-color:rgba(0,0,0,.14)!important}#page-context-menu>button:first-of-type{border-radius:6px 0 0 6px!important}#page-context-menu>button:last-of-type{border-radius:0 6px 6px 0!important}[role=menu]{border-radius:6px!important;border-color:rgba(0,0,0,.14)!important}[role=menu] [role=menuitem]{border-radius:4px!important}.dark #page-context-menu>button,.dark [role=menu]{border-color:rgba(255,255,255,.18)!important}#page-context-menu>button:first-of-type:has(.copy-page-icon)>div>svg{display:none!important}.copy-page-icon{display:block;flex:none;width:16px;height:16px}.copy-page-icon svg{position:absolute;inset:0;transition:opacity 200ms ease,transform 200ms ease}#page-context-menu>button[data-copy-state=copied] .copy-page-glyph,.copy-page-icon .copy-page-glyph-done{opacity:0;transform:scale(.75)}#page-context-menu>button[data-copy-state=copied] .copy-page-glyph-done{opacity:1;transform:scale(1)}.dark #page-context-menu>button,.dark #page-context-menu>button svg{color:#fff!important}#navigation-items>*+*,#table-of-contents ul.toc,.copy-page-icon{position:relative}#navigation-items>*+::before{content:\"\";position:absolute;top:-1rem;left:0;right:0;height:1px;background-color:rgba(0,0,0,.09)}.dark #navigation-items>*+::before{background-color:rgba(255,255,255,.11)}.pack-grid img[src*=\"/images/logos/\"]{width:28px!important;height:28px!important}.pack-summary{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:28px}.pack-summary span{display:inline-flex;align-items:center;gap:6px;border:1px solid rgba(0,0,0,.11);border-radius:999px;padding:3px 12px 3px 10px;font-size:13px;line-height:20px;white-space:nowrap}.dark .pack-summary span{border-color:rgba(255,255,255,.16)}.pack-summary svg{width:14px;height:14px;flex:none;fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round;opacity:.7}.tool-list{margin:0 0 28px}.tool-row{display:block;padding:13px 2px;border:0;text-decoration:none!important;color:inherit}.tool-row+.tool-row{border-top:1px solid rgba(0,0,0,.09)}.dark .tool-row+.tool-row{border-top-color:rgba(255,255,255,.11)}.tool-row-head{display:flex;align-items:center;gap:9px}.tool-row-name{font-family:paperMono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace;font-size:14px;font-weight:500;letter-spacing:-.01em}.tool-row:hover .tool-row-name{color:#c72c41}.dark .tool-row:hover .tool-row-name{color:#e8586b}.tool-row-desc{display:block;margin-top:3px;font-size:14px;line-height:1.5;color:#52525b}.dark .tool-row-desc{color:rgba(255,255,255,.62)}.tool-row-method{flex:none;padding:2px 5px;border-radius:5px;font-size:9.5px;font-weight:700;line-height:1.35;letter-spacing:.02em}.tool-row-method[data-method=GET]{background-color:rgba(74,222,128,.2);color:#15803d}.dark .tool-row-method[data-method=GET]{color:#4ade80}.tool-row-method[data-method=POST]{background-color:rgba(96,165,250,.2);color:#1d4ed8}.dark .tool-row-method[data-method=POST]{color:#60a5fa}.tool-row-method[data-method=PATCH],.tool-row-method[data-method=PUT]{background-color:rgba(251,146,60,.2);color:#c2410c}.dark .tool-row-method[data-method=PATCH],.dark .tool-row-method[data-method=PUT]{color:#fb923c}.tool-row-method[data-method=DELETE]{background-color:rgba(248,113,113,.2);color:#b91c1c}.dark .tool-row-method[data-method=DELETE]{color:#f87171}.dark .pack-grid img[src*=\"/images/logos/github.svg\"],.dark .pack-grid img[src*=\"/images/logos/notion.svg\"],.dark .pack-grid img[src*=\"/images/logos/tavily.svg\"]{filter:invert(1)}#content-area a.link:not(:has(code)){text-decoration-line:underline;text-decoration-thickness:1px;text-decoration-color:rgba(199,44,65,.55);text-underline-offset:3px}#content-area a.link:not(:has(code)):hover{text-decoration-color:#c72c41}.dark #content-area a.link:not(:has(code)){text-decoration-color:rgba(232,88,107,.6)}.dark #content-area a.link:not(:has(code)):hover{text-decoration-color:#e8586b}#content-area :not(pre)>code{background-color:#ededee!important;color:#3f3f46!important}.dark #content-area :not(pre)>code{background-color:rgba(255,255,255,.12)!important;color:rgba(255,255,255,.74)!important}#content-area a.link:has(>code){text-decoration-line:underline;text-decoration-thickness:1px;text-decoration-color:rgba(199,44,65,.45);text-underline-offset:3px}#content-area a.link>code{background-color:rgba(199,44,65,.11)!important;color:#c72c41!important}#content-area a.link:has(>code):hover{text-decoration-color:#c72c41}#content-area a.link:has(>code):hover>code{background-color:rgba(199,44,65,.18)!important}.dark #content-area a.link:has(>code){text-decoration-color:rgba(232,88,107,.5)}.dark #content-area a.link>code{background-color:rgba(232,88,107,.15)!important;color:#e8586b!important}.dark #content-area a.link:has(>code):hover{text-decoration-color:#e8586b}.dark #content-area a.link:has(>code):hover>code{background-color:rgba(232,88,107,.24)!important}#navbar-transition{border-bottom-color:rgba(0,0,0,.09)!important}.dark #navbar-transition{border-bottom-color:rgba(255,255,255,.11)!important}.dark header .nav-tabs a:not([class*=text-primary]),.dark header [class*=navbar] a{color:#fff!important}#topbar-cta-button a>span.absolute{border-radius:6px!important}#topbar-cta-button a:hover>span.absolute{background-color:#000!important;opacity:1!important}#topbar-cta-button a span:not(.absolute),#topbar-cta-button a>div{color:#fff!important}.dark #topbar-cta-button a>span.absolute{background-color:#fff!important}.dark #topbar-cta-button a:hover>span.absolute{background-color:rgba(255,255,255,.86)!important;opacity:1!important}.dark #topbar-cta-button a span:not(.absolute),.dark #topbar-cta-button a>div{color:#18181b!important}#topbar-cta-button a svg,[data-assistant-bar]{display:none!important}#topbar-cta-button a{height:32px;padding:0 10px!important}#topbar-cta-button a>div{gap:6px!important}#topbar-cta-button a>div::before{content:\"\";flex:none;width:15px;height:15px;background-color:currentColor;-webkit-mask:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20d%3D%22M12%20.297c-6.63%200-12%205.373-12%2012%200%205.303%203.438%209.8%208.205%2011.385.6.113.82-.258.82-.577%200-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422%2018.07%203.633%2017.7%203.633%2017.7c-1.087-.744.084-.729.084-.729%201.205.084%201.838%201.236%201.838%201.236%201.07%201.835%202.809%201.305%203.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93%200-1.31.465-2.38%201.235-3.22-.135-.303-.54-1.523.105-3.176%200%200%201.005-.322%203.3%201.23.96-.267%201.98-.399%203-.405%201.02.006%202.04.138%203%20.405%202.28-1.552%203.285-1.23%203.285-1.23.645%201.653.24%202.873.12%203.176.765.84%201.23%201.91%201.23%203.22%200%204.61-2.805%205.625-5.475%205.92.42.36.81%201.096.81%202.22%200%201.606-.015%202.896-.015%203.286%200%20.315.21.69.825.57C20.565%2022.092%2024%2017.592%2024%2012.297c0-6.627-5.373-12-12-12%22%2F%3E%3C%2Fsvg%3E) center/contain no-repeat;mask:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20d%3D%22M12%20.297c-6.63%200-12%205.373-12%2012%200%205.303%203.438%209.8%208.205%2011.385.6.113.82-.258.82-.577%200-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422%2018.07%203.633%2017.7%203.633%2017.7c-1.087-.744.084-.729.084-.729%201.205.084%201.838%201.236%201.838%201.236%201.07%201.835%202.809%201.305%203.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93%200-1.31.465-2.38%201.235-3.22-.135-.303-.54-1.523.105-3.176%200%200%201.005-.322%203.3%201.23.96-.267%201.98-.399%203-.405%201.02.006%202.04.138%203%20.405%202.28-1.552%203.285-1.23%203.285-1.23.645%201.653.24%202.873.12%203.176.765.84%201.23%201.91%201.23%203.22%200%204.61-2.805%205.625-5.475%205.92.42.36.81%201.096.81%202.22%200%201.606-.015%202.896-.015%203.286%200%20.315.21.69.825.57C20.565%2022.092%2024%2017.592%2024%2012.297c0-6.627-5.373-12-12-12%22%2F%3E%3C%2Fsvg%3E) center/contain no-repeat}@media (min-width:1024px){div:has(>#table-of-contents),div:has(>div>#table-of-contents){display:flex!important}div:has(>div>#table-of-contents){flex-direction:column}}@media (min-width:1024px) and (max-width:1279.98px){div:has(>div>div>#table-of-contents){gap:32px!important}div:has(>#table-of-contents){width:15rem!important;padding-left:0!important}#table-of-contents{width:100%!important}}#table-of-contents nav>h2{padding-bottom:8px}#table-of-contents nav>h2 button{pointer-events:none;cursor:default;font-size:13px!important;font-weight:400!important;line-height:20px!important;color:rgba(24,24,27,.55)!important}#table-of-contents nav>h2 button>svg{display:none}#table-of-contents nav>h2 button>span{margin-left:0!important}#table-of-contents ul.toc::before{content:\"\";position:absolute;left:0;top:0;bottom:0;width:1px;background-color:rgba(24,24,27,.12)}#table-of-contents li.toc-item>a{position:relative;padding-left:calc(var(--toc-padding-left) + var(--toc-focus-padding, 0rem) + 1rem)!important;color:rgba(24,24,27,.6)!important;text-shadow:none!important}#table-of-contents li.toc-item[data-active]>a::before{content:\"\";position:absolute;left:0;top:4px;bottom:4px;width:1px;background-color:#18181b}#table-of-contents li.toc-item:has(li[data-active])>a::before{display:none}.dark #table-of-contents ul.toc::before{background-color:rgba(255,255,255,.14)}.dark #table-of-contents li.toc-item[data-active]>a::before{background-color:rgba(255,255,255,.92)}#table-of-contents li.toc-item>a:hover,#table-of-contents li.toc-item[data-active]>a{color:#18181b!important}#table-of-contents li.toc-item[data-active]>a{font-weight:500!important}#table-of-contents li.toc-item:has(li[data-active])>a:not(:hover){color:rgba(24,24,27,.6)!important}.dark #table-of-contents li.toc-item>a{color:rgba(255,255,255,.6)!important}.dark #table-of-contents li.toc-item>a:hover,.dark #table-of-contents li.toc-item[data-active]>a{color:rgba(255,255,255,.95)!important}.dark #table-of-contents li.toc-item:has(li[data-active])>a:not(:hover){color:rgba(255,255,255,.6)!important}:root{--code-bg:#ffffff;--code-header-bg:#f7f8fa;--code-line:#e4e7ec;--code-chrome-fg:#616a78;--code-chrome-fg-strong:#1a1d23;--code-mark-bg:rgba(37, 99, 235, 0.09);--code-mark-rule:#2563eb;--tok-plain:#1a1d23;--tok-punct:#8a94a6;--tok-comment:#8a94a6;--tok-keyword:#d6006e;--tok-fn:#7a3dd8;--tok-string:#0b8a4b;--tok-number:#b25e00;--tok-type:#0969da;--tok-prop:#0e7490}html.dark{--code-bg:#0b0c0e;--code-header-bg:#131417;--code-line:#24262b;--code-chrome-fg:#98a1af;--code-chrome-fg-strong:#ffffff;--code-mark-bg:rgba(56, 120, 255, 0.2);--code-mark-rule:#4d8dff;--tok-plain:#e6e9ef;--tok-punct:#8a94a6;--tok-comment:#7c8898;--tok-keyword:#ff7eb6;--tok-fn:#c792ea;--tok-string:#4ade80;--tok-number:#f5b85c;--tok-type:#6fc3ff;--tok-prop:#5fd3c4}#content-area .shiki span[style*=\"#4FC1FF\"i],#content-area .shiki span[style*=\"#D4D4D4\"i],#content-area pre.shiki{color:var(--tok-plain)!important}#content-area .shiki span.tok-punct{color:var(--tok-punct)!important}#content-area .shiki span[style*=\"#6A9955\"i]{color:var(--tok-comment)!important}#content-area .shiki span[style*=\"#C586C0\"i]{color:var(--tok-keyword)!important}#content-area .shiki span[style*=\"#CE9178\"i]{color:var(--tok-string)!important}#content-area .shiki span[style*=\"#B5CEA8\"i],#content-area .shiki span[style*=\"#D7BA7D\"i]{color:var(--tok-number)!important}#content-area .shiki span[style*=\"#4EC9B0\"i]{color:var(--tok-type)!important}#content-area .shiki span[style*=\"#DCDCAA\"i]{color:var(--tok-fn)!important}#content-area .shiki span[style*=\"#569CD6\"i],#content-area .shiki span[style*=\"#9CDCFE\"i]{color:var(--tok-prop)!important}#content-area .shiki span[style*=\"#CF222E;--shiki-dark:#D4D4D4\"i],#content-area .shiki span[style*=\"rgb(207, 34, 46); --shiki-dark: #D4D4D4\"i]{color:var(--tok-keyword)!important}#content-area .shiki span[style*=\"#0550AE;--shiki-dark:#9CDCFE\"i],#content-area .shiki span[style*=\"#0550AE;--shiki-dark:#D4D4D4\"i],#content-area .shiki span[style*=\"rgb(5, 80, 174); --shiki-dark: #9CDCFE\"i],#content-area .shiki span[style*=\"rgb(5, 80, 174); --shiki-dark: #D4D4D4\"i]{color:var(--tok-number)!important}#content-area .shiki span[style*=\"#953800;--shiki-dark:#D4D4D4\"i],#content-area .shiki span[style*=\"rgb(149, 56, 0); --shiki-dark: #D4D4D4\"i]{color:var(--tok-prop)!important}#content-area .shiki span[style*=\"#CF222E;--shiki-dark:#569CD6\"i],#content-area .shiki span[style*=\"rgb(207, 34, 46); --shiki-dark: #569CD6\"i]{color:var(--tok-fn)!important}#content-area .code-block,#content-area .code-group [data-component-part=code-block-root]{--code-lang-mark:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23fff' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 4.5 2.5 8 6 11.5M10 4.5 13.5 8 10 11.5'/%3E%3C/svg%3E\");--code-lang-name:\"Code\"}#content-area .code-block[language=python],#content-area .code-group [data-component-part=code-block-root]:has(pre[language=python]){--code-lang-mark:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23fff' d='M7.9 0q-1 0-1.84.16c-1.63.28-1.93.88-1.93 1.98v1.45H8v.49H2.68a2.4 2.4 0 0 0-2.4 1.93 7 7 0 0 0 0 3.88c.27 1.13.92 1.94 2.04 1.94h1.33v-1.74c0-1.26 1.1-2.38 2.41-2.38h3.86c1.07 0 1.93-.87 1.93-1.94V2.14c0-1.03-.89-1.81-1.93-1.98Q8.9 0 7.9 0M5.82 1.17a.73.73 0 0 1 0 1.45.73.73 0 0 1 0-1.45'/%3E%3Cpath fill='%23fff' d='M12.33 4.08v1.7a2.46 2.46 0 0 1-2.41 2.41H6.06c-1.06 0-1.93.9-1.93 1.94v3.64c0 1.03.91 1.64 1.93 1.94 1.22.35 2.4.42 3.86 0 .97-.28 1.92-.84 1.92-1.94V12.3H8v-.48h5.78c1.13 0 1.54-.77 1.93-1.94.4-1.2.39-2.34 0-3.88-.27-1.1-.8-1.93-1.93-1.93zm-2.17 9.2c.4 0 .72.33.72.73s-.32.73-.72.73a.73.73 0 0 1 0-1.46'/%3E%3C/svg%3E\");--code-lang-name:\"Python\"}#content-area .code-block[language=shellscript],#content-area .code-group [data-component-part=code-block-root]:has(pre[language=shellscript]){--code-lang-mark:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23fff' fill-rule='evenodd' d='m1.53 12.78-.53.53-1.06-1.06.53-.53L4.19 8 .47 4.28l-.53-.53L1 2.69l.53.53L5.6 7.29a1 1 0 0 1 0 1.42zm7.22-.28H8V14h8v-1.5H8.75' clip-rule='evenodd'/%3E%3C/svg%3E\");--code-lang-name:\"Bash\"}#content-area .code-block[language=json],#content-area .code-group [data-component-part=code-block-root]:has(pre[language=json]){--code-lang-mark:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23fff' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6.5 2.25h-.75A1.75 1.75 0 0 0 4 4v2.25c0 .83-.67 1.5-1.5 1.5M6.5 13.75h-.75A1.75 1.75 0 0 1 4 12V9.75c0-.83-.67-1.5-1.5-1.5M9.5 2.25h.75A1.75 1.75 0 0 1 12 4v2.25c0 .83.67 1.5 1.5 1.5M9.5 13.75h.75A1.75 1.75 0 0 0 12 12V9.75c0-.83.67-1.5 1.5-1.5'/%3E%3C/svg%3E\");--code-lang-name:\"JSON\"}#content-area .code-block[language=toml],#content-area .code-group [data-component-part=code-block-root]:has(pre[language=toml]){--code-lang-mark:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23fff' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6.25 2.5H3.75v11h2.5M9.75 2.5h2.5v11h-2.5'/%3E%3C/svg%3E\");--code-lang-name:\"TOML\"}#content-area .code-block[language=text],#content-area .code-group [data-component-part=code-block-root]:has(pre[language=text]){--code-lang-mark:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23fff' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 4h9M3.5 8h9M3.5 12h5.5'/%3E%3C/svg%3E\");--code-lang-name:\"Text\"}#content-area .code-block{border:1px solid var(--code-line)!important;border-radius:12px!important;padding:0!important;overflow:hidden;background:var(--code-bg)!important}#content-area .code-block [data-component-part=code-block-root]{border-radius:0!important;background:var(--code-bg)!important}#content-area [data-component-part=code-block-header]{height:40px;align-items:center;padding:0 6px 0 12px!important;background:var(--code-header-bg);border-bottom:1px solid var(--code-line);border-radius:0!important}#content-area [data-component-part=code-block-header-filename]{gap:8px!important;font-size:13px;color:var(--code-chrome-fg)!important}#content-area .code-block:not([data-has-header])::after,#content-area [data-component-part=code-block-header-filename]::before{content:\"\";flex:none;width:16px;height:16px;background-color:var(--code-chrome-fg);-webkit-mask:var(--code-lang-mark) center/16px 16px no-repeat;mask:var(--code-lang-mark) center/16px 16px no-repeat}#content-area .code-block:not([data-has-header])::before{content:var(--code-lang-name);position:absolute;inset:0 0 auto 0;height:40px;display:flex;align-items:center;padding:0 44px 0 36px;background:var(--code-header-bg);border-bottom:1px solid var(--code-line);font-size:13px;font-weight:500;color:var(--code-chrome-fg)}#content-area .code-block:not([data-has-header])::after{position:absolute;top:12px;left:12px}#content-area .code-block:not([data-has-header]){padding-top:40px!important}#content-area .code-block [data-floating-buttons]{top:0!important;right:6px!important;height:40px;align-items:center}#content-area .code-block>.code-block-fade-overlay{display:none}#content-area .code-block{--code-padding-right:0px;--fade-width:0px}#content-area .code-block [data-testid=copy-code-button] svg,#content-area .code-group [data-testid=copy-code-button] svg{color:var(--code-chrome-fg)!important}#content-area .code-block [data-testid=copy-code-button]:hover svg,#content-area .code-group [data-testid=copy-code-button]:hover svg,#content-area [data-component-part=code-group-tab-bar] [role=tab]:hover,#content-area [data-component-part=code-group-tab-bar] [role=tab][data-active]{color:var(--code-chrome-fg-strong)!important}#content-area .line-highlight,#content-area .line-highlight::before,#content-area [data-component-part=code-block-root]:not(.has-line-numbers) .line-highlight::after{background:var(--code-mark-bg)!important}#content-area .line-highlight::before{border-left:2px solid var(--code-mark-rule)!important}#content-area .line-highlight .tok-punct,#content-area .line-highlight span[style*=\"#6A9955\"i]{color:var(--code-mark-rule)!important}#content-area .code-group{border:0!important;padding:0!important;background:0 0!important;overflow:visible}#content-area [data-component-part=code-group-tab-bar]{border-bottom:1px solid var(--code-line);padding-right:0!important;margin-bottom:14px;position:relative}#content-area [data-component-part=code-group-tab-bar] [role=tablist]{gap:0!important}#content-area [data-component-part=code-group-tab-bar] [role=tab]{margin:0 18px 0 0!important;padding:0 0 10px!important;font-size:13px;color:var(--code-chrome-fg)!important}#content-area [data-component-part=code-group-tab-bar] [role=tab]>div:first-child{padding:0!important;background:0 0!important;color:inherit!important}#content-area [data-component-part=code-group-tab-bar] [role=tab]>div:last-child{bottom:-1px!important;height:2px!important;border-radius:0!important}#content-area .code-group [role=tabpanel] [data-component-part=code-block-root]{border:1px solid var(--code-line);border-radius:12px!important;background:var(--code-bg)!important;position:relative;overflow:hidden;padding-top:40px!important}#content-area .code-group [role=tabpanel] [data-component-part=code-block-root]::before{content:var(--code-lang-name);position:absolute;inset:0 0 auto 0;z-index:1;height:40px;display:flex;align-items:center;padding:0 44px 0 36px;background:var(--code-header-bg);border-bottom:1px solid var(--code-line);font-size:13px;font-weight:500;color:var(--code-chrome-fg)}#content-area .code-group [data-component-part=code-block-root][data-filename]::before{content:attr(data-filename)}#content-area .code-group [role=tabpanel] [data-component-part=code-block-root]::after{content:\"\";position:absolute;top:12px;left:12px;z-index:1;width:16px;height:16px;background-color:var(--code-chrome-fg);-webkit-mask:var(--code-lang-mark) center/16px 16px no-repeat;mask:var(--code-lang-mark) center/16px 16px no-repeat}#content-area [data-component-part=code-group-tab-bar]>div:last-child{position:absolute;top:100%;right:6px;z-index:2;height:40px;margin-top:14px}#content-area .header-tabs .code-group{border:1px solid var(--code-line)!important;border-radius:12px!important;overflow:hidden;background:var(--code-bg)!important;--code-padding-right:0px;--fade-width:0px}#content-area .header-tabs [data-component-part=code-group-tab-bar]{height:40px;align-items:center;margin-bottom:0;padding-right:6px!important;background:var(--code-header-bg);border-bottom:1px solid var(--code-line)}#content-area .header-tabs [data-component-part=code-group-tab-bar] [role=tab]{height:40px;padding:0!important}#content-area .header-tabs [data-component-part=code-group-tab-bar]>div:last-child{position:static;height:auto;margin-top:0}#content-area .header-tabs .code-group [role=tabpanel] [data-component-part=code-block-root]{border:0;padding-top:0!important}#content-area .header-tabs .code-group [role=tabpanel] [data-component-part=code-block-root]::after,#content-area .header-tabs .code-group [role=tabpanel] [data-component-part=code-block-root]::before{content:none}.split-diagram{display:block;width:100%;height:auto;margin:24px 0 28px}#content-area .header-tabs .code-block-fade-overlay,.dark .split-diagram-light,.split-diagram-dark{display:none}.dark .split-diagram-dark{display:block}.agent-setup{display:flex;flex-wrap:wrap;align-items:center;gap:10px 12px;margin:0 0 88px}@media (max-width:767.98px){.agent-setup{margin-bottom:8px}}.agent-setup-btn,.agent-setup-read{display:inline-flex;align-items:center;gap:12px;height:42px;padding:0 18px;border:1px solid transparent;border-radius:999px;font-size:14px;font-weight:500;text-decoration:none!important;white-space:nowrap;transition:background-color .15s ease,border-color .15s ease,color .15s ease}.agent-setup-btn{cursor:copy;border-color:#18181b;background-color:#18181b;color:#fff}.agent-setup-btn:hover{background-color:#000;border-color:#000;color:#fff}.dark .agent-setup-btn{border-color:#fff;background-color:#fff;color:#18181b}.dark .agent-setup-btn:hover{background-color:rgba(255,255,255,.86);border-color:rgba(255,255,255,.86);color:#18181b}.agent-setup-read{border-color:rgba(24,24,27,.14);background-color:#fff;color:rgba(24,24,27,.92);box-shadow:0 1px 2px rgba(24,24,27,.05)}.agent-setup-read:hover{text-decoration:none!important;background-color:rgba(24,24,27,.04);border-color:rgba(24,24,27,.26);color:rgba(24,24,27,.92)}.dark .agent-setup-read{border-color:rgba(255,255,255,.16);background-color:rgba(255,255,255,.04);color:rgba(255,255,255,.94);box-shadow:none}.dark .agent-setup-read:hover{background-color:rgba(255,255,255,.09);border-color:rgba(255,255,255,.28);color:rgba(255,255,255,.94)}.agent-setup-label>span,.tool-route code{white-space:nowrap}.agent-setup-label-done,.charter-prompt-copied .agent-setup-label-idle{display:none}.charter-prompt-copied .agent-setup-label-done{display:inline}.agent-setup-logos{display:inline-flex;align-items:center;gap:5px}.agent-setup-logo{width:18px;height:18px;flex:none}.agent-setup-logo-tall{width:auto;height:17px}.agent-setup-fallback{font-size:14px;margin:-12px 0 28px}.agent-setup-sr,.agent-setup-status{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}@media (max-width:460px){.agent-setup-btn,.agent-setup-read{padding:0 14px;gap:9px;font-size:13.5px}}#pagination .pagination-next,#pagination .pagination-prev{display:grid;grid-template-rows:auto auto;align-items:center;column-gap:12px;row-gap:0}#pagination .pagination-prev{grid-template-columns:auto 1fr}#pagination .pagination-next{grid-template-columns:1fr auto;text-align:right}#pagination .pagination-next::before,#pagination .pagination-prev::after{grid-row:1;font-size:13px;font-weight:400;line-height:17px;color:rgba(24,24,27,.55)}.dark #pagination .pagination-next::before,.dark #pagination .pagination-prev::after{color:rgba(255,255,255,.45)}#pagination .pagination-prev::after{content:\"Previous\";grid-column:2}#pagination .pagination-next::before{content:\"Next\";grid-column:1}#pagination .pagination-next>[data-component-part=pagination-title],#pagination .pagination-prev>[data-component-part=pagination-title]{grid-row:2}#pagination .pagination-prev>[data-component-part=pagination-title]{grid-column:2}#pagination .pagination-next>[data-component-part=pagination-title]{grid-column:1}#pagination .pagination-next>[data-component-part=pagination-chevron],#pagination .pagination-prev>[data-component-part=pagination-chevron]{grid-row:1/span 2;align-self:center;height:12px!important;width:auto}#pagination [data-component-part=pagination-chevron] path{stroke-width:1}#pagination .pagination-prev>[data-component-part=pagination-chevron]{grid-column:1}#pagination .pagination-next>[data-component-part=pagination-chevron]{grid-column:2}#pagination [data-component-part=pagination-title]{line-height:20px}#pagination .pagination-next:hover::before,#pagination .pagination-prev:hover::after{color:rgba(24,24,27,.8)}.dark #pagination .pagination-next:hover::before,.dark #pagination .pagination-prev:hover::after{color:rgba(255,255,255,.75)}#pagination{margin-top:56px}.tool-route{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:20px}.tool-route code{min-width:0;max-width:100%;overflow-x:auto;padding:0;border:0;background:0 0;font-size:12.5px;text-decoration:none;color:rgba(24,24,27,.62)}.dark .tool-route code{color:rgba(255,255,255,.55)}.required{margin-left:3px;color:#c72c41;font-weight:600;cursor:help}.dark .required{color:#e8586b}.markers{display:inline-flex;flex-wrap:wrap;gap:4px;margin-top:4px}.marker{padding:1px 5px;border-radius:4px;background-color:rgba(24,24,27,.06);color:rgba(24,24,27,.65);font-family:var(--default-mono-font-family, ui-monospace, monospace);font-size:10px;line-height:1.5;white-space:nowrap}.dark .marker{background-color:rgba(255,255,255,.08);color:rgba(255,255,255,.6)}.field-constraints{color:rgba(24,24,27,.5);font-size:12px}.dark .field-constraints{color:rgba(255,255,255,.45)}.enum-table table,.reference-table table{table-layout:fixed;width:100%}.reference-table td:nth-child(1),.reference-table th:nth-child(1){width:24%}.reference-table td:nth-child(2),.reference-table th:nth-child(2){width:22%}.reference-table td:nth-child(3),.reference-table th:nth-child(3){width:54%}.reference-table td:nth-child(1),.reference-table td:nth-child(2){overflow-wrap:break-word}.model-tree{position:relative;margin:0 0 28px;border:1px solid rgba(9,9,11,.1);border-radius:16px;background-color:#f9fafb}.dark .model-tree{border-color:rgba(255,255,255,.1);background-color:rgba(255,255,255,.05)}.model-tree-scroll{padding:18px 20px;overflow-x:auto;font-family:var(--default-mono-font-family, ui-monospace, monospace);font-size:12.5px;line-height:1.75}.model-tree .tree-children{margin-left:6px;border-left:1px solid rgba(24,24,27,.16)}.dark .model-tree .tree-children{border-left-color:rgba(255,255,255,.16)}.model-tree .tree-children>.tree-node{position:relative;padding-left:14px}.model-tree .tree-children>.tree-node::before{content:\"\";position:absolute;left:0;top:.85em;width:9px;height:1px;background-color:rgba(24,24,27,.16)}.dark .model-tree .tree-children>.tree-node::before{background-color:rgba(255,255,255,.16)}.model-tree a{color:inherit;text-decoration:underline;text-decoration-color:rgba(24,24,27,.25);text-underline-offset:3px}.dark .model-tree a{text-decoration-color:rgba(255,255,255,.22)}.model-tree a:hover{text-decoration-color:currentColor}.model-tree-copy{position:absolute;top:10px;right:10px;display:grid;place-items:center;width:28px;height:28px;padding:0;border:1px solid transparent;border-radius:8px;background:0 0;color:rgba(24,24,27,.5);cursor:pointer;opacity:0;transition:opacity .15s ease,color .15s ease,background-color .15s ease}.model-tree-copy:focus-visible,.model-tree:hover .model-tree-copy{opacity:1}.model-tree-copy:hover{border-color:rgba(9,9,11,.1);background-color:rgba(255,255,255,.7);color:rgba(24,24,27,.8)}.dark .model-tree-copy{color:rgba(255,255,255,.45)}.dark .model-tree-copy:hover{border-color:rgba(255,255,255,.12);background-color:rgba(255,255,255,.08);color:rgba(255,255,255,.8)}.model-tree-copy svg{grid-area:1/1;transition:opacity .15s ease}.model-tree[data-copy=copied] .model-tree-copy svg:first-child,.model-tree[data-copy=idle] .model-tree-copy svg:last-child{opacity:0}.model-tree[data-copy=copied] .model-tree-copy{opacity:1}.model-tree .tree-note,.tool-list-group{color:rgba(24,24,27,.45);font-size:11px}.dark .model-tree .tree-note{color:rgba(255,255,255,.4)}.tool-list-group{display:block;padding:14px 2px 2px;font-weight:600;letter-spacing:.04em;text-transform:uppercase}.tool-list-group:first-child{padding-top:0}.dark .tool-list-group{color:rgba(255,255,255,.42)}.nav-tag-pill-text[data-nav-tag]{background-color:rgba(24,24,27,.06);color:rgba(24,24,27,.62)}.dark .nav-tag-pill-text[data-nav-tag]{background-color:rgba(255,255,255,.08);color:rgba(255,255,255,.55)}.nav-tag-pill-text[data-nav-tag=GET]{background-color:rgba(74,222,128,.2);color:#15803d}.dark .nav-tag-pill-text[data-nav-tag=GET]{color:#4ade80}.nav-tag-pill-text[data-nav-tag=POST]{background-color:rgba(96,165,250,.2);color:#1d4ed8}.dark .nav-tag-pill-text[data-nav-tag=POST]{color:#60a5fa}.nav-tag-pill-text[data-nav-tag=PATCH],.nav-tag-pill-text[data-nav-tag=PUT]{background-color:rgba(251,146,60,.2);color:#c2410c}.dark .nav-tag-pill-text[data-nav-tag=PATCH],.dark .nav-tag-pill-text[data-nav-tag=PUT]{color:#fb923c}.nav-tag-pill-text[data-nav-tag=DELETE]{background-color:rgba(248,113,113,.2);color:#b91c1c}.dark .nav-tag-pill-text[data-nav-tag=DELETE]{color:#f87171}"}],"page":{"pagePath":"charter/running/llm-input-auto-corrections","slug":"/charter/running/llm-input-auto-corrections","pageMetadata":{"title":"LLM input auto-corrections","description":"The three input mistakes models make repeatedly, and how the runtime repairs them.","href":"/charter/running/llm-input-auto-corrections"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"The three input mistakes models make repeatedly, and how the runtime repairs them.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,em:`em`,hr:`hr`,li:`li`,p:`p`,pre:`pre`,span:`span`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`The schema a model is handed is generated by the contract, not the one you wrote\n— so it can accept forms the wire never will. Three mistakes models make\nreliably are absorbed at the boundary instead of coming back as a failed call.`}),`\n`,_jsxs(_components.p,{children:[`There is a fourth mistake that is deliberately `,_jsx(_components.em,{children:`not`}),` absorbed, and it is the\nlast section on this page: an argument the schema does not declare is refused\nrather than dropped.`]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsxs(Heading,{level:`2`,id:`requests---becomes-requests--`,children:[_jsx(_components.code,{children:`'{\"requests\": [...]}'`}),` becomes `,_jsx(_components.code,{children:`{\"requests\": [...]}`})]}),`\n`,_jsxs(_components.p,{children:[`Models sometimes serialize a nested object as a JSON `,_jsx(_components.em,{children:`string`}),` instead of passing\nit as an object. A `,_jsx(_components.code,{children:`model_validator(mode=\"before\")`}),` finds any\n`,_jsx(_components.code,{children:`BaseModel`}),`/`,_jsx(_components.code,{children:`list`}),`/`,_jsx(_components.code,{children:`dict`}),`-typed field whose value is a string starting with `,_jsx(_components.code,{children:`{`}),`\nor `,_jsx(_components.code,{children:`[`}),`, and parses it before field validation runs.`]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsxs(Heading,{level:`2`,id:`datetime-becomes-date_time`,children:[_jsx(_components.code,{children:`\"dateTime\"`}),` becomes `,_jsx(_components.code,{children:`date_time`})]}),`\n`,_jsxs(_components.p,{children:[`Models send camelCase keys inside nested objects, matching the API’s own docs. A\nschema that answered only to its own field names would drop the key as unknown:\nthe field stays `,_jsx(_components.code,{children:`None`}),`, the API receives `,_jsx(_components.code,{children:`{}`}),`, and returns a confusing 400 with\nno local validation error at all.`]}),`\n`,_jsxs(_components.p,{children:[`So the contract answers to all three spellings. Every field carries camelCase,\nPascalCase and snake_case aliases — `,_jsx(_components.code,{children:`dateTime`}),`, `,_jsx(_components.code,{children:`DateTime`}),` and `,_jsx(_components.code,{children:`date_time`}),` are\nall valid input — and this holds whichever convention the schema’s author wrote\nin. Stripe’s schemas are snake_case and Gmail’s are camelCase; both resolve in\nboth directions.`]}),`\n`,_jsxs(_components.p,{children:[`All three are `,_jsx(_components.em,{children:`declared`}),` aliases rather than merely tolerated ones, which is\nwhat makes the refusal in the next section safe: with unknown keys refused, a\nspelling that is only “also allowed” would become an error.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`model_dump()`}),` is unaffected — it still returns snake_case field names, so the\nkey-case conversion at serialization time works exactly as before.`]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`an-argument-the-schema-does-not-declare-is-refused`,children:`An argument the schema does not declare is refused`}),`\n`,_jsx(_components.p,{children:`Pydantic’s default is to ignore unknown keys. At a tool boundary that is the\nworst available behaviour, because the result is not an error — it is a wrong\nanswer that nothing marks as wrong.`}),`\n`,_jsx(_components.p,{children:`A model that invents a filter, or mistypes a real one, previously got a\nsuccessful call and an unfiltered page:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:\"# `created` is not a field on this tool.\"})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` stripe.customers_list.ainvoke({`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"limit\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`2`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"created\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"gt\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1704067200`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}})`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`That sent `,_jsx(_components.code,{children:`limit=2`}),`, returned two arbitrary customers, and said nothing\nanywhere about the filter it had thrown away. The agent then reasons over rows\nit believes were filtered. The same happens for a plausible typo — `,_jsx(_components.code,{children:`emails`}),` for\n`,_jsx(_components.code,{children:`email`}),` — which is the more likely mistake of the two.`]}),`\n`,_jsxs(_components.p,{children:[`So generated schemas set `,_jsx(_components.code,{children:`extra=\"forbid\"`}),`, and the call above raises\n`,_jsx(_components.a,{href:`/charter/reference/errors#toolvalidationerror`,children:_jsx(_components.code,{children:`ToolValidationError`})}),` before the\nnetwork:`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`3`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`3`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Validation error:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- **created**: Extra inputs are not permitted`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[`which is a message a model can read and correct, in the\n`,_jsx(_components.a,{href:`/charter/running/tool-validation-error-handling`,children:`retry loop`}),` this library already has.\n`,_jsx(_components.code,{children:`to_json_schema()`}),` carries `,_jsx(_components.code,{children:`additionalProperties: false`}),` for the same reason, on\nthe root and on every nested object — so a provider enforcing strict schemas\nmostly prevents the mistake before a call is made at all.`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`This tightened in a way a host application can notice. If you were passing an\nextra key to `,_jsx(_components.code,{children:`ainvoke`}),` and relying on it being ignored, that call now raises.\nThe fix is to remove the key, or to declare it on the schema if it should have\nbeen on the wire. Per-call `,_jsx(_components.code,{children:`headers`}),` are unaffected: they are a keyword-only\nargument, not part of the schema, and never were.`]})}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`a-rejection-the-model-can-act-on`,children:`A rejection the model can act on`}),`\n`,_jsx(_components.p,{children:`Left to the agent framework, a rejected call comes back wrapped in that\nframework’s own template, with the entire kwargs payload dumped at the model:`}),`\n`,_jsx(CodeBlock,{numberOfLines:`3`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`3`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Error invoking tool 'documents_update' with kwargs {'document_id': '...', 'body': '...'}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`with error: body: Input should be a valid dictionary ... Please fix the error and try again.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[`Charter raises `,_jsx(_components.a,{href:`/charter/reference/errors#toolvalidationerror`,children:_jsx(_components.code,{children:`ToolValidationError`})}),`\ncarrying a compact rendering instead:`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`3`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`3`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Validation error:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- **body**: Input should be a valid dictionary or instance of BatchUpdateRequestBody_LLM (got 12345)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[`The structured per-field errors are on the exception too (`,_jsx(_components.code,{children:`.errors`}),`), so a host\napplication can render its own version.`]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsxs(Heading,{level:`2`,id:`malformed-json-says-why-not-just-what`,children:[`Malformed JSON says `,_jsx(_components.em,{children:`why`}),`, not just `,_jsx(_components.em,{children:`what`})]}),`\n`,_jsx(_components.p,{children:`When the JSON-string coercion above fails, the naive behaviour is to pass the\nstring through and let type checking complain:`}),`\n`,_jsx(CodeBlock,{numberOfLines:`3`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`3`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Validation error:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- **body**: Input should be a valid dictionary or instance of BatchUpdateRequestBody_LLM`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[`That is a `,_jsx(_components.em,{children:`type`}),` error. The model concludes it sent the wrong structure, retries\nwith different content and the same broken syntax, and loops forever — because\nthe real problem was a syntax error, such as one extra closing brace.`]}),`\n`,_jsx(_components.p,{children:`Charter raises with the decoder’s own detail:`}),`\n`,_jsx(CodeBlock,{numberOfLines:`4`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`4`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Validation error:`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`- **(input)**: 'body' looks like JSON but is malformed — fix the syntax and retry.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` Detail: Expecting ',' delimiter: line 1 column 105`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[`Now the model knows it is a syntax problem and where. The check is unambiguous: a\nstring starting with `,_jsx(_components.code,{children:`{`}),` or `,_jsx(_components.code,{children:`[`}),` for a `,_jsx(_components.code,{children:`BaseModel`}),`/`,_jsx(_components.code,{children:`list`}),`/`,_jsx(_components.code,{children:`dict`}),`-typed field is\nalways an attempted JSON serialization — there is no other case.`]}),`\n`,_jsx(Heading,{level:`2`,id:`related`,children:`Related`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/charter/reference/errors#toolvalidationerror`,children:_jsx(_components.code,{children:`ToolValidationError`})}),` — the `,_jsx(_components.code,{children:`.errors`}),` list these renderings come from`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/charter/running/tool-validation-error-handling`,children:`Tool validation and error handling`}),` — the three layers, in order`]}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"LLM input auto-corrections","description":"The three input mistakes models make repeatedly, and how the runtime repairs them.","href":"/charter/running/llm-input-auto-corrections"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"'{\"requests\": [...]}' becomes {\"requests\": [...]}","slug":"requests---becomes-requests--","depth":2,"children":[]},{"title":"\"dateTime\" becomes date_time","slug":"datetime-becomes-date_time","depth":2,"children":[]},{"title":"An argument the schema does not declare is refused","slug":"an-argument-the-schema-does-not-declare-is-refused","depth":2,"children":[]},{"title":"A rejection the model can act on","slug":"a-rejection-the-model-can-act-on","depth":2,"children":[]},{"title":"Malformed JSON says why, not just what","slug":"malformed-json-says-why-not-just-what","depth":2,"children":[]},{"title":"Related","slug":"related","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/r28-ai-inc/3f6584c3707f6f8e/charter/agent-button.js","/_mintlify/custom/r28-ai-inc/077e99ab9c6ed5c4/charter/breadcrumbs.js","/_mintlify/custom/r28-ai-inc/8735488a5b09817e/charter/code-blocks.js","/_mintlify/custom/r28-ai-inc/0cfda944e1ecf03c/charter/copy-button.js","/_mintlify/custom/r28-ai-inc/55d64b8c4926c054/charter/model-tree.js","/_mintlify/custom/r28-ai-inc/c2c6d665cb011396/charter/external-links.js"],"subdomain":"r28-ai-inc","siteName":"Charter Docs","title":"LLM input auto-corrections - Charter Docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-09-24T22:17:57.202Z","originalFileLocation":"charter/running/llm-input-auto-corrections.md"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"The three input mistakes models make repeatedly, and how the runtime repairs them.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Charter Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/x-icon\" sizes=\"180x180\" href=\"https://mintcdn.com/r28-ai-inc/qw2kuHXM_Ro033zj/charter/favicon.ico?fit=max\u0026amp;auto=format\u0026amp;n=qw2kuHXM_Ro033zj\u0026amp;q=85\u0026amp;s=27db528b46f8591639ea664292778456\">\u003clink data-mint-head rel=\"icon\" type=\"image/x-icon\" sizes=\"32x32\" href=\"https://mintcdn.com/r28-ai-inc/qw2kuHXM_Ro033zj/charter/favicon.ico?fit=max\u0026amp;auto=format\u0026amp;n=qw2kuHXM_Ro033zj\u0026amp;q=85\u0026amp;s=27db528b46f8591639ea664292778456\">\u003clink data-mint-head rel=\"icon\" type=\"image/x-icon\" sizes=\"16x16\" href=\"https://mintcdn.com/r28-ai-inc/qw2kuHXM_Ro033zj/charter/favicon.ico?fit=max\u0026amp;auto=format\u0026amp;n=qw2kuHXM_Ro033zj\u0026amp;q=85\u0026amp;s=27db528b46f8591639ea664292778456\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"https://mintcdn.com/r28-ai-inc/qw2kuHXM_Ro033zj/charter/favicon.ico?fit=max\u0026amp;auto=format\u0026amp;n=qw2kuHXM_Ro033zj\u0026amp;q=85\u0026amp;s=27db528b46f8591639ea664292778456\">\u003cmeta data-mint-head property=\"og:title\" content=\"LLM input auto-corrections - Charter Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"The three input mistakes models make repeatedly, and how the runtime repairs them.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Charter Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.r28.ai/charter/running/llm-input-auto-corrections\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://r28-ai-inc.mintlify.app/_mintlify/api/og/v2?division=Running+it\u0026amp;title=LLM+input+auto-corrections\u0026amp;description=The+three+input+mistakes+models+make+repeatedly%2C+and+how+the+runtime+repairs+them.\u0026amp;theme=f707128ad62db6184d97a801\u0026amp;signature=21ec6a53953841781dd070aaedfed8fb9cf8d5ad003dfca2ffc0b7e79478d22e\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"LLM input auto-corrections - Charter Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"The three input mistakes models make repeatedly, and how the runtime repairs them.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://r28-ai-inc.mintlify.app/_mintlify/api/og/v2?division=Running+it\u0026amp;title=LLM+input+auto-corrections\u0026amp;description=The+three+input+mistakes+models+make+repeatedly%2C+and+how+the+runtime+repairs+them.\u0026amp;theme=f707128ad62db6184d97a801\u0026amp;signature=21ec6a53953841781dd070aaedfed8fb9cf8d5ad003dfca2ffc0b7e79478d22e\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"https://mintlify.s3.us-west-1.amazonaws.com/r28-ai-inc/_generated/favicon/browserconfig.xml?v=3\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Charter Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#C72C41\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.r28.ai/charter/running/llm-input-auto-corrections\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/charter/running/llm-input-auto-corrections.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.r28.ai/#organization\",\"name\":\"Charter Docs\",\"url\":\"https://docs.r28.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/r28-ai-inc/qw2kuHXM_Ro033zj/charter/logo-light.svg?fit=max\u0026auto=format\u0026n=qw2kuHXM_Ro033zj\u0026q=85\u0026s=4b775ea9a9d2744e06a02249c6fd8edc\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.r28.ai#website\",\"name\":\"Charter Docs\",\"url\":\"https://docs.r28.ai\",\"publisher\":{\"@id\":\"https://docs.r28.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.r28.ai/charter/running/llm-input-auto-corrections#webpage\",\"url\":\"https://docs.r28.ai/charter/running/llm-input-auto-corrections\",\"name\":\"LLM input auto-corrections\",\"description\":\"The three input mistakes models make repeatedly, and how the runtime repairs them.\",\"dateModified\":\"2026-09-24T22:17:57.202Z\",\"isPartOf\":{\"@id\":\"https://docs.r28.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.r28.ai/charter/running/llm-input-auto-corrections#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.r28.ai/charter/running/llm-input-auto-corrections#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Running it\",\"item\":\"https://docs.r28.ai/charter/running/observability\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"LLM input auto-corrections\",\"item\":\"https://docs.r28.ai/charter/running/llm-input-auto-corrections\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.r28.ai/charter/running/llm-input-auto-corrections#article\",\"headline\":\"LLM input auto-corrections\",\"name\":\"LLM input auto-corrections\",\"description\":\"The three input mistakes models make repeatedly, and how the runtime repairs them.\",\"url\":\"https://docs.r28.ai/charter/running/llm-input-auto-corrections\",\"mainEntityOfPage\":{\"@id\":\"https://docs.r28.ai/charter/running/llm-input-auto-corrections#webpage\"},\"dateModified\":\"2026-09-24T22:17:57.202Z\",\"publisher\":{\"@id\":\"https://docs.r28.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.r28.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Charter Docs\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Charter Docs","nav":{"global":null,"tabs":[{"tab":"Documentation","groups":[{"group":"Get started","pages":[{"title":"Charter Overview","sidebarTitle":"Overview","href":"/charter"},{"title":"Installation","href":"/charter/start/installation"},{"title":"Quickstart","href":"/charter/start/quickstart"},{"title":"Coding agents","href":"/charter/start/coding-agents"},{"title":"Setup prompt","href":"/charter/agent-setup/prompt"},{"title":"Why Charter","sidebarTitle":"Why Charter","href":"/charter/why-charter"}]},{"group":"Declaring a tool","pages":[{"title":"The wire contract","href":"/charter/tools/wire-contract"},{"title":"Transform system","href":"/charter/tools/transforms"},{"title":"Key case cascade","href":"/charter/tools/key-case-cascade"},{"title":"Envelopes","href":"/charter/tools/envelopes"},{"title":"Tool names across packs","href":"/charter/tools/naming"}]},{"group":"The boundary","pages":[{"title":"Egress control","href":"/charter/boundary/egress-control"},{"title":"Projections","href":"/charter/tools/projections"},{"title":"Mode system","href":"/charter/boundary/mode-system"},{"title":"Mode quick reference","href":"/charter/boundary/mode-quick-reference"}]},{"group":"Authentication","pages":[{"group":"Your own account","pages":[{"title":"Connect your own account","sidebarTitle":"Every pack","href":"/charter/auth/your-own-account"},{"title":"Set up Google","sidebarTitle":"Google","href":"/charter/auth/setup/google"},{"title":"Set up Slack","sidebarTitle":"Slack","href":"/charter/auth/setup/slack"},{"title":"Set up GitHub","sidebarTitle":"GitHub","href":"/charter/auth/setup/github"},{"title":"Set up Notion","sidebarTitle":"Notion","href":"/charter/auth/setup/notion"},{"title":"Set up Stripe","sidebarTitle":"Stripe","href":"/charter/auth/setup/stripe"},{"title":"Set up Shopify","sidebarTitle":"Shopify","href":"/charter/auth/setup/shopify"}]},{"group":"Your users' accounts","pages":[{"title":"Connect your users' accounts","sidebarTitle":"Every pack","href":"/charter/auth/your-users"},{"title":"Getting the grant","sidebarTitle":"Getting the grant","href":"/charter/auth/oauth-flow"},{"group":"Register your app","pages":[{"title":"Register a Google OAuth client","sidebarTitle":"Google","href":"/charter/auth/apps/google"},{"title":"Register a Slack app","sidebarTitle":"Slack","href":"/charter/auth/apps/slack"},{"title":"Register a GitHub OAuth App","sidebarTitle":"GitHub","href":"/charter/auth/apps/github"},{"title":"Register a Linear OAuth application","sidebarTitle":"Linear","href":"/charter/auth/apps/linear"},{"title":"Register a public Notion integration","sidebarTitle":"Notion","href":"/charter/auth/apps/notion"},{"title":"Register a Stripe App","sidebarTitle":"Stripe","href":"/charter/auth/apps/stripe"},{"title":"Register a Shopify app","sidebarTitle":"Shopify","href":"/charter/auth/apps/shopify"},{"title":"Register a Microsoft Entra app","sidebarTitle":"Microsoft","href":"/charter/auth/apps/microsoft"}]}]},{"title":"Permissions","href":"/charter/auth/permissions"},{"title":"Authorization servers","href":"/charter/auth/authorization-servers"},{"title":"api_key_tool_factory","sidebarTitle":"API keys","href":"/charter/auth/api-key-tool-factory"},{"group":"Providers","pages":[{"title":"Google OAuth","sidebarTitle":"Google","href":"/charter/auth/providers/google"},{"title":"Slack OAuth","sidebarTitle":"Slack","href":"/charter/auth/providers/slack"},{"title":"GitHub OAuth","sidebarTitle":"GitHub","href":"/charter/auth/providers/github"},{"title":"Linear OAuth","sidebarTitle":"Linear","href":"/charter/auth/providers/linear"},{"title":"Notion OAuth","sidebarTitle":"Notion","href":"/charter/auth/providers/notion"},{"title":"Stripe Apps OAuth","sidebarTitle":"Stripe","href":"/charter/auth/providers/stripe"},{"title":"Shopify OAuth","sidebarTitle":"Shopify","href":"/charter/auth/providers/shopify"},{"title":"Microsoft OAuth","sidebarTitle":"Microsoft","href":"/charter/auth/providers/microsoft"}]}]},{"group":"Using your tools","pages":[{"title":"MCP server","href":"/charter/using/mcp"},{"title":"Framework adapters","href":"/charter/using/adapters"}]},{"group":"Optimization","pages":[{"title":"What there is to optimize","sidebarTitle":"Overview","href":"/charter/optimization/overview"},{"title":"Context window","sidebarTitle":"Context window","href":"/charter/optimization/context-window"},{"title":"Latency","href":"/charter/optimization/latency"},{"title":"Getting it right first try","sidebarTitle":"First-try accuracy","href":"/charter/optimization/accuracy"}]},{"group":"Running it","pages":[{"title":"What a call cost","href":"/charter/running/observability"},{"title":"Tool validation and error handling","description":"Where input is validated, the three layers it passes through, and what each raises.","href":"/charter/running/tool-validation-error-handling"},{"title":"LLM input auto-corrections","href":"/charter/running/llm-input-auto-corrections"}]},{"group":"Guarantees","pages":[{"title":"Conformance","description":"Twenty-three properties that must hold for every pack, checked without knowing anything about any particular API.","href":"/charter/guarantees/conformance"},{"title":"Measured results","href":"/charter/guarantees/measured-results"},{"title":"Benchmarks","href":"/charter/guarantees/benchmarks"},{"title":"What this can't express","sidebarTitle":"Limitations","href":"/charter/guarantees/limitations"}]}]},{"tab":"Packs","pages":[{"title":"Packs","href":"/charter/packs/overview"}]},{"tab":"Reference","pages":[{"title":"Reference","href":"/charter/reference/overview"}]}]},"basePath":"","title":"LLM input auto-corrections - Charter Docs","buildId":"dpl_36EDyZCDfRuoUD9af5CH4M1bqY2h","deploymentId":"dpl_36EDyZCDfRuoUD9af5CH4M1bqY2h","dynamics":[],"chunks":[]}