Skip to main content
Glama
LostInBrittany

RAGmonsters Custom PostgreSQL MCP Server

Servidor MCP PostgreSQL personalizado para RAGmonsters

Descripción general

Este repositorio demuestra un enfoque más avanzado para la integración de Modelos de Lenguaje Grandes (LLM) con bases de datos mediante el Protocolo de Contexto de Modelo (MCP). Si bien los servidores PostgreSQL MCP genéricos permiten a los LLM explorar bases de datos mediante consultas SQL sin procesar, este proyecto adopta un enfoque diferente al crear un servidor MCP personalizado que proporciona una API específica del dominio, adaptada a las necesidades de la aplicación.

Esta implementación utiliza FastMCP , una implementación de alto rendimiento del Protocolo de contexto de modelo, que proporciona mayor eficiencia y confiabilidad para las interacciones basadas en herramientas con LLM.

Este proyecto se basa en el conjunto de datos RAGmonsters . RAGmonsters es un proyecto de código abierto que proporciona un rico conjunto de datos ficticios de monstruos con diversos atributos, habilidades y relaciones, diseñado específicamente para demostrar y probar sistemas de Generación Aumentada por Recuperación (RAG).

El problema con el acceso genérico a bases de datos MCP

Los servidores PostgreSQL MCP genéricos proporcionan a los LLM una herramienta query que les permite:

  • Explorar esquemas de bases de datos

  • Formular consultas SQL basadas en preguntas en lenguaje natural

  • Ejecutar esas consultas contra la base de datos

Si bien este enfoque funciona, tiene varias limitaciones para las aplicaciones del mundo real:

  • Carga cognitiva : El LLM debe comprender todo el esquema de la base de datos

  • Ineficiencia : a menudo se necesitan múltiples consultas SQL para responder una sola pregunta

  • Preocupaciones de seguridad : el acceso a SQL sin procesar requiere una ingeniería rápida y cuidadosa para evitar ataques de inyección

  • Rendimiento : Las consultas complejas pueden resultar ineficientes si el LLM no comprende la estrategia de indexación de la base de datos.

  • Brecha de conocimiento del dominio : el LLM carece de comprensión de las reglas comerciales y las limitaciones específicas del dominio

Acerca del conjunto de datos RAGmonsters

RAGmonsters es un conjunto de datos abierto diseñado específicamente para probar y demostrar sistemas de Recuperación-Generación Aumentada (RAG). Contiene información sobre monstruos ficticios con atributos, habilidades y relaciones complejos, lo que lo hace ideal para demostraciones de consultas en lenguaje natural.

La versión PostgreSQL de RAGmonsters proporciona una base de datos relacional bien estructurada con múltiples tablas y relaciones, que incluyen:

  • Monstruos con varios atributos (poder de ataque, defensa, salud, etc.)

  • Habilidades que pueden poseer los monstruos

  • Elementos (fuego, agua, tierra, etc.) con relaciones complejas

  • Hábitats donde se pueden encontrar monstruos

  • Cadenas evolutivas y relaciones entre monstruos

Este rico conjunto de datos interconectados es ideal para demostrar el poder de las API específicas del dominio frente al acceso SQL genérico.

Nuestra solución: API MCP específica del dominio

Este proyecto demuestra cómo crear un servidor MCP personalizado que proporciona una API de alto nivel y específica del dominio para el conjunto de datos RAGmonsters. En lugar de exponer capacidades SQL sin procesar, nuestro servidor MCP ofrece funciones específicas que:

  1. Complejidad de la base de datos abstracta : ocultar el esquema subyacente y los detalles de SQL

  2. Proporcionar operaciones específicas del dominio : ofrecer funciones que se alineen con los conceptos comerciales

  3. Optimizar para consultas comunes : Implementar patrones de consulta eficientes para preguntas frecuentes

  4. Aplicar reglas de negocio : incorporar lógica y restricciones específicas del dominio

  5. Mejore la seguridad : limite la superficie de ataque eliminando el acceso directo a SQL

Related MCP server: scopedb-mcp

Interfaz web

El proyecto incluye dos interfaces principales para interactuar con el conjunto de datos RAGmonsters:

