Skip to main content
Glama
eneidyscastellano

smart-retail-mcp

🤖 Smart Retail MCP Server

Tool server based on Model Context Protocol (MCP) that provides predictive inventory analysis capabilities to AI agents.

Available Tools

Tool

Description

get_current_stock

Gets the current inventory of all products along with supplier delivery times

get_sales_velocity

Calculates the average daily sales velocity per product over the last N days

create_ai_recommendation

Creates restocking alerts when stock will run out before the next delivery

Related MCP server: Inventory Management AI MCP

Architecture

src/
├── index.ts   → Definición e implementación de herramientas MCP (stdio transport)
├── db.ts      → Pool de conexión a PostgreSQL
└── seed.ts    → Script para insertar datos de prueba

Configuration

Environment variables (.env)

DATABASE_URL=postgresql://usuario:password@localhost:5432/smart_retail

Scripts

npm start      # Ejecutar el servidor MCP
npm run dev    # Desarrollo con hot-reload (tsx watch)
npm run seed   # Insertar datos de prueba
npm run build  # Compilar TypeScript

Dependencies

  • @modelcontextprotocol/sdk — Official MCP SDK

  • pg — PostgreSQL client

  • dotenv — Environment variables

Communication

The server communicates via stdio (stdin/stdout). The Next.js frontend starts it as a child process using StdioClientTransport from the MCP SDK. It does not expose HTTP ports.

License

ISC

Available Tools

3 tools
create_ai_recommendationA

Crea una alerta de reabastecimiento en la base de datos cuando detectas que el stock se agotará antes de que el proveedor pueda entregar.

ParametersJSON Schema
NameRequiredDescriptionDefault
reasonYesExplicación lógica de por qué se necesita esta compra
product_idYesEl UUID del producto
recommended_order_qtyYesCantidad sugerida a comprar

TDQS

A4/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It clearly communicates that this tool creates and persists a restocking alert, making the mutation obvious. However, it does not disclose side effects like duplicate alert handling, idempotency, or authorization requirements.

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 well-structured sentence that fronts the action, the object, and the trigger condition. There is no redundant or filler content.

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 low complexity (3 required flat parameters, no output schema), the description plus schema provides enough information to call the tool correctly. It also gives the business context for when the alert should be created. It could be slightly stronger with an explicit statement about what the tool returns or whether duplicates are prevented, but that is not essential for a basic create operation.

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 input schema already fully documents all three parameters. The description adds no parameter-specific detail beyond the overall purpose, but it does not need to because the schema descriptions are sufficient.

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 states a specific verb ('Crea'), a concrete resource ('una alerta de reabastecimiento en la base de datos'), and the triggering condition for its use. It clearly distinguishes itself from the read-only sibling tools get_current_stock and get_sales_velocity.

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

Usage Guidelines4/5

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

The description gives an explicit when-to-use condition: when stock will run out before the supplier can deliver. It does not explicitly state when not to use it or name alternatives, though the sibling names make the contrast apparent.

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

get_current_stockA

Obtiene los niveles actuales de inventario de todos los productos y los tiempos de entrega del proveedor.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. 'Obtiene' and 'actuales' suggest a read-only, point-in-time snapshot, but there is no mention of authentication, response structure, data freshness guarantees, or error behavior. This is minimally informative but not misleading.

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?

A single sentence communicates the full scope of the tool without redundancy. Every word contributes meaning, and the main subject (inventory levels) appears early.

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?

For a no-input read tool, the description is largely complete: it states what is returned and for whom. The only notable gap is the lack of an output schema or explicit description of the response format, but the conceptual content is clear.

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 tool has zero parameters and the schema already reflects that with an empty properties object. The description correctly focuses on what data is returned rather than explaining parameters, which are absent.

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 uses a specific verb ('Obtiene') and clearly identifies the resource: current inventory levels for all products plus supplier delivery times. This makes the tool's purpose distinct from sibling get_sales_velocity and create_ai_recommendation.

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 the tool should be used when current inventory or supplier lead times are needed, but it does not explicitly state when to prefer it over alternatives or when not to use it. No comparison with sibling tools is provided.

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

get_sales_velocityA

Calcula el promedio de ventas diarias de los productos en los últimos X días. Útil para predecir cuándo se agotará el stock.

ParametersJSON Schema
NameRequiredDescriptionDefault
daysYesNúmero de días hacia atrás para analizar (ej. 7, 15, 30)

TDQS

A3.9/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 burden of explaining behavior. It conveys that this is a calculation over a trailing window of days, but it does not disclose output granularity, aggregation behavior, or how products with no sales are handled. The core action is clear, but behavioral detail is limited.

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 two short sentences, front-loaded with the core action and followed by a practical purpose. Every phrase earns its place and there is no redundancy or filler.

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 one-parameter calculation tool, the description covers the core calculation and the intended use. However, without an output schema, it leaves ambiguity about whether the returned average is per product or an aggregate across all products, and it does not explicitly differentiate use cases from get_current_stock.

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%, and the schema already documents 'days' with examples (7, 15, 30). The description only restates the concept of 'últimos X días' without adding semantic detail beyond the schema, so the baseline score of 3 applies.

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 states a specific computation ('Calcula el promedio de ventas diarias de los productos') and pairs it with a clear use case ('predecir cuándo se agotará el stock'). This distinguishes it from siblings like get_current_stock, which concerns current inventory levels, and create_ai_recommendation, which generates recommendations.

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

Usage Guidelines4/5

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

The description gives a clear context for when to use the tool: when forecasting stock depletion based on recent sales velocity. It does not explicitly name sibling tools or provide exclusion criteria, but the practical use case is sufficient guidance for this simple tool.

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. Dates show when Glama detected each change.

  1. 3 tool updatesv1.0.0
    • First observedcreate_ai_recommendation
    • First observedget_current_stock
    • First observedget_sales_velocity

TDQS

A4/5.0
Disambiguation5/5

Each tool targets a distinct inventory concern: current stock and lead times, sales velocity, and creating restock alerts. There is no meaningful overlap, so an agent can select the correct tool without ambiguity.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern: get_current_stock, get_sales_velocity, create_ai_recommendation. The naming is predictable and clear.

Tool Count4/5

Three tools is at the low end, but each tool has a clear role in the inventory-alerting workflow. The count feels appropriate for a narrow purpose, though the broad server name could imply more coverage.

Completeness2/5

The set covers the input side well, but create_ai_recommendation is a create-only operation with no way to list, update, or delete existing recommendations. This leaves agents with a dead end for managing alert state.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    An MCP server for supply chain intelligence that enables conversational querying of eight operational KPIs and anomaly detection data through Claude. It allows users to analyze performance metrics like OTIF and inventory turnover while providing LLM-generated root-cause explanations.
    11
    MIT
  • F
    license
    A
    quality
    D
    maintenance
    MCP server for querying inventory items and stock levels via internal API, enabling AI chatbots to look up product codes and current quantities.
    2
    -

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/eneidyscastellano/smart-retail-mcp'

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