Skip to main content
Glama

Upload knowledge base document

upload_knowledge_base_document
Destructive

[Knowledge base] Upload and process a knowledge base document (base64 file, name with its extension) into a store from list_knowledge_base_stores. An interview uses a store once create_interview / update_interview set its knowledge_base_store_id: interview_ids can only name interviews already linked to the store. The optional interview_ids limits it to chosen interviews on the same knowledge base: left out it is every interview, [] is none. Returns the limit it set.

Every argument in full, with examples: get_tool_reference.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "knowledge_base_store_id": "<knowledge_base_store_id>",
      "name": "<name>",
      "file": "<file>"
    },
    "name": "upload_knowledge_base_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileYesThe document file, base64-encoded.
nameYesDocument name with its extension, which decides how the file is read: .doc, .docx, .rtf, .odt, .pdf, .pages or .pptx; any other is refused with 422 (name).
llm_modelNoYour model id, e.g. "claude-opus-4-8"; "unknown" if unsure. For analytics.
merchant_idNoOverride merchant id (admin / sub-merchant only).
interview_idsNoThe interviews that may use this document, in the live session and when generating questions. Omit it or send null to use the document in every interview on the knowledge base. An empty list limits it to no interview. Each interview must belong to the same company and use this knowledge base.
conversation_idNoThe conversation_id this server returned earlier in this conversation, unchanged, including after later user messages. Omit it if you have none. Recorded for the server developer's analytics.
knowledge_base_store_idYesThe knowledge base store to add the document to.

Output Schema

