Skip to main content
Glama
semanticintent

Semantic D1 MCP

Official

Semantic D1 MCP

License: MIT CI TypeScript Node.js Tests

Semantic Intent Hexagonal Architecture PRs Welcome

Reference implementation of Semantic Intent as Single Source of Truth patterns

A Model Context Protocol (MCP) server for Cloudflare D1 database introspection, demonstrating semantic anchoring, observable properties, and domain-driven design for AI-assisted database development.

πŸ“š Table of Contents

Related MCP server: Boyce

🎯 What Makes This Different

This isn't just another database introspection toolβ€”it's a reference implementation of proven semantic intent patterns:

  • βœ… Semantic Anchoring: Schema analysis based on meaning (table purpose, relationships), not technical metrics (row counts, sizes)

  • βœ… Observable Properties: Decisions anchored to directly observable schema markers (foreign keys, indexes, constraints)

  • βœ… Intent Preservation: Database semantics maintained through all transformations (development β†’ staging β†’ production)

  • βœ… Domain Boundaries: Clear semantic ownership (Schema Domain β‰  Query Optimization Domain β‰  MCP Protocol Domain)

Built on research from Semantic Intent as Single Source of Truth, this implementation demonstrates how to build maintainable, AI-friendly database tools that preserve intent.


πŸš€ Quick Start

Prerequisites

  • Node.js 20.x or higher

  • Cloudflare account with D1 databases

  • Cloudflare API token with D1 access

Installation

  1. Clone the repository

    git clone https://github.com/semanticintent/semantic-d1-mcp.git
    cd semantic-d1-mcp
  2. Install dependencies

    npm install
  3. Configure environment

    Copy the example configuration:

    cp .env.example .env

    Update .env with your Cloudflare credentials:

    # Cloudflare Configuration
    CLOUDFLARE_ACCOUNT_ID=your_cloudflare_account_id
    CLOUDFLARE_API_TOKEN=your_cloudflare_api_token
    
    # D1 Database Configuration - Development
    D1_DEV_DATABASE_ID=your_dev_database_id
    D1_DEV_DATABASE_NAME=your_dev_database_name
    
    # D1 Database Configuration - Staging (Optional)
    D1_STAGING_DATABASE_ID=your_staging_database_id
    D1_STAGING_DATABASE_NAME=your_staging_database_name
    
    # D1 Database Configuration - Production (Optional)
    D1_PROD_DATABASE_ID=your_prod_database_id
    D1_PROD_DATABASE_NAME=your_prod_database_name

    Note: At least one database environment must be configured.

  4. Build the server

    npm run build
  5. Start the MCP server

    npm start

    Or use the provided shell script:

    ./start-d1-mcp.sh

Get Cloudflare API Token

  1. Go to Cloudflare Dashboard

  2. Navigate to My Profile β†’ API Tokens

  3. Click Create Token

  4. Use the Edit Cloudflare Workers template

  5. Add D1 permissions: D1:Read

  6. Copy the token to your .env file

Get D1 Database IDs

# List all your D1 databases
wrangler d1 list

# Get specific database info
wrangler d1 info <database-name>

Copy the database IDs to your .env file.


πŸ› οΈ MCP Tools

This server provides 4 comprehensive MCP tools for D1 database introspection:

1. analyze_database_schema

Analyze complete database schema structure with metadata and optional sample data.

Parameters:

  • environment (required): "development" | "staging" | "production"

  • includeSamples (optional, default: true): Include sample data from tables

  • maxSampleRows (optional, default: 5): Maximum rows per table sample

Returns:

  • Complete schema analysis

  • Table structures with columns, types, constraints

  • Indexes and foreign keys

  • Sample data from each table (if enabled)

  • Schema metadata and statistics

Example:

{
  "name": "analyze_database_schema",
  "arguments": {
    "environment": "development",
    "includeSamples": true,
    "maxSampleRows": 5
  }
}

2. get_table_relationships

Extract and analyze foreign key relationships between tables.

Parameters:

  • environment (required): Database environment

  • tableName (optional): Filter relationships for specific table

Returns:

  • Foreign key relationships with cardinality (one-to-many, many-to-one)

  • Referential integrity rules (CASCADE, SET NULL, etc.)

  • Relationship metadata and statistics

Example:

{
  "name": "get_table_relationships",
  "arguments": {
    "environment": "production",
    "tableName": "users"
  }
}

3. validate_database_schema

