Skip to main content
Glama
Jojeda96

MCP Analytics Server

by Jojeda96

MCP Analytics Server

Python SDK Database Validation Code Style Type Checked Spec-Driven License: MIT

A production-grade Model Context Protocol (MCP) server built in Python that exposes typed, deterministic, and security-guarded analytical tools over a business dataset stored in DuckDB.

An external AI agent (e.g. GPT through the OpenAI Agents SDK, Claude Desktop, or Cursor) can dynamically discover and execute analytical queries without needing direct database access or running unconstrained SQL.


โœจ Key Highlights

  • Python-First MCP Server: Fully compliant with the official Model Context Protocol standard over stdio.

  • Model-Agnostic Architecture: The server contains no LLM inside. It exposes clean, deterministic tool contracts that any MCP-compatible agent can invoke.

  • Embedded Columnar Analytics: Powered by DuckDB for fast, efficient columnar aggregations on normalized enterprise data.

  • AST-Based SQL Guard: Uses sqlglot to parse and validate ad-hoc queries, strictly allowing read-only SELECT statements and eliminating SQL injection or mutation risks.

  • Strict Typed Contracts: All responses are validated through Pydantic v2 models before reaching the client.

  • Interactive GPT Demo Client: Out-of-the-box demonstration agent leveraging the OpenAI Agents SDK and evidence-based reasoning prompts.

  • Spec-Driven Development: Engineered incrementally using OpenSpec for complete requirements traceability.


Related MCP server: databricks-mcp

๐Ÿ›๏ธ System Architecture

flowchart TD
    User([User]) <--> Agent[GPT Agent / OpenAI Agents SDK]
    Agent <-->|MCP Protocol / stdio| Server[MCP Analytics Server]

    subgraph Server_Internal [MCP Analytics Server Boundary]
        Server --> Tools[Tool Layer]
        Tools --> DataTools[Dataset Tools]
        Tools --> ChurnTools[Churn Analytics Tools]
        Tools --> SQLTool[Read-Only SQL Tool]

        SQLTool --> SQLGuard[SQL Guard Security Layer]
        DataTools --> AnalyticsSvc[AnalyticsService]
        ChurnTools --> AnalyticsSvc
        SQLGuard --> DBSvc[DatabaseService]
        AnalyticsSvc --> DBSvc

        DBSvc --> DuckDB[(DuckDB)]
    end

    DuckDB --> Table[(customers Table - Telco Dataset)]

๐Ÿ›ก๏ธ Safe SQL Execution & Security Boundaries

Any SQL input received from an AI agent is treated as untrusted input. The server enforces strict AST validation via sqlglot before query execution:

Allowed Operations:
  โœ… SELECT contract, AVG(monthly_charges) FROM customers GROUP BY contract
  โœ… WITH cohorts AS (SELECT * FROM customers WHERE tenure > 24) SELECT COUNT(*) FROM cohorts

Blocked Operations:
  โŒ DELETE FROM customers WHERE churn = true        (Mutation Rejected)
  โŒ DROP TABLE customers                             (DDL Rejected)
  โŒ SELECT * FROM customers; DROP TABLE customers    (Multi-statement Rejected)
  โŒ ATTACH 'external.db'                             (Engine I/O Rejected)
  • Row Limit Guard: Ad-hoc queries are capped at MAX_RESULT_ROWS = 100 to protect the agent's context window.

  • Table Allowlists: Only authorized analytics tables (customers) can be queried.


๐Ÿงฐ MCP Tools Catalog

Tool Name

Purpose

Key Parameters

Return Type

get_dataset_info

High-level dataset metadata, row and column counts, primary table name, target variable.

None

DatasetInfo

list_columns

Schema inspection returning all available columns and their database data types.

None

list[ColumnInfo]

describe_column

Statistical metrics (min, max, mean, median) for numeric columns, or category distributions for categorical columns.

column: str

NumericColumnDescription / CategoricalColumnDescription

get_churn_summary

Overall customer count, churned count, retained count, and historical churn rate in [0.0, 1.0].

None

ChurnSummary

get_churn_by_dimension

Segmented churn metrics grouped by an approved dimension (contract, internet_service, payment_method, etc.).

dimension: str

DimensionChurnResult

run_readonly_sql

Guarded analytical SQL execution for complex custom calculations not covered by standard tools.

query: str

SQLResult


๐Ÿš€ Quickstart Guide

1. Prerequisites

  • Python 3.11+

  • Git

2. Installation

# Clone repository
git clone https://github.com/Jojeda96/mcp-analytics-server.git
cd mcp-analytics-server

