Skip to main content
Glama

Profile a warehouse schema

profile_schema
Read-onlyIdempotent

Profiles a warehouse schema into a minimal Apache Ossie semantic model by inferring keys, time fields, table kinds, and relationships with evidence and confidence, then outputs YAML and open questions.

Instructions

Profile a warehouse schema into a minimal Apache Ossie semantic model, the first step towards a GASP mapping (readiness level 1). Pass the schema as the rows of information_schema.columns (JSON or CSV with table, column and type), an object with a tables list, or CREATE TABLE statements, read through your own warehouse MCP or from a dump. Optionally pass statistics per column (rows, nulls, distinct, min, max, values); output: statistics returns the query that gathers them. For every table the profile infers the key, the time field and the kind (snapshot, event, fact or reference), each with its evidence and confidence, plus the relationships the columns imply; a low-confidence inference is left out of the model and listed as a question for the Decide step rather than guessed. The report ends with the model as YAML, to pass to propose_mapping as semantic_model; the questions go to record_decision.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "schema": "<schema>"
    },
    "name": "profile_schema"
  }
}

Input Schema

NameRequiredDescriptionDefault
outputNo'report' (default): the profile with evidence, questions and the model as YAML; 'model': the YAML alone; 'json': the profile and the model as data; 'statistics': the SQL that gathers the statistics for this schema.
schemaYesThe schema: information_schema.columns rows as JSON (array of objects with table_name, column_name, data_type, optionally table_schema and is_nullable) or CSV with those headers; or { tables: [{ name, schema?, columns: [{ name, type }] }] }; or CREATE TABLE statements (PRIMARY KEY and REFERENCES clauses are read).
dialectNoWith output: statistics, the warehouse the query is written for (the string type of its min and max columns); postgres by default.
statisticsNoPer-column statistics as JSON rows or CSV: table, column, rows (or row_count), nulls (or null_count or null_rate), distinct (or distinct_count), min, max, values (a JSON array or a | separated list for a short list of values). Optional; the profile says what they would settle.
organizationNoThe company's name, used in the model's name.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, non-destructive and closed-world, so the safety profile is covered. The description adds genuinely non-obvious behavior: per-table inferences (key, time field, kind) carry evidence and confidence, and low-confidence inferences are deliberately omitted and surfaced as questions rather than guessed. The main residual gap is that it doesn't say how large a schema it handles well or what happens on unparseable input.

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 core purpose and the next-step routing are front-loaded in the first two clauses, and the paragraph is dense rather than padded. It loses a little by repeating schema-format and statistics-column detail that the schema descriptions already carry verbatim.

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?

There is no output schema, and the description compensates fully: it enumerates what the report contains (per-table inferences with evidence and confidence, implied relationships, open questions) and what each output mode returns, including that statistics mode emits SQL. Nothing an agent needs in order to call it and interpret the result is missing.

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 coverage is 100%, so the input schema already documents every parameter, including the output enum, the accepted schema formats, and the statistics column aliases. The description largely restates that same format detail (information_schema.columns, CSV, tables list, CREATE TABLE) rather than adding new meaning, so the baseline 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?

States a specific verb and resource ("Profile a warehouse schema into a minimal Apache Ossie semantic model") and pins the artifact's place in the pipeline ("the first step towards a GASP mapping (readiness level 1)"). An agent can distinguish this from propose_mapping, compile_model, or readiness_report without opening any schema.

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?

Gives explicit routing: the resulting YAML goes to propose_mapping as semantic_model, and the open questions go to record_decision. It also states acceptable input sources (your own warehouse MCP or a dump) and the optional-statistics path, so both when-to-use and what-to-do-next are covered.

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