Skip to main content
Glama
LostInBrittany

RAGmonsters Custom PostgreSQL MCP Server

RAGmonsters 向けカスタム PostgreSQL MCP サーバー

概要

このリポジトリは、モデルコンテキストプロトコル(MCP)を用いて大規模言語モデル(LLM)とデータベースを統合する、より高度なアプローチを示しています。汎用的なMCP PostgreSQLサーバーでは、LLMが生のSQLクエリを通じてデータベースを探索できますが、このプロジェクトでは、アプリケーションのニーズに合わせてカスタマイズされたドメイン固有のAPIを提供するカスタムMCPサーバーを作成することで、異なるアプローチを採用しています。

この実装では、モデルコンテキストプロトコルの高性能実装であるFastMCPを使用します。これにより、LLM とのツールベースの相互作用の効率と信頼性が向上します。

このプロジェクトは、 RAGmonstersデータセットを基盤として利用しています。RAGmonstersは、様々な属性、能力、関係性を持つ架空のモンスターの豊富なデータセットを提供するオープンソースプロジェクトで、特に検索拡張生成(RAG)システムのデモンストレーションとテストを目的として設計されています。

汎用MCPデータベースアクセスの問題点

汎用 MCP PostgreSQL サーバーは、LLM に次の機能を可能にするqueryツールを提供します。

  • データベーススキーマを調べる

  • 自然言語の質問に基づいてSQLクエリを作成する

  • これらのクエリをデータベースに対して実行する

このアプローチは機能しますが、実際のアプリケーションではいくつかの制限があります。

  • 認知負荷: LLMはデータベーススキーマ全体を理解する必要がある

  • 非効率性: 1つの質問に答えるのに複数のSQLクエリが必要になることが多い

  • セキュリティ上の懸念: 生のSQLアクセスには、インジェクション攻撃を防ぐために慎重かつ迅速なエンジニアリングが必要です。

  • パフォーマンス: LLMがデータベースのインデックス戦略を理解していない場合、複雑なクエリは非効率になる可能性があります。

  • ドメイン知識のギャップ: LLMはビジネスルールとドメイン固有の制約を理解していない

RAGmonstersデータセットについて

RAGmonstersは、検索拡張生成(RAG)システムのテストとデモンストレーションのために特別に設計されたオープンデータセットです。豊富な属性、能力、そして関係性を持つ架空のモンスターに関する情報が含まれており、自然言語クエリのデモンストレーションに最適です。

RAGmonsters の PostgreSQL バージョンは、次のような複数のテーブルとリレーションシップを備えた、適切に構造化されたリレーショナル データベースを提供します。

  • 様々な属性(攻撃力、防御力、体力など)を持つモンスター

  • モンスターが持つ能力

  • 複雑な関係を持つ要素(火、水、土など)

  • モンスターが生息する生息地

  • モンスター間の進化の連鎖と関係性

このリッチで相互接続されたデータセットは、汎用 SQL アクセスと比較したドメイン固有の API の威力を示すのに最適です。

私たちのソリューション: ドメイン固有のMCP API

このプロジェクトでは、RAGmonstersデータセット向けの高水準かつドメイン固有のAPIを提供するカスタムMCPサーバーの構築方法を紹介します。生のSQL機能を公開するのではなく、MCPサーバーは以下のような専用関数を提供します。

  1. 抽象データベースの複雑さ: 基礎となるスキーマとSQLの詳細を非表示にする

  2. ドメイン固有の操作を提供する:ビジネスコンセプトに沿った機能を提供する

  3. 一般的なクエリの最適化: よくある質問に対して効率的なクエリパターンを実装します

  4. ビジネスルールの適用: ドメイン固有のロジックと制約を埋め込む

  5. セキュリティの向上: 直接SQLアクセスを排除することで攻撃対象領域を制限

Related MCP server: scopedb-mcp

ウェブインターフェース

このプロジェクトには、RAGmonsters データセットと対話するための 2 つの主要なインターフェースが含まれています。

エクスプローラーインターフェース

MCP API を介して RAGmonsters データセットを探索およびフィルタリングするためのデータ重視のインターフェース:

  • カテゴリ、生息地、希少性でフィルタリングしてすべてのモンスターを閲覧します

  • 各モンスターの詳細情報を見る

  • Bootstrapで構築されたインタラクティブなUI