Validate database schema for common issues and anti-patterns.

Parameters:

  • environment (required): Database environment

Returns:

  • Schema validation results

  • Missing primary keys

  • Foreign keys without indexes

  • Naming convention violations

  • Tables without relationships

Example:

{
  "name": "validate_database_schema",
  "arguments": {
    "environment": "production"
  }
}

4. suggest_database_optimizations

Generate schema optimization recommendations based on structure analysis.

Parameters:

  • environment (required): Database environment

Returns:

  • Prioritized optimization suggestions (high/medium/low)

  • Missing index recommendations

  • Primary key suggestions

  • Schema improvement opportunities

  • Performance optimization tips

Example:

{
  "name": "suggest_database_optimizations",
  "arguments": {
    "environment": "production"
  }
}

πŸ”Œ Connect to Claude Desktop

Connect this MCP server to Claude Desktop for AI-assisted database development.

Configuration

  1. Edit Claude Desktop config - Go to Settings β†’ Developer β†’ Edit Config

  2. Add MCP server configuration:

{
  "mcpServers": {
    "semantic-d1": {
      "command": "node",
      "args": [
        "/absolute/path/to/semantic-d1-mcp/dist/index.js"
      ],
      "env": {
        "CLOUDFLARE_ACCOUNT_ID": "your_account_id",
        "CLOUDFLARE_API_TOKEN": "your_api_token",
        "D1_DEV_DATABASE_ID": "your_dev_db_id",
        "D1_DEV_DATABASE_NAME": "your_dev_db_name",
        "D1_STAGING_DATABASE_ID": "your_staging_db_id",
        "D1_STAGING_DATABASE_NAME": "your_staging_db_name",
        "D1_PROD_DATABASE_ID": "your_prod_db_id",
        "D1_PROD_DATABASE_NAME": "your_prod_db_name"
      }
    }
  }
}
  1. Restart Claude Desktop

  2. Verify tools are available - You should see 4 D1 tools in Claude's tool list

Usage Example

In Claude Desktop:

"Analyze my production database schema and suggest optimizations for tables with foreign keys"

Claude will use the analyze_database_schema and suggest_database_optimizations tools automatically.


πŸ—οΈ Architecture

This project demonstrates Domain-Driven Hexagonal Architecture with clean separation of concerns:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   Presentation Layer                     β”‚
β”‚              (MCP Server - Protocol Handling)            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                     β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                  Application Layer                       β”‚
β”‚        (Use Cases - Schema Analysis Orchestration)      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                     β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Domain Layer                          β”‚
β”‚     (Schema Entities, Relationship Logic, Services)     β”‚
β”‚              Pure Business Logic                         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                     β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                Infrastructure Layer                      β”‚
β”‚       (Cloudflare D1 REST API, HTTP Client)             β”‚
β”‚           Technical Adapters                             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Implementation Status

Status: βœ… Hexagonal architecture refactoring complete

Current Structure:

src/
β”œβ”€β”€ domain/              # Business logic (entities, services)
β”‚   β”œβ”€β”€ entities/        # DatabaseSchema, TableInfo, Column, etc.
β”‚   β”œβ”€β”€ services/        # SchemaAnalyzer, RelationshipAnalyzer, etc.
β”‚   β”œβ”€β”€ repositories/    # Port interfaces
β”‚   └── value-objects/   # Environment enum
β”œβ”€β”€ application/         # Use cases and orchestration
β”‚   β”œβ”€β”€ use-cases/       # AnalyzeSchema, GetRelationships, etc.
β”‚   └── ports/           # Cache provider interface
β”œβ”€β”€ infrastructure/      # External adapters
β”‚   β”œβ”€β”€ adapters/        # CloudflareD1Repository, Cache
β”‚   β”œβ”€β”€ config/          # CloudflareConfig, DatabaseConfig
β”‚   └── http/            # CloudflareAPIClient
β”œβ”€β”€ presentation/        # MCP protocol layer
β”‚   └── mcp/             # D1DatabaseMCPServer
└── index.ts             # Composition root (DI)

See ARCHITECTURE.md for detailed design documentation.

Layer Responsibilities

Domain Layer:

  • Database schema entities (Schema, Table, Relationship, Index)

  • Schema analysis business logic

  • Relationship extraction logic

  • Optimization recommendation rules

Application Layer:

  • Orchestrate domain services

  • Execute use cases (AnalyzeSchema, GetRelationships, etc.)

  • Coordinate infrastructure adapters