# Create and activate virtual environment
python -m venv .venv
source .venv/bin/activate  # On Windows: .\.venv\Scripts\Activate.ps1

# Install in editable mode with development tools
pip install -e ".[dev]"

3. Build Analytics Database

# Ingest raw Telco CSV, validate schema, normalize, and build DuckDB
python scripts/build_database.py

4. Run the MCP Server

# Run server standalone over stdio
mcp-analytics
# or
python -m mcp_analytics.server

5. Run the Interactive GPT Demo Client

Configure your OpenAI API key in .env:

cp .env.example .env
# Edit .env and set OPENAI_API_KEY=sk-...

Run the interactive demo:

# Interactive REPL mode
python client/gpt_demo.py

# Or evaluate all 10 standard demonstration questions in batch
python client/gpt_demo.py --all-examples

๐Ÿ”Œ Connecting to MCP Clients

Claude Desktop / Cursor

Add the following configuration to your claude_desktop_config.json or Cursor MCP settings:

{
  "mcpServers": {
    "telco-analytics": {
      "command": "python",
      "args": ["-m", "mcp_analytics.server"],
      "cwd": "/absolute/path/to/mcp-analytics-server",
      "env": {
        "DUCKDB_PATH": "data/processed/telco.duckdb",
        "LOG_LEVEL": "INFO",
        "MAX_RESULT_ROWS": "100"
      }
    }
  }
}

๐Ÿงช Testing & Quality Assurance

# Run complete test suite (Unit & Integration) with coverage
pytest --cov=src --cov-report=term-missing

# Run Ruff linter and formatter checks
ruff check .
ruff format --check .

# Run static type checking
mypy src client scripts tests

๐Ÿ“ Development Workflow (OpenSpec)

This project was developed following Spec-Driven Development (SDD) with OpenSpec. Every capability is tracked through explicit proposals, delta specs, design documents, and verifiable tasks:

openspec/
โ”œโ”€โ”€ specs/                          # Consolidated capabilities
โ”‚   โ”œโ”€โ”€ project-foundation/
โ”‚   โ”œโ”€โ”€ telco-data-foundation/
โ”‚   โ”œโ”€โ”€ core-analytics-service/
โ”‚   โ”œโ”€โ”€ core-mcp-tools/
โ”‚   โ”œโ”€โ”€ safe-readonly-sql-tool/
โ”‚   โ”œโ”€โ”€ openai-gpt-demo-client/
โ”‚   โ””โ”€โ”€ portfolio-hardening/
โ””โ”€โ”€ changes/archive/                # Historical change audit trail

๐Ÿ“‚ Project Structure

mcp-analytics-server/
โ”œโ”€โ”€ .github/workflows/ci.yml       # GitHub Actions CI matrix pipeline
โ”œโ”€โ”€ assets/                        # Diagrams and visual assets
โ”œโ”€โ”€ client/
โ”‚   โ””โ”€โ”€ gpt_demo.py                # Interactive OpenAI Agents SDK demo client
โ”œโ”€โ”€ data/
โ”‚   โ”œโ”€โ”€ raw/                       # Source CSV files
โ”‚   โ””โ”€โ”€ processed/                 # Generated DuckDB database
โ”œโ”€โ”€ docs/
โ”‚   โ”œโ”€โ”€ architecture.md            # Deep-dive architecture and layers
โ”‚   โ”œโ”€โ”€ security.md                # Threat model and AST SQL Guard details
โ”‚   โ””โ”€โ”€ decisions.md               # Architecture Decision Records (ADRs)
โ”œโ”€โ”€ examples/
โ”‚   โ”œโ”€โ”€ questions.md               # 10 evaluated demo business questions
โ”‚   โ””โ”€โ”€ mcp-config.example.json    # Standard client configuration
โ”œโ”€โ”€ scripts/
โ”‚   โ”œโ”€โ”€ download_dataset.py        # Dataset provenance & download instructions
โ”‚   โ”œโ”€โ”€ validate_dataset.py        # Strict raw data schema & domain validator
โ”‚   โ””โ”€โ”€ build_database.py          # Data cleaner and DuckDB table builder
โ”œโ”€โ”€ src/mcp_analytics/
โ”‚   โ”œโ”€โ”€ config.py                  # Pydantic Settings and environment config
โ”‚   โ”œโ”€โ”€ errors.py                  # Domain exception hierarchy
โ”‚   โ”œโ”€โ”€ server.py                  # MCP server lifecycle and CLI entrypoint
โ”‚   โ”œโ”€โ”€ schemas/                   # Pydantic response models
โ”‚   โ”œโ”€โ”€ security/                  # AST SQLGuard parser
โ”‚   โ”œโ”€โ”€ services/                  # DatabaseService & AnalyticsService
โ”‚   โ””โ”€โ”€ tools/                     # Dataset, Analytics & SQL MCP tools
โ”œโ”€โ”€ tests/
โ”‚   โ”œโ”€โ”€ fixtures/                  # Curated sample CSV test fixtures
โ”‚   โ”œโ”€โ”€ unit/                      # Fast unit tests for logic and security
โ”‚   โ””โ”€โ”€ integration/               # Database and MCP tool integration tests
โ”œโ”€โ”€ Dockerfile                     # Containerization recipe
โ”œโ”€โ”€ pyproject.toml                 # Package definition & tool configs
โ”œโ”€โ”€ CHANGELOG.md                   # Version release notes
โ”œโ”€โ”€ LICENSE                        # MIT License
โ””โ”€โ”€ README.md