チャットインターフェース

RAGmonsters データセットと対話するための自然言語インターフェース:

  • 自然言語でモンスターについて質問する

  • 豊富なフォーマットでMarkdown形式のレスポンスを取得

  • LangGraphのReActエージェントパターンを搭載

  • MCPツールとのシームレスな統合

RAGmonsters Explorer スクリーンショット

このインターフェースにより、ユーザーは次のことが可能になります。

  • データセット内のすべてのモンスターを閲覧する

  • 生息地、カテゴリー、レア度でモンスターをフィルタリング

  • 各モンスターの詳細な情報(パワー、能力、長所、短所など)を表示します

例: ドメイン固有 API と汎用 SQL

一般的なMCP PostgreSQLアプローチ:

User: "What are the top 3 monsters with the highest attack power that are vulnerable to fire?"

LLM: (Must understand schema, joins, and SQL syntax)
1. First query to understand the schema
2. Second query to find monsters with attack power
3. Third query to find vulnerabilities
4. Final query to join and filter results

当社のカスタム MCP サーバー アプローチ:

User: "What are the top 3 monsters with the highest attack power that are vulnerable to fire?"

LLM: (Uses our domain-specific API)
1. Single call: getMonsters({ vulnerableTo: "fire", sortBy: "attackPower", limit: 3 })

プロジェクト構造

├── .env.example        # Example environment variables
├── package.json        # Node.js project configuration
├── README.md           # This documentation
├── img/                # Images for documentation
├── scripts/
│   ├── testMcpServer.js # Test script for the MCP server
│   └── testLogger.js    # Logger for test script
├── src/
│   ├── index.js        # Main application server
│   ├── mcp-server/     # Custom MCP server implementation with FastMCP
│   │   ├── index.js    # Server entry point
│   │   ├── tools/      # Domain-specific tools
│   │   │   ├── index.js      # Tool registration
│   │   │   └── monsters.js   # Monster-related operations
│   │   └── utils/     # Helper utilities
│   │       └── logger.js     # Logging functionality
│   ├── llm.js          # LangChain integration for LLM
│   └── public/         # Web interface files
│       ├── index.html  # Monster explorer interface
│       └── chat.html   # Chat interface for LLM interactions

特徴

  • FastMCPを使用したカスタムMCPサーバー:RAGmonstersデータ用の高性能ドメイン固有API

  • 最適化されたクエリ: 事前に構築された効率的なデータベース操作

  • ビジネスロジック層: APIに埋め込まれたドメインルールと制約

  • 構造化応答フォーマット: LLM 使用時の一貫した JSON 応答

  • 包括的なログ記録:デバッグと監視のための詳細なログ記録

  • テストスイート: サーバーの機能と LLM の統合を検証するためのスクリプト

  • LLM統合:

    • LangChain.js と OpenAI およびその他の互換性のある LLM プロバイダーとの統合

    • 効率的なツール使用のためのLangGraph ReActエージェントパターン

    • ツールの呼び出しと応答の自動処理

  • Webインターフェース:

    • モンスターを閲覧およびフィルタリングするためのエクスプローラーインターフェース

    • 自然言語によるやりとりを可能にする Markdown レンダリングを備えたチャット インターフェース

特徴

  • LangChain.js 統合: MCP ツールと完全に統合された LLM のインタラクション

  • Web インターフェース: RAGmonsters データセットを操作するためのエクスプローラーおよびチャット インターフェース

  • 導入準備完了: Clever Cloud などのプラットフォームに簡単に導入できるように構成されています

このアプローチの利点

  1. パフォーマンスの向上: 最適化されたクエリとキャッシュ戦略

  2. より良いユーザーエクスペリエンス:より正確で迅速な応答

  3. トークン使用量の削減: LLMは複雑なSQLやスキーマ情報を処理する必要がない

  4. 強化されたセキュリティ: 直接 SQL アクセスがないため、インジェクション攻撃のリスクが軽減されます。

  5. 保守性: データベーススキーマの変更にLLMの再トレーニングは不要

  6. スケーラビリティ: より大規模で複雑なデータベースを処理できます

はじめる

インストール

  1. このリポジトリをクローンする

  2. 依存関係をインストール: npm install

  3. .env.exampleを.envにコピーし、PostgreSQL 接続文字列と LLM API キーを設定します。

  4. MCP サーバーのテスト スクリプトを実行します: npm run test

  5. LLM統合テストスクリプトを実行します: npm run test:llm

  6. サーバーを起動します: npm start