Infrastructure Layer:

  • Cloudflare D1 REST API integration

  • HTTP client for API calls

  • Cache provider (in-memory)

Presentation Layer:

  • MCP server initialization

  • Tool registration and routing

  • Request/response formatting

Semantic Intent Principles

This codebase follows strict semantic anchoring rules:

  1. Semantic Over Structural

    // βœ… SEMANTIC: Based on observable schema properties
    const needsIndex = table.hasForeignKey() && !table.hasIndexOnForeignKey()
    
    // ❌ STRUCTURAL: Based on technical metrics
    const needsIndex = table.rowCount > 10000 && table.queryCount > 100
  2. Intent Preservation

    // βœ… Environment semantics preserved through transformations
    const schema = await fetchSchema(Environment.PRODUCTION)
    // Schema analysis preserves "production" intent - no overrides
  3. Observable Anchoring

    // βœ… Based on directly observable properties
    const relationships = extractForeignKeys(sqliteMaster)
    
    // ❌ Based on inferred behavior
    const relationships = inferFromQueryPatterns(logs)

See SEMANTIC_ANCHORING_GOVERNANCE.md for complete governance rules.


πŸ§ͺ Testing

Status: βœ… Comprehensive test suite with 398 tests passing

Test Coverage

  • βœ… Domain Layer: 212 tests (entities, services, validation)

  • βœ… Infrastructure Layer: 64 tests (D1 adapter, API client, config)

  • βœ… Application Layer: 35 tests (use cases, orchestration)

  • βœ… Presentation Layer: 13 tests (MCP server, tool routing)

  • βœ… Integration: 15 tests (end-to-end flows)

  • βœ… Value Objects: 59 tests (Environment, immutability)

Total: 398 tests (all passing βœ…)

Running Tests

# Run all tests
npm test

# Watch mode
npm run test:watch

# With UI
npm run test:ui

# Coverage report
npm run test:coverage

Test Framework

  • Vitest: Fast unit testing framework

  • @vitest/coverage-v8: Code coverage reports

  • Mock Strategy: Mock Cloudflare D1 API responses via interface implementations


πŸ“– Learning from This Implementation

This codebase serves as a reference implementation for semantic intent patterns in database tooling.

Key Files to Study

Hexagonal Architecture Implementation:

Reference Documentation:


🀝 Contributing

We welcome contributions! This is a reference implementation, so contributions should maintain semantic intent principles.

How to Contribute

  1. Read the guidelines: CONTRIBUTING.md

  2. Check refactoring plan: D1_MCP_REFACTORING_PLAN.md

  3. Follow the architecture: Maintain layer boundaries and semantic anchoring

  4. Add tests: All changes need comprehensive test coverage

  5. Document intent: Explain WHY, not just WHAT

Contribution Standards

  • βœ… Follow semantic intent patterns

  • βœ… Maintain hexagonal architecture (post-refactoring)

  • βœ… Add comprehensive tests (90%+ coverage target)

  • βœ… Include semantic documentation

  • βœ… Pass all CI checks

Quick Links:

Community


πŸ”’ Security

Security is a top priority. Please review our Security Policy for:

  • API token management best practices

  • What to commit / what to exclude

  • Reporting security vulnerabilities

  • Security checklist for deployment

Found a vulnerability? Email: security@semanticintent.dev


πŸ”¬ Research Foundation

This implementation is based on the research paper "Semantic Intent as Single Source of Truth: Immutable Governance for AI-Assisted Development".

Core Principles Applied

  1. Semantic Over Structural - Schema analysis based on meaning, not metrics

  2. Intent Preservation - Environment semantics maintained through transformations

  3. Observable Anchoring - Decisions based on directly observable schema properties

  4. Immutable Governance - Protect semantic integrity at runtime


πŸ“Š Project Roadmap

βœ… Phase 0: Initial Implementation (Complete)

  • Monolithic MCP server with 6 tools

  • D1 REST API integration

  • Basic schema analysis

βœ… Phase 1: Domain Layer (Complete)

  • 10 domain entities with semantic validation

  • 3 domain services (SchemaAnalyzer, RelationshipAnalyzer, OptimizationService)

  • 212 passing tests

βœ… Phase 2: Infrastructure Layer (Complete)

  • CloudflareD1Repository adapter

  • CloudflareAPIClient HTTP client

  • InMemoryCacheProvider

  • 64 passing tests

