Skip to main content
Glama
sqlscope-mcp

sqlscope-mcp

by 0xmortuex

schema_graph

Read-onlyIdempotent

Maps SQLite table relationships through foreign keys, reports load order and circular references, and detects unindexed foreign-key columns plus orphan rows in sampled data.

Instructions

Show how tables relate through foreign keys: every child -> parent edge, tables with no relationships, a parents-first load order and circular references. Also reports foreign-key columns that have no index (with a CREATE INDEX suggestion as text) and checks for orphan rows (child rows whose parent does not exist) over a sample, even when PRAGMA foreign_keys is off.

format: "text" (default) or "mermaid" (an erDiagram you can paste into a renderer). orphan_sample: child rows to sample per foreign key (100-100000).

Input Schema

NameRequiredDescriptionDefault
pathYes
formatNotext
orphan_sampleNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, closed-world), and the description adds real context beyond that: orphan detection works even when PRAGMA foreign_keys is off, and index suggestions are returned as text only, never executed. The most valuable disclosure is that orphan checking is over a sample, so results are indicative rather than exhaustive.

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 main capability is front-loaded in the first sentence, followed by secondary analyses and then per-parameter glosses — a clean top-down structure. The first sentence is dense and long, but each clause adds a distinct output rather than padding.

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?

With an output schema present, return values need no explanation, and the description still front-loads the analytical scope and the sampling caveat. What it omits is minor: no note on behavior for databases with zero foreign keys or on cost of larger orphan_sample values.

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?

Schema description coverage is 0%, so the description carries the burden and largely does: it defines format's two values (text vs a pasteable mermaid erDiagram) and explains orphan_sample as child rows sampled per foreign key with a 100-100000 range. Only path is left undefined, which is defensible as an obvious database path argument.

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 names a specific verb and resource (map table relationships via foreign keys) and enumerates concrete outputs: child->parent edges, isolated tables, parents-first load order, circular references. It never names a sibling tool to contrast with (describe_table, db_overview, schema_docs), so the differentiation is inferred from the FK-graph content rather than stated.

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?

Usage is implied — an agent can deduce this is the tool for understanding relationship topology — but there is no explicit 'use this when' statement, no prerequisites (e.g. that path must point at a database file), and no exclusions against schema_docs or describe_table, which overlap in subject matter.

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