利用可能なツール

MCP サーバーは次のツールを提供します。

  1. getMonsters - オプションのフィルタリング、並べ替え、ページ区切りを使用してモンスターのリストを取得します

    • パラメータ: フィルター (カテゴリ、生息地、希少性)、並べ替え (フィールド、方向)、制限、オフセット

    • 戻り値: 基本情報を持つモンスターオブジェクトの配列

  2. getMonsterById - IDで特定のモンスターの詳細情報を取得します

    • パラメータ: モンスターID

    • 戻り値: すべての属性、パワー、能力、長所、短所を含む詳細なモンスターオブジェクト

  3. add - 2つの数値を加算するシンプルなユーティリティ(テスト用)

    • パラメータ: a、b

    • 戻り値: 2つの数値の合計

LLM統合アーキテクチャ

このプロジェクトでは、ドメイン固有のツールを使用した LLM 統合に最新のアプローチを採用しています。

LangGraph ReAct エージェントパターン

アプリケーションは、LangGraph の ReAct (推論と行動) エージェント パターンを使用します。

  1. ユーザーのクエリを処理して意図を理解する

  2. クエリに基づいて使用するツールを決定します

  3. 適切なツールを自動的に実行します

  4. 結果を統合して一貫した対応をします

  5. 必要に応じて複数段階の推論を処理する

LLM統合のテスト

このプロジェクトには、LangChain.js を使用して LLM を MCP サーバーに統合する方法を示すテスト スクリプトが含まれています。

npm run test:llm

このスクリプト:

  1. StdioClientTransportを使用してMCPサーバーに接続します

  2. LangChainのMCPアダプターを使用して利用可能なすべてのMCPツールをロードします

  3. OpenAI APIを使用してLangChainエージェントを作成する

  4. モンスターに関する自然言語クエリを処理する

  5. LLMが情報を取得するためにツール呼び出しを行う方法を示します

  6. やり取りに関する詳細情報を記録します

スクリプト内のテストクエリを変更することで、システムのさまざまな機能を調査できます。スクリプトはscripts/testLlmWithMcpServer.jsにあります。

前提条件

  • Node.js 23以降

  • RAGmonstersデータを含むPostgreSQLデータベース

  • LLM API(例:OpenAI)へのアクセス

  • FastMCP パッケージ (依存関係に含まれています)

環境変数

次の変数を含む.envファイルを作成します。

# PostgreSQL connection string
POSTGRESQL_ADDON_URI=postgres://username:password@host:port/database

# LLM API configuration
LLM_API_KEY=your_openai_api_key
LLM_API_MODEL=gpt-4o-mini
LLM_API_URL=https://api.openai.com/v1

LLM 構成

  • LLM_API_KEY : OpenAI APIキーまたは互換性のあるプロバイダーキー

  • LLM_API_MODEL : 使用するモデル(デフォルト: gpt-4o-mini)

  • LLM_API_URL : APIエンドポイント(デフォルト: OpenAIのエンドポイント)

アプリケーションは、セルフホスト モデルや代替プロバイダーを含む、OpenAI 互換の API をすべてサポートします。

Clever Cloudへの導入

Clever Cloud CLIの使用

  1. Clever Cloud CLI をインストールします。

    npm install -g clever-tools
  2. Clever Cloud アカウントにログインします。

    clever login
  3. 新しいアプリケーションを作成します。

    clever create --type node <APP_NAME>
  4. ドメインを追加します (オプションですが推奨されます):

    clever domain add <YOUR_DOMAIN_NAME>
  5. PostgreSQL アドオンを作成し、アプリケーションにリンクします。

    clever addon create <APP_NAME>-pg --plan dev
    clever service link-addon <APP_NAME>-pg

    これにより、アプリケーション内のPOSTGRESQL_ADDON_URI環境変数が自動的に設定されます。

  6. 必要な環境変数を設定します。

    clever env set LLM_API_KEY "your-openai-api-key"
    clever env set LLM_API_MODEL "gpt-4o-mini" # Optional, defaults to gpt-4o-mini
    clever env set LLM_API_URL "https://api.your-llm-provider.com" # Optional, for alternative OpenAI-compatible providers
  7. アプリケーションをデプロイします。

    clever deploy
  8. アプリケーションを開きます:

    clever open