Interfaz del explorador

Una interfaz centrada en datos para explorar y filtrar el conjunto de datos de RAGmonsters a través de la API de MCP:

  • Explora todos los monstruos filtrando por categoría, hábitat y rareza.

  • Ver información detallada sobre cada monstruo

  • Interfaz de usuario interactiva creada con Bootstrap

Interfaz de chat

Una interfaz de lenguaje natural para interactuar con el conjunto de datos RAGmonsters:

  • Haz preguntas sobre monstruos en lenguaje natural.

  • Obtenga respuestas con formato Markdown y formato enriquecido

  • Desarrollado con el patrón de agente ReAct de LangGraph

  • Integración perfecta con las herramientas MCP

Captura de pantalla de RAGmonsters Explorer

Esta interfaz permite a los usuarios:

  • Explorar todos los monstruos en el conjunto de datos

  • Filtrar monstruos por hábitat, categoría y rareza.

  • Ver información detallada sobre cada monstruo, incluidos poderes, habilidades, fortalezas y debilidades.

Ejemplo: API específica de dominio vs. SQL genérico

Enfoque genérico 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

Nuestro enfoque de servidor MCP personalizado:

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 })

Estructura del proyecto

├── .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

Características

  • Servidor MCP personalizado con FastMCP : API específica de dominio de alto rendimiento para datos de RAGmonsters

  • Consultas optimizadas : operaciones de base de datos eficientes y predefinidas

  • Capa de lógica empresarial : reglas y restricciones de dominio integradas en la API

  • Formato de respuesta estructurada : respuestas JSON consistentes para el consumo de LLM

  • Registro completo : registro detallado para depuración y supervisión

  • Conjunto de pruebas : scripts para verificar la funcionalidad del servidor y la integración de LLM

  • Integración LLM :

    • Integración de LangChain.js con OpenAI y otros proveedores de LLM compatibles

    • Patrón de agente ReAct de LangGraph para un uso eficiente de las herramientas

    • Manejo automático de llamadas y respuestas de herramientas

  • Interfaces web :

    • Interfaz de explorador para navegar y filtrar monstruos

    • Interfaz de chat con renderizado Markdown para interacción en lenguaje natural

Características

  • Integración con LangChain.js : interacciones LLM totalmente integradas con herramientas MCP

  • Interfaz web : Interfaces de explorador y chat para interactuar con el conjunto de datos RAGmonsters

  • Listo para implementación : configurado para una fácil implementación en plataformas como Clever Cloud

Beneficios de este enfoque

  1. Rendimiento mejorado : consultas optimizadas y estrategias de almacenamiento en caché

  2. Mejor experiencia de usuario : respuestas más precisas y rápidas

  3. Uso reducido de tokens : LLM no necesita procesar información compleja de SQL o esquemas

  4. Seguridad mejorada : la falta de acceso directo a SQL significa un menor riesgo de ataques de inyección

  5. Mantenibilidad : Los cambios en el esquema de la base de datos no requieren volver a entrenar el LLM.

  6. Escalabilidad : Puede manejar bases de datos más grandes y complejas

Empezando

Instalación

  1. Clonar este repositorio

  2. Instalar dependencias: npm install

  3. Copie .env.example a .env y configure su cadena de conexión PostgreSQL y las claves API de LLM

  4. Ejecute el script de prueba del servidor MCP: npm run test

  5. Ejecute el script de prueba de integración de LLM: npm run test:llm

  6. Iniciar el servidor: npm start

Herramientas disponibles

El servidor MCP proporciona las siguientes herramientas:

  1. getMonsters : obtenga una lista de monstruos con filtrado, clasificación y paginación opcionales

    • Parámetros: filtros (categoría, hábitat, rareza), ordenación (campo, dirección), límite, desplazamiento

    • Devuelve: Matriz de objetos monstruosos con información básica

  2. getMonsterById - Obtenga información detallada sobre un monstruo específico por ID

    • Parámetros: monsterId

    • Devoluciones: Objeto monstruo detallado con todos los atributos, poderes, habilidades, fortalezas y debilidades.

  3. add - Utilidad sencilla para sumar dos números (para probar)

    • Parámetros: a, b

    • Devuelve: Suma de los dos números

