Skip to main content

Qdrant Build Context

Immutable Catalog Entry

This descriptor comes from the active versioned Portal catalog.

READqdrant.qdrant-build-context
  • Contract tier: agent_ready
  • Risk: read
  • Catalog version: qdrant-2026.07.12.2
  • Descriptor hash: 24340264c0612ac33a94afe19cfb1305d9ec83614873fa66339e197ad43497aa

Use this when you need to build a cited, token-budgeted context pack from relevant vector-memory matches. It does not intentionally change Qdrant or MCP state. It contacts the configured Qdrant service or uses MCP-owned job/upload state. Returns normalized provider data in data plus safe request and trace metadata in meta. Requires an authenticated MAD MCP Portal request and any provider configuration named by the input schema.

Request Body

{
"jsonrpc": "2.0",
"id": "qdrant-qdrant-build-context-example",
"method": "tools/call",
"params": {
"name": "qdrant.qdrant-build-context",
"arguments": {
"query": "query_example",
"top_k": 1,
"use_mmr": false,
"min_score": "",
"mmr_lambda": 1,
"candidate_k": "",
"group_by_doc": false,
"query_filter": "",
"memory_filter": "",
"snippet_chars": 1
}
}
}

Arguments Schema

{
"type": "object",
"$defs": {
"MemoryFilterInput": {
"type": "object",
"title": "MemoryFilterInput",
"properties": {
"isbn": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Isbn",
"default": null,
"description": "Filter by ISBN."
},
"type": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Type",
"default": null,
"description": "Filter by memory type."
},
"week": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Week",
"default": null,
"description": "Filter by accelerated course week number or label."
},
"year": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Year",
"default": null,
"description": "Filter by material year."
},
"class": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Class",
"default": null,
"description": "Filter by exact school course or class code, such as MUS327."
},
"scope": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Scope",
"default": null,
"description": "Filter by scope."
},
"title": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Title",
"default": null,
"description": "Filter by exact title."
},
"author": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Author",
"default": null,
"description": "Filter by author."
},
"course": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Course",
"default": null,
"description": "Alias for class; filter by exact school course or class code."
},
"doc_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Doc Id",
"default": null,
"description": "Filter by document id."
},
"labels": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Labels",
"default": null,
"description": "Filter by labels (any match)."
},
"module": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Module",
"default": null,
"description": "Filter by module number or label."
},
"source": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Source",
"default": null,
"description": "Filter by source."
},
"status": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Status",
"default": null,
"description": "Filter by material status."
},
"chapter": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Chapter",
"default": null,
"description": "Filter by chapter number or label."
},
"edition": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Edition",
"default": null,
"description": "Filter by edition."
},
"subject": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Subject",
"default": null,
"description": "Filter by subject."
},
"entities": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Entities",
"default": null,
"description": "Filter by entities (any match)."
},
"doc_title": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Doc Title",
"default": null,
"description": "Filter by document title."
},
"file_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "File Name",
"default": null,
"description": "Filter by file name."
},
"file_type": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "File Type",
"default": null,
"description": "Filter by file type."
},
"publisher": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Publisher",
"default": null,
"description": "Filter by publisher."
},
"text_hash": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Text Hash",
"default": null,
"description": "Filter by text hash."
},
"class_code": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Class Code",
"default": null,
"description": "Alias for class; filter by exact school course or class code."
},
"source_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Source Url",
"default": null,
"description": "Filter by source URL."
},
"related_ids": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Related Ids",
"default": null,
"description": "Filter by related memory ids (any match)."
},
"trust_level": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Trust Level",
"default": null,
"description": "Filter by governance trust level."
},
"chapter_title": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Chapter Title",
"default": null,
"description": "Filter by exact chapter title."
},
"created_at_to": {
"anyOf": [
{},
{
"type": "null"
}
],
"title": "Created At To",
"default": null,
"description": "Filter by creation time (end)."
},
"expires_at_to": {
"anyOf": [
{},
{
"type": "null"
}
],
"title": "Expires At To",
"default": null,
"description": "Filter by expiration time (end)."
},
"material_type": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Material Type",
"default": null,
"description": "Filter by material type, such as textbook or lesson."
},
"review_status": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Review Status",
"default": null,
"description": "Filter by governance review status."
},
"updated_at_to": {
"anyOf": [
{},
{
"type": "null"
}
],
"title": "Updated At To",
"default": null,
"description": "Filter by update time (end)."
},
"confidence_max": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"title": "Confidence Max",
"default": null,
"description": "Maximum confidence score."
},
"confidence_min": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"title": "Confidence Min",
"default": null,
"description": "Minimum confidence score."
},
"knowledge_role": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Knowledge Role",
"default": null,
"description": "Filter by governance knowledge role."
},
"retrieval_tier": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Retrieval Tier",
"default": null,
"description": "Filter by governance retrieval tier."
},
"created_at_from": {
"anyOf": [
{},
{
"type": "null"
}
],
"title": "Created At From",
"default": null,
"description": "Filter by creation time (start)."
},
"expires_at_from": {
"anyOf": [
{},
{
"type": "null"
}
],
"title": "Expires At From",
"default": null,
"description": "Filter by expiration time (start)."
},
"lifecycle_state": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Lifecycle State",
"default": null,
"description": "Filter by governance lifecycle state."
},
"section_heading": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Section Heading",
"default": null,
"description": "Filter by section heading."
},
"updated_at_from": {
"anyOf": [
{},
{
"type": "null"
}
],
"title": "Updated At From",
"default": null,
"description": "Filter by update time (start)."
},
"knowledge_domain": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Knowledge Domain",
"default": null,
"description": "Filter by governance knowledge domain."
},
"evaluation_status": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Evaluation Status",
"default": null,
"description": "Filter by governance evaluation status."
},
"origin_collection": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Origin Collection",
"default": null,
"description": "Filter by original source collection."
},
"ingest_fingerprint": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Ingest Fingerprint",
"default": null,
"description": "Filter by document ingest fingerprint."
},
"evaluation_sequence": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Evaluation Sequence",
"default": null,
"description": "Filter by governance evaluation sequence step."
}
},
"additionalProperties": true
}
},
"title": "Qdrant Build Context input",
"required": [
"query"
],
"properties": {
"query": {
"type": "string",
"title": "Query",
"description": "Task, question, or search phrase to build a compact context pack for."
},
"top_k": {
"type": "integer",
"title": "Top K",
"default": 5,
"description": "Max cited context items to return. Start with 3-5."
},
"use_mmr": {
"type": "boolean",
"title": "Use Mmr",
"default": false,
"description": "Enable MMR diversity for the candidate set."
},
"min_score": {
"anyOf": [
{
"type": "number"
},
{
"type": "null"
}
],
"title": "Min Score",
"default": null,
"description": "Optional minimum similarity score."
},
"mmr_lambda": {
"type": "number",
"title": "Mmr Lambda",
"default": 0.5,
"description": "MMR trade-off between relevance and diversity."
},
"candidate_k": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Candidate K",
"default": null,
"description": "Candidate hits to inspect before dedupe. Defaults to top_k*3 when grouping by document."
},
"group_by_doc": {
"type": "boolean",
"title": "Group By Doc",
"default": true,
"description": "Avoid repeated chunks from the same document/source."
},
"query_filter": {
"anyOf": [
{
"type": "object",
"additionalProperties": true
},
{
"type": "null"
}
],
"title": "Query Filter",
"default": null,
"description": "Validated query filter input used by Qdrant Build Context; follow the type, limits, and defaults in this schema."
},
"memory_filter": {
"anyOf": [
{
"$ref": "#/$defs/MemoryFilterInput"
},
{
"type": "null"
}
],
"title": "Memory Filter",
"default": null,
"description": "Structured exact filters to apply before fallback."
},
"snippet_chars": {
"type": "integer",
"title": "Snippet Chars",
"default": 360,
"description": "Max characters per snippet, clamped to 40-1200."
},
"collection_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Collection Name",
"default": null,
"description": "Collection to search for second-brain context."
},
"metadata_fields": {
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
],
"title": "Metadata Fields",
"default": null,
"description": "Metadata fields to include. Defaults to citation-friendly identity, document, source, and section fields."
},
"max_output_chars": {
"type": "integer",
"title": "Max Output Chars",
"default": 4000,
"description": "Approximate response budget for the packed context, clamped to 800-50000 characters."
},
"fallback_strategy": {
"enum": [
"none",
"relax_filters"
],
"type": "string",
"title": "Fallback Strategy",
"default": "relax_filters",
"description": "Fallback behavior when filtered search returns no context. relax_filters retries the same query without exact filters."
},
"max_chunks_per_doc": {
"type": "integer",
"title": "Max Chunks Per Doc",
"default": 2,
"description": "Max chunks per document/source when grouping."
}
},
"description": "Validated input contract for the qdrant-build-context native Qdrant MCP tool."
}

