Skip to main content
Glama
Amazon Bedrock Knowledge Base MCP Server

Amazon Bedrock Knowledge Base MCP Server

by Zlash65

QueryKnowledgeBases

Search a Bedrock knowledge base with natural language to retrieve relevant passages, with optional metadata filters and reranking for targeted results.

Instructions

Query a knowledge base and return relevant passages.

Returns a newline-separated set of JSON objects (one per retrieval result).

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": {
      "query": "<query>",
      "knowledge_base_id": "<knowledge_base_id>"
    },
    "name": "QueryKnowledgeBases"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryYesA natural language query to search the knowledge base with
whereNoOptional schema-driven metadata constraints. Keys are resolved via the metadata schema: prefer schema aliases, or use direct metadata keys. Values can be scalars, lists (OR within that key), or dicts for operator overrides.
filterNoOptional raw Bedrock retrieval filter (RetrievalFilter). This is a power-user escape hatch and is only accepted when BEDROCK_KB_ALLOW_RAW_FILTER=true.
rerankingNoWhether to rerank the results. Useful for improving relevance and sorting. Can be globally configured with BEDROCK_KB_RERANKING_ENABLED.
where_joinNoHow to combine schema-driven `where` constraints. Default is AND (narrow). OR is supported within friendly filters only.AND
filter_modeNoHow to combine explicit filters (`where`/raw) and implicit filtering. 'explicit_then_implicit' applies explicit filters when provided, and also enables implicit filtering when requested; it composes constraints with AND semantics.explicit_then_implicit
search_typeNoSearch strategy for retrieval. 'HYBRID' combines keyword + semantic search and is recommended for OpenSearch Serverless; 'SEMANTIC' uses embeddings only; 'DEFAULT' lets Bedrock decide.DEFAULT
data_source_idsNoThe data source IDs to filter the knowledge base by. It must be a list of valid data source IDs from the ListKnowledgeBases tool.
implicit_filterNoEnable Bedrock implicit filtering for this call (requires BEDROCK_KB_IMPLICIT_FILTER_MODEL_ARN).
knowledge_base_idYesThe knowledge base ID to query. It must be a valid ID from the ListKnowledgeBases tool.
number_of_resultsNoThe number of results to return. Use smaller values for focused results and larger values for broader coverage.
metadata_schema_modeNoMetadata schema resolution mode. 'static' uses only configured schema files; 'auto' falls back to sampling retrieval metadata to infer a schema.auto
reranking_model_nameNoThe name of the reranking model to use. Options: 'COHERE', 'AMAZON'.AMAZON
metadata_schema_auto_sample_kNoNumber of retrieval results to sample for auto schema discovery.
metadata_schema_auto_sample_queryNoQuery used for auto schema discovery (only when metadata_schema_mode=auto).the

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

B3.1/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full behavioral burden. It does disclose the return shape (newline-separated JSON objects, one per retrieval result), which is useful context, but says nothing about permissions, prerequisites, feature flags that gate parameters, failure modes, or whether the call has side effects.

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?

Two short sentences, front-loaded with the core action and free of redundant wording. The trade-off is underspecification rather than verbosity, but the text itself is efficiently structured.

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

Completeness2/5

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

For a 15-parameter retrieval tool with no annotations and a closely-named sibling, the description is thin. The output schema justifies omitting return-value detail, but the absence of any routing guidance against QueryKnowledgeBasesWithMetadata leaves a real gap in completeness.

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% with 15 parameters, so the schema already documents every input, including the where/filter/reranking knobs. The description adds no parameter meaning beyond that baseline, which is acceptable but not additive.

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

Purpose4/5

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

The description states a specific verb and resource: query a knowledge base and return relevant passages. That is clear enough for an agent to understand what the tool does. It does not differentiate this tool from the sibling QueryKnowledgeBasesWithMetadata, so the agent cannot tell from the description which of the two to pick.

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

Usage Guidelines2/5

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

There is no when-to-use guidance, no exclusions, and no mention of alternatives such as QueryKnowledgeBasesWithMetadata or ListKnowledgeBases. The sibling list shows a near-identical tool, yet the description offers no criterion for choosing between them. Usage must be inferred entirely from the schemas.

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