Skip to content
AI Support / Dev Center

10 results · Esc to close

Documentation/Context and schemas

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.

JSON
{
  "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.

FieldRule
entities / activeErrors / limitsReachedUp to 100 items in each list
activeErrors.errorClassvalidation, permission, infra or business
userHistory.windowHoursGreater than zero; up to 720 hours
events / recentRequests / errorsUp to 1,000 items in each list
jobs.statusqueued, running, succeeded, failed or canceled
knowledgePack.docsUp 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.

CONTINUE HEREMCP and actions