๐Ÿ“„ License

This project is licensed under the MIT License โ€” see the LICENSE file for details.

Available Tools

6 tools
describe_columnB

Provides statistical summaries for a specified column in the customers table. For numeric columns, returns min, max, mean, median, and null count. For categorical columns, returns unique category count and top frequent categories.

ParametersJSON Schema
NameRequiredDescriptionDefault
columnYes

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

B3.2/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 of behavioral disclosure. It does disclose the primary behavior: numeric columns yield min, max, mean, median, null count; categorical columns yield unique count and top categories. This is helpful and beyond what a schema typically states. However, it does not mention edge cases (e.g., missing column, mixed types), error behavior, or limits on 'top frequent categories', leaving some uncertainty.

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?

Two sentences, both front-loaded with the core purpose. The numeric vs categorical distinction is presented efficiently without filler. Every word adds value, and the structure is ideal for quick agent scanning.

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?

The tool has an output schema (not shown here), which reduces the need to describe return formats. The description covers the main cases and tells the agent what to expect. Minor gaps remain: no mention of read-only nature, error handling, or behavior on non-existent columns. For a simple one-parameter tool, this is nearly complete, hence a 4.

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

Parameters2/5

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

The schema has 0% description coverage for the 'column' parameter (no description, no enum), so the description must compensate. It only states 'a specified column in the customers table', which adds minimal meaning beyond the parameter name itself. It does not explain that the column must exist, expected data types, or how invalid columns are handled. Given the low schema coverage, this is inadequate.

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

Purpose4/5

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

The description states that it 'Provides statistical summaries for a specified column in the customers table,' clearly identifying the resource (customers table column) and the deliverable (statistical summaries). It distinguishes itself from siblings like list_columns (which lists columns) and run_readonly_sql (which runs arbitrary queries) by its focus on computed summaries, and the numeric/categorical breakdown adds specificity. However, the verb 'provides' is generic; 'computes' or 'returns' would be stronger.

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?

No explicit guidance is given on when to use this tool versus alternatives. It implies usage by describing what it returns, but does not mention siblings like run_readonly_sql or get_dataset_info as alternatives, nor suggest trade-offs. An agent must infer that this is the right choice for column-level statistics, which is not guaranteed given the sibling list includes a generic SQL tool.

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

get_churn_by_dimensionA

Calculates customer count, churned customer count, and historical churn rate grouped by one approved categorical dimension such as contract, internet_service, payment_method, paperless_billing, tech_support, online_security, etc.

ParametersJSON Schema
NameRequiredDescriptionDefault
dimensionYes

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.8/5.0
Behavior2/5

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

With no annotations, the description carries full responsibility for behavioral disclosure. It states the calculation output but does not mention whether the operation is read-only, how it handles invalid dimensions, whether results are sorted, or any pagination/limits. The phrase 'approved categorical dimension' hints at a validate set but does not specify behavior on unapproved input. This is insufficient for a tool with zero 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 a single sentence that front-loads the core action ('Calculates customer count, churned customer count, and historical churn rate') and then immediately provides examples. There is no filler or redundant wording; every clause adds value.

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 only one simple parameter and an output schema exists (as indicated by context), the description covers the essential elements: what metrics are returned and what type of input is expected. The only notable gap is the lack of a complete list of approved dimensions, which the output schema may not address. Overall, it is sufficient for a straightforward analytical tool.

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 schema provides only a bare string parameter with no description (0% coverage). The description adds significant meaning by listing valid example values (contract, internet_service, payment_method, etc.) and clarifying that grouping is by a single approved categorical dimension. This helps the agent choose appropriate values, though it does not enumerate the full allowed set or specify where to find it, so it falls short of a 5.

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 the verb 'calculates' and the resource 'churn metrics' grouped by a categorical dimension. It lists specific output metrics (customer count, churned customer count, historical churn rate) and provides multiple concrete dimension examples, making the tool's purpose unambiguous and distinct from a general summary tool.

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 when to use the tool (when you need churn metrics grouped by a categorical dimension) by listing example dimensions, but it does not explicitly mention alternatives such as get_churn_summary for overall churn or describe_column for column analysis. It lacks an explicit when-not-to-use or comparison to siblings, leaving some routing to inference.

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