Clever Cloud Consoleの使用

Clever Cloud Consoleから直接デプロイすることもできます。

  1. コンソールで新しいアプリケーションを作成する

  2. ランタイムとしてNode.jsを選択する

  3. PostgreSQLアドオンを作成し、アプリケーションにリンクする

  4. コンソールで必要な環境変数を設定します。

    • LLM_API_KEY : OpenAI APIキー

    • LLM_API_MODEL : (オプション) 使用するモデル。デフォルトは gpt-4o-mini

  5. Git または GitHub 統合を使用してアプリケーションをデプロイする

重要な注意事項

  • POSTGRESQL_ADDON_URI環境変数は、PostgreSQLアドオンをアプリケーションにリンクすると、Clever Cloudによって自動的に設定されます。

  • アプリケーションにはNode.js 20以降が必要です。これはClever Cloudで入手できます。

  • アプリケーションは、Clever Cloud 上の Node.js アプリケーションのデフォルト ポートであるポート 8080 で自動的に実行されます。

ライセンス

このプロジェクトは MIT ライセンスに基づいてライセンスされています - 詳細については LICENSE ファイルを参照してください。

謝辞

Available Tools

6 tools
addA

Add two numbers

ParametersJSON Schema
NameRequiredDescriptionDefault
aYes
bYes

TDQS

A3.5/5.0
Behavior4/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. 'Add two numbers' accurately describes a pure, stateless, non-destructive operation. For such a simple arithmetic tool, this is sufficient transparency, though it could explicitly state that it has no 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.

Conciseness5/5

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

The description is a single, front-loaded sentence that conveys the essential action without any unnecessary words. It is highly concise and structured effectively.

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's extreme simplicity (add two numbers), the description is largely complete. It could mention the return value (the sum), but that is easily inferred. The lack of output schema does not significantly degrade completeness here.

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

Parameters1/5

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

Schema description coverage is 0% – the description does not explain the two parameters 'a' and 'b' or their roles beyond what the schema already provides. With no additional meaning added, this dimension is severely lacking.

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?

The description clearly states 'Add two numbers', specifying the verb 'add' and the resource 'two numbers'. This distinguishes it from sibling tools like sub, mul, div, mod, and sqrt, which perform different operations.

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. For example, it does not explain when addition is preferred over subtraction or multiplication. The usage context is entirely implied.

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

getHabitatsB

Get a list of all available habitats in the database

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

B3.2/5.0
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 of behavioral disclosure. It states it retrieves a list but doesn't specify if it's read-only, safe, paginated, or has any side effects. For a tool with zero annotation coverage, this is a significant gap in transparency.

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

Conciseness5/5

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

The description is a single, efficient sentence that directly states the tool's function without any fluff. It's appropriately sized and front-loaded, making it easy to parse quickly.

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

Completeness3/5

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