βœ… Phase 3: Application Layer (Complete)

  • 4 use cases (AnalyzeSchema, GetRelationships, ValidateSchema, SuggestOptimizations)

  • Port interfaces (ICloudflareD1Repository, ICacheProvider)

  • 35 passing tests

βœ… Phase 4: Presentation Layer (Complete)

  • D1DatabaseMCPServer with 4 MCP tools

  • Request/response DTOs

  • 13 passing tests

βœ… Phase 5: Integration & Composition Root (Complete)

  • Dependency injection in index.ts

  • Environment configuration

  • 15 integration tests

βœ… Phase 6: CI/CD & Documentation (Complete)

  • TypeScript build verification

  • README updated

  • 398 total tests passing

🎯 Phase 7: Production Readiness (Planned)

  • GitHub Actions CI/CD workflow

  • Dependabot automation

  • Security scanning

  • GitHub repository setup

See D1_MCP_REFACTORING_PLAN.md for detailed roadmap.


πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ™ Acknowledgments


This is a reference implementation demonstrating semantic intent patterns for database introspection. Study the code, learn the patterns, and apply them to your own projects. πŸ—οΈ

Available Tools

4 tools
analyze_database_schemaC

Analyze D1 database schema structure, tables, columns, indexes, and relationships with optional sample data

ParametersJSON Schema
NameRequiredDescriptionDefault
environmentYesDatabase environment to analyze
includeSamplesNoInclude sample data from tables (max 5 rows per table)
maxSampleRowsNoMaximum number of sample rows per table

TDQS

C2.9/5.0
Behavior2/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 mentions 'optional sample data' and 'max 5 rows per table' which provides some behavioral context, but doesn't cover important aspects like whether this is a read-only operation, performance implications, authentication requirements, rate limits, or what the analysis output format looks like.

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 and includes the optional sample data feature. Every word serves a purpose with no wasted text or redundancy.

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?

For a database analysis tool with no annotations and no output schema, the description is insufficient. It doesn't explain what the analysis output contains, how relationships are determined, what 'analyze' actually means operationally, or how this differs from the sibling tools. The context signals show this is a 3-parameter tool with 100% schema coverage, but the description doesn't compensate for the lack of behavioral and output information.

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 three parameters thoroughly. The description adds minimal value beyond the schema - it mentions 'optional sample data' which relates to 'includeSamples' parameter, but doesn't provide additional semantic context beyond what's in the parameter descriptions.

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: analyzing database schema structure including tables, columns, indexes, and relationships, with optional sample data. It uses specific verbs ('analyze') and resources ('D1 database schema structure'), but doesn't explicitly differentiate from sibling tools like 'get_table_relationships' or 'validate_database_schema'.

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 the sibling tools. It mentions 'optional sample data' but doesn't explain when to include samples versus when to use alternatives like 'suggest_schema_optimizations' or 'validate_database_schema' for different analysis needs.

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

get_table_relationshipsB

Extract and analyze foreign key relationships between tables in the database

ParametersJSON Schema
NameRequiredDescriptionDefault
environmentYesDatabase environment to analyze
tableNameNoOptional: Filter relationships for specific table

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 mentions 'extract and analyze' but doesn't clarify what analysis entails, whether it's read-only or has side effects, performance implications, or output format. For a tool with no annotations, this leaves significant behavioral 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 with zero waste. It's front-loaded with the core purpose and uses precise language. Every word earns its place, making it highly concise and well-structured.

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 moderate complexity (analyzing database relationships), no annotations, and no output schema, the description is minimally adequate. It states the purpose clearly but lacks details on behavior, output, or usage context. It meets the bare minimum for a read-oriented tool but doesn't fully compensate for missing structured data.

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 thoroughly. The description adds no additional meaning beyond what the schema providesβ€”it doesn't explain parameter interactions or usage nuances. 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 with specific verbs ('extract and analyze') and resources ('foreign key relationships between tables in the database'). It distinguishes from siblings like 'analyze_database_schema' by focusing specifically on relationships rather than general schema analysis. However, it doesn't explicitly differentiate from all siblings like 'validate_database_schema' or 'suggest_schema_optimizations'.

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 any of the sibling tools, nor does it specify use cases, prerequisites, or exclusions. The agent must infer usage from the purpose alone without explicit direction.

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

suggest_schema_optimizationsC