get_churn_summaryA

Calculates overall customer count, churned customer count, retained customer count, and historical churn rate across the entire Telco dataset. Churn rate is returned as a ratio between 0.0 and 1.0.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.3/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. It states what is computed and that churn rate is returned as a ratio between 0.0 and 1.0, but does not explicitly confirm read-only behavior or any potential performance implications. The nature of a summary tool makes this minor, but a 3 is appropriate given the lack of explicit safety disclosure.

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, front-loaded sentence that immediately states purpose and output format. No redundant words or filler.

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

Completeness5/5

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

For a simple, parameter-less tool with an output schema, the description covers the key return values (counts, rate) and their format (ratio 0-1). Agents have everything needed to call it correctly.

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?

With zero parameters, the schema is trivially fully covered. The description adds no parameter-specific details because none are needed, meeting the baseline of 4 for parameter-less tools.

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?

Clearly states the verb 'calculates' and enumerates specific outputs (customer count, churned count, retained count, historical churn rate) across the entire dataset, distinguishing it from sibling get_churn_by_dimension which presumably breaks down churn by dimensions.

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?

Makes the scope explicit ('across the entire Telco dataset'), implying it is the tool for overall metrics. However, it does not explicitly contrast with alternatives like get_churn_by_dimension or mention when not to use it, so it stops short of a full 5.

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

get_dataset_infoA

Returns high-level metadata for the Telco Customer Churn dataset, including the available analytics table, row count, column count and target variable. Use this tool before deeper analysis when dataset context is unknown.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.3/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 discloses the output content (metadata) but does not mention whether the operation is read-only (implied by 'get'), or any side effects or error conditions. For a simple metadata retrieval tool, this is acceptable but not enriched beyond the obvious.

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 front-loads the core function ('Returns high-level metadata'), then lists specific items, and ends with a usage recommendation. No redundant words or filler.

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

Completeness5/5

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

Given the zero-parameter signature and the presence of an output schema (which covers return format), the description provides all necessary context: what the tool does, what it returns, and when to use it. Nothing an agent needs to invoke it correctly is missing.

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?

There are zero parameters, and the schema has no properties, so schema coverage is trivially 100%. Per the rubric, the baseline for 0 parameters is 4. The description adds value by explicitly enumerating what the returned metadata includes, which is not captured by the empty schema.

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 what the tool does: returns high-level metadata for the Telco Customer Churn dataset, specifying the exact items included (available analytics table, row count, column count, target variable). It is distinct from sibling tools like list_columns and describe_column, which operate at a different granularity.

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 includes an explicit usage directive: 'Use this tool before deeper analysis when dataset context is unknown.' This provides clear context on when to invoke it, though it does not explicitly mention alternatives or when not to use it. Still, the guidance is actionable and sufficient for an agent to decide.

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

list_columnsA

Lists all available columns in the customers dataset along with their data types. Use this tool to discover available fields before running specific column queries.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.7/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. It states the tool lists columns and data types, which implies a read-only operation, but does not explicitly declare side effects, authentication needs, or any limitations. For a simple listing tool this is acceptable, but more transparency (e.g., confirming no side effects) would be better.

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 sentences, both concise and purposeful. The main functionality is front-loaded, and the usage tip adds value without repetition. No filler or ambiguity.

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 there is an output schema (not shown but indicated), the description need not explain return values. It covers what the tool does and when to use it. Minor absence of any note about performance or dataset-specific nuance, but overall adequate for a no-parameter, discovery-focused tool.

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, so the baseline is 4. The schema is trivially complete, and there is no parameter semantics to add. The description correctly focuses on the tool's purpose rather than 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 action (list), resource (all columns in the customers dataset), and includes the data type output. It also implies a discovery role before column-specific queries. However, it does not explicitly differentiate from sibling tools like get_dataset_info, which might also return column list, so it lacks direct 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 Guidelines3/5

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

