Skip to main content
Glama
r3-yamauchi

Amazon Bedrock Knowledge Base MCP Server

by r3-yamauchi

get_knowledge_base

Retrieve detailed information about a specific Amazon Bedrock Knowledge Base, including its status, configuration, and settings.

Instructions

特定のAmazon Bedrock Knowledge Baseの詳細情報を取得します。

Args: knowledge_base_id: Knowledge BaseのID

Returns: KnowledgeBaseDetailDict: Knowledge Baseの詳細情報 - id: Knowledge BaseのID - name: Knowledge Baseの名前 - status: Knowledge Baseのステータス - description: Knowledge Baseの説明(オプション) - arn: Knowledge BaseのARN(オプション) - その他の設定情報

Raises: ValueError: knowledge_base_idが空の場合

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
knowledge_base_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
arnYes
nameYes
statusYes
descriptionYes

Implementation Reference

  • The 'get_knowledge_base' MCP tool handler function in the main module. It validates the input and calls the Bedrock client.
    @mcp.tool()  # MCPツールとして公開
    @handle_errors  # エラーハンドリングデコレータを適用
    def get_knowledge_base(knowledge_base_id: str) -> KnowledgeBaseDetailDict:
        """
        特定のAmazon Bedrock Knowledge Baseの詳細情報を取得します。
        
        Args:
            knowledge_base_id: Knowledge BaseのID
    
        Returns:
            KnowledgeBaseDetailDict: Knowledge Baseの詳細情報
                - id: Knowledge BaseのID
                - name: Knowledge Baseの名前
                - status: Knowledge Baseのステータス
                - description: Knowledge Baseの説明(オプション)
                - arn: Knowledge BaseのARN(オプション)
                - その他の設定情報
        
        Raises:
            ValueError: knowledge_base_idが空の場合
        """
        # 入力値のバリデーション(共通関数を使用)
        knowledge_base_id = validate_required_string(knowledge_base_id, "knowledge_base_id")
        
        # BedrockクライアントからKnowledge Baseの詳細を取得
        kb = bedrock_client.get_knowledge_base(knowledge_base_id)
        return kb
  • The underlying implementation of 'get_knowledge_base' within the BedrockKBClient class, which interacts directly with the AWS SDK (boto3).
    def get_knowledge_base(self, knowledge_base_id: str) -> Dict[str, Any]:
        """
        特定のKnowledge Baseの詳細情報を取得します。
        
        Knowledge Baseの設定、ステータス、ストレージ設定などの
        詳細な情報を取得します。
    
        Args:
            knowledge_base_id: Knowledge BaseのID
    
        Returns:
            Dict[str, Any]: Knowledge Baseの詳細情報
                - id: Knowledge BaseのID
                - name: Knowledge Baseの名前
                - status: Knowledge Baseのステータス
                - description: Knowledge Baseの説明
                - roleArn: 使用されているIAMロールのARN
                - storageConfiguration: ストレージ設定
                - knowledgeBaseArn: Knowledge BaseのARN
                - createdAt: 作成日時
                - updatedAt: 最終更新日時
        
        Raises:
            ClientError: AWS API呼び出しが失敗した場合
        """
        try:
            # AWS Bedrock APIを呼び出してKnowledge Baseの詳細を取得
            response = self.bedrock_agent.get_knowledge_base(
                knowledgeBaseId=knowledge_base_id
            )
            
            # 取得成功をログに記録
            logger.info(f"Retrieved knowledge base: {knowledge_base_id}")
            
            # Knowledge Baseの詳細情報を返す
            return response["knowledgeBase"]
        except ClientError as e:
            logger.error(f"Error getting knowledge base {knowledge_base_id}: {e}")
            raise
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states this is a retrieval operation ('取得します'), implying it's likely read-only, but doesn't explicitly confirm this or disclose other behavioral traits such as authentication needs, rate limits, error handling beyond the ValueError, or what happens if the ID is invalid. The description adds minimal behavioral context beyond the basic purpose.

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 description is appropriately sized and front-loaded with the purpose in the first sentence. The Args, Returns, and Raises sections are structured but could be more concise; for example, the Returns section lists details that might be better covered by the output schema. Overall, it's efficient with minimal waste.

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?

Given the tool has an output schema (implied by 'Has output schema: true'), the description doesn't need to fully explain return values, and it adequately covers the single parameter and basic error case. However, with no annotations and multiple sibling tools, it lacks context on usage and behavioral details, keeping it from a perfect score.

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

Parameters4/5

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

The input schema has 0% description coverage, but the description compensates well by explaining the single parameter 'knowledge_base_id' as 'Knowledge BaseのID' and noting it raises a ValueError if empty. This adds clear meaning beyond the bare schema. With 0% schema coverage and one parameter, the baseline is high, and the description meets it effectively.

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 clearly states the tool's purpose: '特定のAmazon Bedrock Knowledge Baseの詳細情報を取得します' (retrieves detailed information for a specific Amazon Bedrock Knowledge Base). It specifies the verb '取得します' (retrieve) and resource 'Knowledge Baseの詳細情報' (Knowledge Base details). However, it doesn't explicitly differentiate from sibling tools like 'list_knowledge_bases' or 'update_knowledge_base', which would require a 5.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'list_knowledge_bases' (for listing all knowledge bases) or 'update_knowledge_base' (for modifying one), nor does it specify prerequisites or contexts for usage. The only implicit guidance is that you need a specific knowledge_base_id, but this is insufficient for a higher score.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/r3-yamauchi/bedrock-kb-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server