Arquitectura de integración LLM

Este proyecto utiliza un enfoque moderno para la integración de LLM con herramientas específicas del dominio:

Patrón de agente ReAct de LangGraph

La aplicación utiliza el patrón de agente ReAct (Razonamiento y Acción) de LangGraph, que:

  1. Procesa las consultas del usuario para comprender la intención.

  2. Determina qué herramientas utilizar en función de la consulta.

  3. Ejecuta automáticamente las herramientas adecuadas

  4. Sintetiza los resultados en una respuesta coherente

  5. Maneja el razonamiento de varios pasos cuando es necesario

Prueba de la integración de LLM

El proyecto incluye un script de prueba que demuestra cómo usar LangChain.js para integrar un LLM con el servidor MCP:

npm run test:llm

Este guión:

  1. Se conecta al servidor MCP mediante StdioClientTransport

  2. Carga todas las herramientas MCP disponibles utilizando los adaptadores MCP de LangChain

  3. Crea un agente LangChain con la API OpenAI

  4. Procesa una consulta en lenguaje natural sobre monstruos.

  5. Muestra cómo el LLM realiza llamadas a herramientas para recuperar información

  6. Registra información detallada sobre la interacción

Puede modificar las consultas de prueba en el script para explorar las diferentes capacidades del sistema. El script se encuentra en scripts/testLlmWithMcpServer.js .

Prerrequisitos

  • Node.js 23 o posterior

  • Base de datos PostgreSQL con datos de RAGmonsters

  • Acceso a una API LLM (por ejemplo, OpenAI)

  • Paquete FastMCP (incluido en las dependencias)

Variables de entorno

Crea un archivo .env con las siguientes variables:

# 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

Configuración de LLM

  • LLM_API_KEY : Su clave de API de OpenAI o clave de proveedor compatible

  • LLM_API_MODEL : El modelo a utilizar (predeterminado: gpt-4o-mini)

  • LLM_API_URL : El punto final de la API (predeterminado: el punto final de OpenAI)

La aplicación admite cualquier API compatible con OpenAI, incluidos modelos autohospedados y proveedores alternativos.

Implementación en Clever Cloud

Uso de la CLI de Clever Cloud

  1. Instalar la CLI de Clever Cloud:

    npm install -g clever-tools
  2. Inicie sesión en su cuenta de Clever Cloud:

    clever login
  3. Crear una nueva aplicación:

    clever create --type node <APP_NAME>
  4. Añade tu dominio (opcional pero recomendado):

    clever domain add <YOUR_DOMAIN_NAME>
  5. Cree un complemento de PostgreSQL y vincúlelo a su aplicación:

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

    Esto establecerá automáticamente la variable de entorno POSTGRESQL_ADDON_URI en su aplicación.

  6. Establezca las variables de entorno necesarias:

    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. Implemente su aplicación:

    clever deploy
  8. Abra su aplicación:

    clever open

Uso de la consola Clever Cloud

También puedes implementar directamente desde la consola Clever Cloud :

  1. Crear una nueva aplicación en la consola

  2. Seleccione Node.js como entorno de ejecución

  3. Cree un complemento de PostgreSQL y vincúlelo a su aplicación

  4. Establezca las variables de entorno necesarias en la consola:

    • LLM_API_KEY : Su clave API de OpenAI

    • LLM_API_MODEL : (opcional) El modelo a utilizar, el valor predeterminado es gpt-4o-mini

  5. Implemente su aplicación usando Git o la integración de GitHub

Notas importantes

  • Clever Cloud establece automáticamente la variable de entorno POSTGRESQL_ADDON_URI cuando vincula un complemento de PostgreSQL a su aplicación

  • La aplicación requiere Node.js 20 o posterior, que está disponible en Clever Cloud

  • La aplicación se ejecutará automáticamente en el puerto 8080, que es el puerto predeterminado para las aplicaciones Node.js en Clever Cloud.

Licencia

Este proyecto está licenciado bajo la licencia MIT: consulte el archivo de LICENCIA para obtener más detalles.

Expresiones de gratitud

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