Analyze schema and suggest performance optimizations (missing indexes, redundant indexes, etc.)

ParametersJSON Schema
NameRequiredDescriptionDefault
environmentYesDatabase environment to analyze for optimizations

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations, the description carries full burden but provides minimal behavioral details. It mentions analysis and suggestions but doesn't disclose critical traits like whether it's read-only, requires specific permissions, has side effects, or how suggestions are formatted. This is inadequate for a tool with potential operational impact.

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

Conciseness4/5

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

The description is concise and front-loaded in a single sentence, with no wasted words. It efficiently conveys the core purpose, though it could be slightly more structured by separating purpose from examples.

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 the complexity of schema optimization analysis, no annotations, and no output schema, the description is incomplete. It lacks details on behavioral traits, output format, and usage context, leaving significant gaps for an AI agent to understand how to invoke and interpret results effectively.

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 fully documents the single parameter (environment). The description adds no additional parameter semantics beyond what the schema provides, such as examples of optimizations or how environment choice affects analysis. Baseline 3 is appropriate given 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 tool's purpose with a specific verb ('analyze') and resource ('schema'), and indicates the outcome ('suggest performance optimizations'). It distinguishes from siblings by focusing on performance rather than relationships or validation, though it doesn't explicitly name alternatives.

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 guidance is provided on when to use this tool versus the sibling tools (analyze_database_schema, get_table_relationships, validate_database_schema). The description implies usage for performance analysis but lacks explicit context, prerequisites, or exclusions.

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

validate_database_schemaB

Validate database schema integrity and detect potential issues (missing primary keys, orphaned foreign keys, etc.)

ParametersJSON Schema
NameRequiredDescriptionDefault
environmentYesDatabase environment to validate

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 mentions what the tool does ('validate' and 'detect') but doesn't describe behavioral traits such as whether it's read-only, if it requires specific permissions, its performance impact, or what the output looks like (e.g., a report or error list). For a validation tool with zero annotation coverage, this is a significant gap.

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 ('Validate database schema integrity') and adds clarifying examples ('missing primary keys, orphaned foreign keys, etc.') without unnecessary details. Every word earns its place, making it appropriately sized and well-structured.

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 moderate complexity (validation with potential issues detection), no annotations, and no output schema, the description is minimally adequate. It explains the purpose but lacks details on behavior, output format, or usage context. With no output schema, the agent doesn't know what to expect in return, which is a notable gap for a validation tool.

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 input schema has 100% description coverage, with the single parameter 'environment' well-documented in the schema itself (including enum values and description). The description adds no additional meaning about parameters beyond what the schema provides, so the baseline score of 3 is appropriate as 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: 'Validate database schema integrity and detect potential issues' with specific examples like 'missing primary keys, orphaned foreign keys, etc.' It uses a specific verb ('validate') and resource ('database schema'), but doesn't explicitly distinguish it from sibling tools like 'analyze_database_schema' or 'suggest_schema_optimizations' which might have overlapping functionality.

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 its siblings. It doesn't mention alternatives, prerequisites, or exclusions. The agent must infer usage from the tool name and description alone, which is insufficient given the presence of similar tools like 'analyze_database_schema' and 'suggest_schema_optimizations'.

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. 4 tool updates
    • First observedanalyze_database_schema
    • First observedget_table_relationships
    • First observedsuggest_schema_optimizations
    • First observedvalidate_database_schema

TDQS

A3.5/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: schema analysis, relationship extraction, optimization suggestions, and validation. There is no overlap in functionality, making it easy for an agent to select the right tool without confusion.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern (e.g., analyze_database_schema, get_table_relationships). The naming is uniform and predictable, enhancing readability and usability.

Tool Count5/5

With 4 tools, the server is well-scoped for database schema analysis. Each tool serves a specific, essential function without redundancy, making the count appropriate for the domain.

Completeness4/5

The toolset covers key aspects of schema analysis (structure, relationships, optimizations, validation), but lacks tools for executing changes or interacting with data directly. However, the provided tools form a coherent set for analysis purposes.

Maintenance

ActivityInactive
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
    Give AI agents structured database intelligence. Deterministic SQL, NULL trap detection, EXPLAIN pre-flight. MIT licensed.
    1
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    Enables safe, AI-driven database interactions with schema discovery, intent validation, and session memory, supporting multiple databases.
    14
    2
    AGPL 3.0

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/semanticintent/semantic-d1-mcp'

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