Output Schema

{
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"data",
"meta"
],
"properties": {
"data": {
"type": "object",
"description": "Normalized result data for qdrant-build-context: build a cited, token-budgeted context pack from relevant vector-memory matches.",
"additionalProperties": true
},
"meta": {
"type": "object",
"properties": {
"bytes_in": {
"type": "integer",
"description": "Approximate serialized input byte count."
},
"warnings": {
"type": "array",
"items": {
"type": "string"
},
"description": "Safe recovery warnings."
},
"bytes_out": {
"type": "integer",
"description": "Approximate serialized output byte count."
},
"elapsed_ms": {
"type": "integer",
"description": "Tool execution time in milliseconds."
},
"request_id": {
"type": "string",
"description": "Stable request trace identifier."
},
"server_version": {
"type": "string",
"description": "Deployed source revision when available."
},
"serialization_ms": {
"type": "integer",
"description": "Response serialization time in milliseconds."
},
"server_uptime_ms": {
"type": "integer",
"description": "Server process uptime in milliseconds."
},
"server_instance_id": {
"type": "string",
"description": "Ephemeral server-process identifier."
}
},
"description": "Secret-safe request, trace, size, timing, and warning metadata.",
"additionalProperties": true
}
},
"description": "Qdrant MCP normalized response envelope.",
"additionalProperties": false
}

Code Examples

curl -X POST 'https://portal.madpanda3d.com/api/mcp' \
-H 'Authorization: Bearer mad_live_***' \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": "qdrant-qdrant-build-context-example",
"method": "tools/call",
"params": {
"name": "qdrant.qdrant-build-context",
"arguments": {
"query": "query_example",
"top_k": 1,
"use_mmr": false,
"min_score": "",
"mmr_lambda": 1,
"candidate_k": "",
"group_by_doc": false,
"query_filter": "",
"memory_filter": "",
"snippet_chars": 1
}
}
}'

Example Responses

{
"ok": true,
"message": "Tool qdrant.qdrant-build-context executed successfully.",
"note": "Response shape varies by MCP tool. Inspect live responses for exact fields."
}