NameRequiredDescriptionDefault
interview_idsNo
_mcp_instructionsNoServer-issued metadata for this conversation.
knowledge_base_idYes
limit_to_interviewsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • changedInput schema / properties / interview_ids / description
      Previous value: -"The interviews that may use this document, in the live session and when generating questions. Omit it or send null to use the document in every interview on the knowledge base. An empty list limits it to no interview. Each interview must belong to the same company and use this knowledge base. With multipart/form-data, repeat the field or send one JSON array such as `[\"<id>\"]`, and write an empty list as `[]`."New value: +"The interviews that may use this document, in the live session and when generating questions. Omit it or send null to use the document in every interview on the knowledge base. An empty list limits it to no interview. Each interview must belong to the same company and use this knowledge base."
    • addedInput schema / properties / knowledge_base_store_id / format
      Added value: +"uuid"
    • addedInput schema / properties / name / minLength
      Added value: +1
    • changedInput schema / required
      Previous value: -[
      -  "knowledge_base_store_id",
      -  "file"
      -]New value: +[
      +  "knowledge_base_store_id",
      +  "name",
      +  "file"
      +]
  2. Changed7 schema fields changed
    • removedInput schema / properties / interview_ids / example
      Removed value: -[
      -  "de300000-0000-4000-8001-000000000007"
      -]
    • removedInput schema / properties / knowledge_base_store_id / example
      Removed value: -"d9d6f121-1230-48fd-b3a7-8b5a1e8db052"
    • addedInput schema / properties / llm_model
      Added value: +{
      +  "description": "Your model id, e.g. \"claude-opus-4-8\"; \"unknown\" if unsure. For analytics.",
      +  "type": "string"
      +}
    • changedInput schema / properties / name / description
      Previous value: -"Document name with its extension, which decides how the file is read: .doc, .docx, .rtf, .odt, .pdf, .pages or .pptx; any other is refused with 422 (name). Falls back to the uploaded file name for multipart."New value: +"Document name with its extension, which decides how the file is read: .doc, .docx, .rtf, .odt, .pdf, .pages or .pptx; any other is refused with 422 (name)."
    • removedOutput schema / properties / interview_ids / description
      Removed value: -"The interviews this document is limited to. Present only when `limit_to_interviews` is true; an empty list means no interview can use it."
    • removedOutput schema / properties / knowledge_base_id / description
      Removed value: -"Id of the created knowledge_base record."
    • removedOutput schema / properties / limit_to_interviews / description
      Removed value: -"True when the document is limited to the interviews in `interview_ids`. False when every interview on the knowledge base can use it."
  3. Changed1 schema field changed
    • changedInput schema / properties / name / description
      Previous value: -"Document name (with extension). Falls back to the uploaded file name for multipart."New value: +"Document name with its extension, which decides how the file is read: .doc, .docx, .rtf, .odt, .pdf, .pages or .pptx; any other is refused with 422 (name). Falls back to the uploaded file name for multipart."
  4. Changed8 schema fields changed
    • changedInput schema / properties / conversation_id / description
      Previous value: -"Pass the exact conversation_id from the server's previous response, unchanged. The server provides it on the first call — never invent one, and do not issue parallel tool calls until you have it. Keep passing the same conversation_id for the rest of the conversation, including after later user messages or on a different task; do not reset it when the user starts a new request."New value: +"The conversation_id this server returned earlier in this conversation, unchanged, including after later user messages. Omit it if you have none. Recorded for the server developer's analytics."
    • changedInput schema / properties / file / description
      Previous value: -"The document file (binary)."New value: +"The document file, base64-encoded."
    • removedInput schema / properties / file / format
      Removed value: -"binary"
    • addedInput schema / properties / file / minLength
      Added value: +1
    • changedInput schema / properties / file / type
      Previous value: -[
      -  "string",
      -  "null"
      -]New value: +"string"
    • changedInput schema / properties / knowledge_base_store_id / type
      Previous value: -[
      -  "string",
      -  "null"
      -]New value: +"string"
    • changedInput schema / properties / merchant_id / type
      Previous value: -[
      -  "string",
      -  "null"
      -]New value: +"string"
    • changedInput schema / properties / name / type
      Previous value: -[
      -  "string",
      -  "null"
      -]New value: +"string"
  5. Changed4 schema fields changed
    • addedInput schema / properties / interview_ids
      Added value: +{
      +  "description": "The interviews that may use this document, in the live session and when generating questions. Omit it or send null to use the document in every interview on the knowledge base. An empty list limits it to no interview. Each interview must belong to the same company and use this knowledge base. With multipart/form-data, repeat the field or send one JSON array such as `[\"<id>\"]`, and write an empty list as `[]`.",
      +  "example": [
      +    "de300000-0000-4000-8001-000000000007"
      +  ],
      +  "items": {
      +    "format": "uuid",
      +    "type": "string"
      +  },
      +  "type": [
      +    "array",
      +    "null"
      +  ]
      +}
    • addedOutput schema / properties / interview_ids
      Added value: +{
      +  "description": "The interviews this document is limited to. Present only when `limit_to_interviews` is true; an empty list means no interview can use it.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": [
      +    "array",
      +    "null"
      +  ]
      +}
    • addedOutput schema / properties / limit_to_interviews
      Added value: +{
      +  "description": "True when the document is limited to the interviews in `interview_ids`. False when every interview on the knowledge base can use it.",
      +  "type": [
      +    "boolean",
      +    "null"
      +  ]
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "knowledge_base_id"
      -]New value: +[
      +  "knowledge_base_id",
      +  "limit_to_interviews"
      +]
  6. Changed1 schema field changed
    • changedInput schema / properties / conversation_id / description
      Previous value: -"Echo the conversation_id from the server's previous response. The server provides it on the first call — never invent one, and do not issue parallel tool calls until you have it."New value: +"Pass the exact conversation_id from the server's previous response, unchanged. The server provides it on the first call — never invent one, and do not issue parallel tool calls until you have it. Keep passing the same conversation_id for the rest of the conversation, including after later user messages or on a different task; do not reset it when the user starts a new request."
  7. Changed2 schema fields changed
    • addedInput schema / properties / conversation_id
      Added value: +{
      +  "description": "Echo the conversation_id from the server's previous response. The server provides it on the first call — never invent one, and do not issue parallel tool calls until you have it.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / _mcp_instructions
      Added value: +{
      +  "description": "Server-issued metadata for this conversation.",
      +  "properties": {
      +    "conversation_id": {
      +      "description": "The server-issued conversation identifier.",
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
  8. First observed

TDQS

A3.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare destructiveHint=true, idempotentHint=false and openWorldHint=true, so the safety profile is covered. The description adds genuine context (422 rejection on unsupported extensions, and that it returns the limit it set), but it never explains what the destructive behavior actually destroys (e.g. re-upload overwrite) or what permissions are needed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The scoping and linkage constraints are front-loaded, and the pointer to get_tool_reference for full arguments keeps the body short. The single long block of densely nested clauses about interview linkage is harder to parse than it needs to be, and the return-value sentence sits at the end where it is easy to miss.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With 7 parameters, some optional analytics fields, and an output schema, the description gives enough for a correct call: target store, file form, name rule, and interview scoping. The remaining gap is behavioral rather than structural - the destructive/idempotency implications are left entirely to annotations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so every parameter is already documented, including the omit-vs-empty-list semantics for interview_ids and the extension rule for name. The description restates rather than extends that: it adds no format, encoding or constraint detail beyond what the schema provides, so baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource ('Upload and process a knowledge base document'), names the required input form (base64 file plus `name` with its extension), and anchors the target to a store from the sibling list_knowledge_base_stores. An agent can distinguish this from list/save store tools without opening a schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explains the prerequisite that an interview must already be linked to a store via create_interview / update_interview before its id is accepted, and clarifies that interview_ids is optional and what omitting it means. It does not explicitly contrast with set_knowledge_base_document_interviews, which would be the natural alternative for rebinding documents later.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.