BUILD
Context and schemas
Send the right data, with defined identity and limits.
Context that explains the problem
Context is an authorized projection of application data at the beginning of the conversation. The server validates, reduces, and redacts known secret patterns before persisting the snapshot. This complements the data selection made by your backend.
Three required blocks
userState.userId and userState.tenantId must match the issued session. Do not send the internal snapshot format instead of the push context.
{
"userState": {
"userId": "usr_usuario_autenticado",
"tenantId": "ten_do_projeto",
"roles": [
"member"
],
"plan": "standard",
"featuresEnabled": [],
"entities": [],
"activeErrors": [],
"limitsReached": []
},
"userHistory": {
"windowHours": 24,
"events": []
},
"userLogs": {
"recentRequests": [],
"jobs": [],
"errors": []
},
"knowledgePack": {
"docs": []
}
}Fields and limits
The total context budget is up to 262,144 UTF-8 bytes, subject to the lower limit configured for the tenant. Dates must have a timezone. Use JSON Schema limits to validate the entire body.
| Field | Rule |
|---|---|
| entities / activeErrors / limitsReached | Up to 100 items in each list |
| activeErrors.errorClass | validation, permission, infra or business |
| userHistory.windowHours | Greater than zero; up to 720 hours |
| events / recentRequests / errors | Up to 1,000 items in each list |
| jobs.status | queued, running, succeeded, failed or canceled |
| knowledgePack.docs | Up to 50 documents; content up to 32,000 characters each |
Currentness and privacy
Log actual source and time. Do not treat send success as confirmed payment, nor action logs as fictitious HTTP requests. Report which sources are unavailable.
updateContext vale para o próximo caso. Para consultar dados atuais durante a conversa, inclua na sessão um servidor MCP com a consulta de leitura.
Do not send tokens, cookies, connection strings, signed URLs, full exports, or data from other people. A retentionDays field does not prove that operational purging is configured.