{
"type": "object",
"properties": {
"kb_id": {
"type": "string",
"description": "The knowledge base ID, e.g. kb_abc123"
},
"title": {
"type": "string",
"minLength": 1,
"maxLength": 150,
"description": "Document title, unique within the knowledge base"
},
"description": {
"type": "string",
"maxLength": 500,
"description": "Optional one-line description of the document"
},
"upload_id": {
"type": "string",
"description": "Only for a file on a disk YOU control that is too large for file_text (over ~50 KB): call create_upload_url with reveal_url: true, PUT the bytes yourself from a machine with open internet access, then pass the upload_id here. Never for a file the user attached in the chat (pass it as `file`), and never from a hosted chat sandbox such as ChatGPT code interpreter, which cannot reach the storage host."
},
"file": {
"type": "object",
"properties": {
"file_id": {
"type": "string",
"description": "Host-side file id"
},
"download_url": {
"type": "string",
"description": "Short-lived signed URL the host provides for the attached file"
},
"file_name": {
"type": "string"
},
"mime_type": {
"type": "string"
},
"size": {
"type": "number"
}
},
"required": [
"file_id",
"download_url"
],
"additionalProperties": false,
"description": "ALWAYS use this when the user attached a file in the chat: pass the attached file here and the host turns it into a download link for the server. Fastest path, any size. NEVER open, convert or base64-encode an attached file yourself."
},
"file_name": {
"type": "string",
"description": "File name with extension (.pdf or .txt). Only needed with file_base64; taken from the upload or attachment otherwise."
},
"file_base64": {
"type": "string",
"description": "Base64 content for a SMALL .pdf/.txt only. Prefer upload_id or the host attachment for anything real."
}
},
"required": [
"kb_id",
"title"
],
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#"
}