Given the tool's simplicity (0 parameters, no output schema, no annotations), the description is minimally adequate. However, it lacks details on behavioral aspects like safety or output format, which would be helpful for an agent to use it correctly, especially without annotations.

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 parameters with 100% coverage, so no parameter documentation is needed. The description doesn't add param info, which is fine here, but it could hint at any implicit constraints (e.g., sorting or limits), though not required. Baseline is high due to no parameters.

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 verb ('Get') and resource ('list of all available habitats'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'getMonsterByHabitat' or 'getMonsters', which also retrieve data but with different scopes or filters, so it lacks sibling distinction.

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 scenarios where this tool is preferred over siblings like 'getMonsterByHabitat' (which filters by habitat) or 'getMonsters' (which retrieves monsters instead of habitats), leaving the agent without usage context.

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

getMonsterByHabitatA

Get monsters by habitat (exact match only). IMPORTANT: for best results, first call getHabitats to get a list of available habitats, then find the most appropriate one to use with this tool.

ParametersJSON Schema
NameRequiredDescriptionDefault
habitatYesExact habitat name (must match exactly). For best results, first call getHabitats to get a list of available habitats, then find the most appropriate one to use with this tool.
limitNoMaximum number of results to return (default: 10)

TDQS

A4/5.0
Behavior3/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 of behavioral disclosure. It mentions the 'exact match only' constraint, which is useful behavioral context beyond basic functionality. However, it lacks details on error handling, rate limits, authentication needs, or what the return format looks like (e.g., list of monsters with specific fields).

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

Conciseness5/5

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

The description is concise and well-structured: two sentences that efficiently convey purpose and usage guidelines without wasted words. The first sentence states the core functionality, and the second provides critical procedural advice, both earning their place.

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's moderate complexity (2 parameters, no output schema, no annotations), the description is fairly complete. It covers purpose, usage guidelines, and a key behavioral constraint ('exact match only'). However, without annotations or an output schema, it could benefit from more details on return values or error cases, but it's adequate for basic use.

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 the schema already documents both parameters ('habitat' and 'limit') with descriptions. The description repeats the guidance about calling 'getHabitats' for the 'habitat' parameter but doesn't add new semantic meaning beyond what the schema provides. Baseline 3 is appropriate when the schema does the heavy lifting.

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: 'Get monsters by habitat (exact match only).' It specifies the verb ('Get'), resource ('monsters'), and constraint ('by habitat, exact match only'). However, it doesn't explicitly differentiate from siblings like 'getMonsters' (which might fetch all monsters) or 'getMonsterByName' (which filters by name rather than habitat).

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

Usage Guidelines5/5

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

The description provides explicit usage guidance: 'for best results, first call getHabitats to get a list of available habitats, then find the most appropriate one to use with this tool.' This tells the agent when to use this tool (after retrieving habitat list) and references a sibling tool ('getHabitats') as a prerequisite, offering clear alternatives and context.

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

getMonsterByIdB

Get detailed information about a specific monster by ID

ParametersJSON Schema
NameRequiredDescriptionDefault
monsterIdYesID of the monster to retrieve

TDQS

B3.1/5.0
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 of behavioral disclosure. It states the tool retrieves 'detailed information' but doesn't specify what that includes (e.g., stats, abilities, weaknesses), whether it's a read-only operation, error handling for invalid IDs, or performance characteristics like rate limits. This leaves significant gaps for agent understanding.

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

Conciseness5/5

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

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is front-loaded with the core action and resource, making it easy to parse quickly.

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

Completeness3/5

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

For a simple lookup tool with one parameter and no output schema, the description is minimally adequate. However, it lacks details on the returned data structure (e.g., what 'detailed information' entails) and behavioral aspects like error cases, which would help an agent use it correctly. The absence of annotations exacerbates these gaps.

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?

The schema description coverage is 100%, with the parameter 'monsterId' clearly documented as 'ID of the monster to retrieve'. The description adds no additional semantic context beyond what the schema provides, such as format examples or valid ranges. Given the high schema coverage, the baseline score of 3 is appropriate.

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 verb ('Get detailed information') and resource ('about a specific monster by ID'), making the purpose unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'getMonsterByName' or 'getMonsterByHabitat', which also retrieve monster information but use different identifiers.

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 'getMonsterByName' (for name-based lookup) or 'getMonsterByHabitat' (for habitat-based filtering), nor does it specify prerequisites such as needing a valid monster ID.

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

getMonsterByNameA

Get monsters by name (partial match, returns up to 5 matches)

ParametersJSON Schema
NameRequiredDescriptionDefault
nameYesName of the monster to search for (can be partial)

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses key behavioral traits: partial matching and a limit of 5 results, which are valuable beyond basic 'get' functionality. However, it lacks details on error handling, authentication needs, or rate limits, leaving gaps for a tool with no annotation coverage.

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

Conciseness5/5

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

The description is extremely concise and front-loaded: a single sentence that efficiently conveys the core functionality and key constraints. Every word earns its place, with no wasted text or redundancy.

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

Completeness3/5

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

Given the tool's low complexity (1 parameter, no output schema, no annotations), the description is minimally complete. It covers the basic operation and behavioral constraints but lacks details on output format or error cases. For a simple lookup tool, this is adequate but leaves room for improvement in contextual richness.

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 the schema already documents the 'name' parameter as 'Name of the monster to search for (can be partial).' The description adds no additional meaning beyond this, merely restating 'partial match.' Baseline 3 is appropriate as the schema handles parameter documentation adequately.

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: 'Get monsters by name' specifies the verb (get) and resource (monsters). It distinguishes from siblings like getMonsterById and getMonsters by focusing on name-based retrieval. However, it doesn't explicitly differentiate from getMonsterByHabitat, which is a similar lookup but by different criteria.

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

Usage Guidelines3/5

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

The description implies usage context through 'partial match, returns up to 5 matches,' suggesting it's for fuzzy name searches with result limits. However, it doesn't explicitly state when to use this versus alternatives like getMonsterById (exact ID match) or getMonsters (full list). No guidance on prerequisites or exclusions is provided.

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

getMonstersB

Get a list of monsters with optional filtering, sorting, and pagination

ParametersJSON Schema
NameRequiredDescriptionDefault
filtersNoOptional filters for the query
limitNoMaximum number of results to return (default: 10)
offsetNoNumber of results to skip for pagination (default: 0)
sortNoOptional sorting parameters

TDQS

B3.2/5.0
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 of behavioral disclosure. It mentions filtering, sorting, and pagination but doesn't describe important traits like whether this is a read-only operation, what happens with invalid filters, rate limits, authentication requirements, or the format of returned results. For a list retrieval tool with zero annotation coverage, this leaves significant gaps.

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

Conciseness5/5

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

The description is a single, efficient sentence that front-loads the core purpose ('Get a list of monsters') and then succinctly lists the key capabilities. Every word earns its place with no redundancy or unnecessary elaboration.

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?

Given no annotations and no output schema, the description is incomplete for a tool with four parameters and nested objects. It doesn't explain what the returned list looks like, how errors are handled, or important behavioral aspects like default values or constraints. For a list retrieval tool with filtering capabilities, more context is needed to be fully helpful.

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 the schema already documents all four parameters thoroughly. The description adds minimal value by mentioning 'optional filtering, sorting, and pagination' which aligns with the schema but doesn't provide additional semantic context beyond what's already in the parameter descriptions. This meets the baseline for high schema coverage.

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 verb ('Get') and resource ('list of monsters'), making the purpose immediately understandable. It distinguishes itself from siblings like getMonsterById or getMonsterByName by indicating it returns a list rather than a single entity. However, it doesn't explicitly differentiate from getMonsterByHabitat which also involves filtering.

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

Usage Guidelines3/5

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

The description implies usage through 'optional filtering, sorting, and pagination', suggesting this tool is for general queries rather than specific lookups. However, it doesn't explicitly state when to use this versus alternatives like getMonsterByHabitat or getMonsterById, nor does it provide any exclusions or prerequisites for usage.

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

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 6 tool updatesv1.0.0
    • First observedadd
    • First observedgetHabitats
    • First observedgetMonsterByHabitat
    • First observedgetMonsterById
    • First observedgetMonsterByName
    • First observedgetMonsters

TDQS

B3.2/5.0

Scored across 6 tools

Disambiguation4/5

Most tools have distinct purposes, but 'getMonsterByHabitat' and 'getMonsters' could cause confusion since both retrieve monsters with filtering capabilities. The descriptions clarify that 'getMonsterByHabitat' is for exact habitat matching while 'getMonsters' offers broader filtering, but agents might still misselect between them.

Naming Consistency3/5

The naming is mixed with inconsistent patterns: 'add' uses a generic verb, 'getHabitats' and 'getMonsters' follow a verb_noun plural pattern, while 'getMonsterByHabitat', 'getMonsterById', and 'getMonsterByName' use a verb_noun_preposition format. This creates readability but lacks uniformity across all tools.

Tool Count4/5

With 6 tools, the count is reasonable for a PostgreSQL-based monster database server. It covers core operations like adding data and querying monsters in various ways, though it might benefit from additional tools for updates or deletions to be fully scoped.

Completeness3/5

The tool set covers querying and adding data well, but there are notable gaps for a database server: no update or delete tools for monsters or habitats, and no tool for creating habitats. This limits full lifecycle management and could cause agent failures in more complex workflows.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • -
    license
    Not graded
    quality
    C
    maintenance
    An MCP server that bridges AI assistants with SQL databases, enabling natural language querying across multiple database types with built-in optimization and security.
    3
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    Config-driven MCP server that gives AI scoped, auditable database access without exposing the entire database.
    5 npm
    6
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    A read-only MCP server that exposes SQL database access to LLMs, supporting multiple database types, compact columnar results, pagination, and file export.
    7
    28 npm
    MIT