It provides a clear when-to-use hint: 'before running specific column queries.' But it does not mention when not to use it or explicitly reference alternative tools (e.g., describe_column or get_dataset_info). The guidance is sufficient for a simple tool but lacks exclusionary guidance.

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

run_readonly_sqlA

Executes one read-only analytical SQL query against the customers dataset. Use this tool only when the predefined analytics tools cannot answer the requested question. Mutation, DDL and multi-statement queries are strictly rejected by security boundaries. Results are capped at a maximum of 100 rows.

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYes

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.9/5.0
Behavior5/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 discloses that the tool is read-only, rejects mutation/DDL/multi-statement queries, and caps results at 100 rows. These are critical behavioral traits that an agent needs to know before invoking the tool, and they are all explicitly stated.

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?

Three sentences, each carrying necessary information. The primary purpose is stated first, followed by usage guidance and security/result constraints. There is no redundancy or fluff; every sentence earns its place in the description.

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

Completeness5/5

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

Given the tool's role as a fallback SQL execution tool, the description covers all essential aspects: orientation to the dataset, usage restrictions, security boundaries, and result cap. An output schema exists (though not shown here), so the description needn't detail return formats. The description is complete for an agent to correctly decide when to use and how to invoke this tool.

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 schema has one parameter 'query' with zero description coverage. The description adds meaning by clarifying it is a SQL query, which matches the tool's purpose. Since there is only one parameter and it's inherently obvious from the tool name and description, the added context is sufficient, though it doesn't provide syntax examples or formatting details that could further enhance value.

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 ('executes'), a clear resource ('customers dataset'), and the read-only analytical nature of the query. It also explicitly positions it relative to sibling tools by stating it is only for when predefined analytics tools cannot answer, which clearly differentiates it from the listed siblings like get_churn_summary and describe_column.

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 explicitly states 'Use this tool only when the predefined analytics tools cannot answer the requested question', giving a precise when-to-use condition. It also implies when not to use (when predefined tools suffice) and lists security restrictions (mutation, DDL, multi-statement queries are rejected), providing clear operational boundaries.

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. 6 tool updatesv1.0.0
    • First observeddescribe_column
    • First observedget_churn_by_dimension
    • First observedget_churn_summary
    • First observedget_dataset_info
    • First observedlist_columns
    • First observedrun_readonly_sql

TDQS

A4.1/5.0
Disambiguation5/5

Each tool serves a distinct purpose: dataset overview, column discovery, column statistics, overall churn summary, grouped churn analysis, and custom SQL fallback. The overlap between churn summary and churn by dimension is clearly differentiated by the latter's grouping parameter, and SQL is explicitly a last resort. No ambiguity remains for the agent.

Naming Consistency5/5

All tools follow a consistent verb_noun snake_case pattern: get_dataset_info, list_columns, describe_column, get_churn_summary, get_churn_by_dimension, run_readonly_sql. The verbs (get, list, describe, run) and noun phrases (dataset_info, columns, column, churn_summary, etc.) are uniform, creating a predictable and readable API surface.

Tool Count5/5

With 6 tools, the server is well-scoped for its purpose of analyzing a single churn dataset. Each tool addresses a distinct analytical need, and none feel redundant or extraneous. The count sits comfortably within the ideal 3-15 range.

Completeness5/5

The tool set covers the full analytics lifecycle: discovery (dataset info, columns), exploration (describe column), summary statistics (churn summary), dimension breakdowns (churn by dimension), and arbitrary ad-hoc queries (SQL fallback). The inclusion of read-only SQL ensures no analytical question remains unanswered, making the surface effectively complete for a read-only analytics server.

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
    B
    quality
    C
    maintenance
    Enables LLMs to interact with DuckDB databases through MCP tools for SQL queries, table management, data import/export, and schema inspection, with optional read-only mode for safety.
    12
    MIT
  • F
    license
    Not graded
    quality
    C
    maintenance
    Enables running read-only SQL queries and exploring DuckDB databases through MCP tools like listing tables, describing schemas, and fetching paginated data.
    -
  • A
    license
    A
    quality
    C
    maintenance
    A read-only DuckDB MCP server offering context-efficient analytics tools (list_datasets, describe_table, profile_column, explain, query) with a semantic layer for business rules, security guards, and disclosed truncation to help LLMs produce correct answers while minimizing token usage.
    5
    MIT

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/Jojeda96/mcp-analytics-server'

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