Skip to main content
Glama

pii_scan

Read-onlyIdempotent

Sweep string columns across tables for common PII patterns (email, SSN, credit card, phone, JWT, bearer tokens). Heuristic-only — not a compliance guarantee. [BUILD tier]

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
connectionNoTarget connection name from this tenant's inventory. Call `list_connections` to see every name + dialect, then match semantically to the user's intent (e.g. 'analytics' → a connection named `*-analytics-*`; 'prod' → a connection with `prod-` prefix). If the user didn't specify, use the tenant's default (first added). Do not invent names — resolve from `list_connections` output.
max_tablesNoMax tables to sample (default 25, cap 50)
sample_rowsNoRows sampled per table (default 20, cap 100; values < 5 are floored to 5)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataNo
metaNo
displayNo
summaryNo
insightsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • changedOutput schema / properties / data / anyOf
      Previous value: -[
      -  {
      -    "items": {
      -      "additionalProperties": true,
      -      "properties": {
      -        "column": {
      -          "type": "string"
      -        },
      -        "kind": {
      -          "type": "string"
      -        },
      -        "sample_matches": {
      -          "type": [
      -            "number",
      -            "string"
      -          ]
      -        },
      -        "sampled_rows": {
      -          "$ref": "#/properties/data/anyOf/0/items/properties/sample_matches"
      -        },
      -        "severity": {
      -          "anyOf": [
      -            {
      -              "enum": [
      -                "info",
      -                "warning",
      -                "critical"
      -              ],
      -              "type": "string"
      -            },
      -            {
      -              "type": "string"
      -            }
      -          ]
      -        },
      -        "table": {
      -          "type": "string"
      -        }
      -      },
      -      "required": [
      -        "table",
      -        "column",
      -        "kind",
      -        "severity"
      -      ],
      -      "type": "object"
      -    },
      -    "type": "array"
      -  },
      -  {
      -    "additionalProperties": true,
      -    "properties": {
      -      "code": {
      -        "type": "string"
      -      },
      -      "details": {
      -        "additionalProperties": {},
      -        "type": "object"
      -      },
      -      "error": {
      -        "type": "string"
      -      },
      -      "internal_code": {
      -        "type": "string"
      -      },
      -      "message": {
      -        "type": "string"
      -      },
      -      "retry_after_s": {
      -        "type": "number"
      -      }
      -    },
      -    "required": [
      -      "error"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "items": {
      +      "additionalProperties": true,
      +      "properties": {
      +        "column": {
      +          "type": "string"
      +        },
      +        "kind": {
      +          "type": "string"
      +        },
      +        "sample_matches": {
      +          "type": [
      +            "number",
      +            "string"
      +          ]
      +        },
      +        "sampled_rows": {
      +          "$ref": "#/properties/data/anyOf/0/items/properties/sample_matches"
      +        },
      +        "severity": {
      +          "anyOf": [
      +            {
      +              "enum": [
      +                "info",
      +                "warning",
      +                "critical"
      +              ],
      +              "type": "string"
      +            },
      +            {
      +              "type": "string"
      +            }
      +          ]
      +        },
      +        "table": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "table",
      +        "column",
      +        "kind",
      +        "severity"
      +      ],
      +      "type": "object"
      +    },
      +    "type": "array"
      +  },
      +  {
      +    "additionalProperties": true,
      +    "properties": {
      +      "code": {
      +        "type": "string"
      +      },
      +      "details": {
      +        "additionalProperties": {},
      +        "type": "object"
      +      },
      +      "error": {
      +        "type": "string"
      +      },
      +      "internal_code": {
      +        "type": "string"
      +      },
      +      "message": {
      +        "type": "string"
      +      },
      +      "retry_after_s": {
      +        "type": "number"
      +      },
      +      "retryable": {
      +        "type": "boolean"
      +      }
      +    },
      +    "required": [
      +      "error"
      +    ],
      +    "type": "object"
      +  }
      +]
    • addedOutput schema / properties / meta / properties / maskedCells
      Added value: +{
      +  "type": "number"
      +}
    • addedOutput schema / properties / meta / properties / maskedColumns
      Added value: +{
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / meta / properties / rowCapReached
      Added value: +{
      +  "type": "boolean"
      +}
  2. Changed1 schema field changed
    • changedOutput schema / properties / data / anyOf
      Previous value: -[
      -  {
      -    "items": {
      -      "additionalProperties": true,
      -      "properties": {
      -        "column": {
      -          "type": "string"
      -        },
      -        "kind": {
      -          "type": "string"
      -        },
      -        "sample_matches": {
      -          "type": [
      -            "number",
      -            "string"
      -          ]
      -        },
      -        "sampled_rows": {
      -          "$ref": "#/properties/data/anyOf/0/items/properties/sample_matches"
      -        },
      -        "severity": {
      -          "anyOf": [
      -            {
      -              "enum": [
      -                "info",
      -                "warning",
      -                "critical"
      -              ],
      -              "type": "string"
      -            },
      -            {
      -              "type": "string"
      -            }
      -          ]
      -        },
      -        "table": {
      -          "type": "string"
      -        }
      -      },
      -      "required": [
      -        "table",
      -        "column",
      -        "kind",
      -        "severity"
      -      ],
      -      "type": "object"
      -    },
      -    "type": "array"
      -  },
      -  {
      -    "additionalProperties": true,
      -    "properties": {
      -      "code": {
      -        "type": "string"
      -      },
      -      "details": {
      -        "additionalProperties": {},
      -        "type": "object"
      -      },
      -      "error": {
      -        "type": "string"
      -      },
      -      "internal_code": {
      -        "type": "string"
      -      },
      -      "message": {
      -        "type": "string"
      -      },
      -      "retry_after_s": {
      -        "type": "number"
      -      }
      -    },
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "items": {
      +      "additionalProperties": true,
      +      "properties": {
      +        "column": {
      +          "type": "string"
      +        },
      +        "kind": {
      +          "type": "string"
      +        },
      +        "sample_matches": {
      +          "type": [
      +            "number",
      +            "string"
      +          ]
      +        },
      +        "sampled_rows": {
      +          "$ref": "#/properties/data/anyOf/0/items/properties/sample_matches"
      +        },
      +        "severity": {
      +          "anyOf": [
      +            {
      +              "enum": [
      +                "info",
      +                "warning",
      +                "critical"
      +              ],
      +              "type": "string"
      +            },
      +            {
      +              "type": "string"
      +            }
      +          ]
      +        },
      +        "table": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "table",
      +        "column",
      +        "kind",
      +        "severity"
      +      ],
      +      "type": "object"
      +    },
      +    "type": "array"
      +  },
      +  {
      +    "additionalProperties": true,
      +    "properties": {
      +      "code": {
      +        "type": "string"
      +      },
      +      "details": {
      +        "additionalProperties": {},
      +        "type": "object"
      +      },
      +      "error": {
      +        "type": "string"
      +      },
      +      "internal_code": {
      +        "type": "string"
      +      },
      +      "message": {
      +        "type": "string"
      +      },
      +      "retry_after_s": {
      +        "type": "number"
      +      }
      +    },
      +    "required": [
      +      "error"
      +    ],
      +    "type": "object"
      +  }
      +]
  3. Changed6 schema fields changed
    • addedInput schema / properties / connection / maxLength
      Added value: +256
    • addedInput schema / properties / max_tables / maximum
      Added value: +50
    • addedInput schema / properties / max_tables / minimum
      Added value: +1
    • changedInput schema / properties / sample_rows / description
      Previous value: -"Rows sampled per table (default 20, cap 100)"New value: +"Rows sampled per table (default 20, cap 100; values < 5 are floored to 5)"
    • addedInput schema / properties / sample_rows / maximum
      Added value: +100
    • addedInput schema / properties / sample_rows / minimum
      Added value: +1
  4. Changed2 schema fields changed
    • addedOutput schema / properties / display / properties / map
      Added value: +{
      +  "additionalProperties": true,
      +  "properties": {
      +    "label": {
      +      "type": "string"
      +    },
      +    "lat": {
      +      "type": "string"
      +    },
      +    "lon": {
      +      "type": "string"
      +    },
      +    "title": {
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
    • changedOutput schema / properties / display / properties / type / anyOf
      Previous value: -[
      -  {
      -    "enum": [
      -      "table",
      -      "chart",
      -      "metric",
      -      "code",
      -      "text",
      -      "list"
      -    ],
      -    "type": "string"
      -  },
      -  {
      -    "type": "string"
      -  }
      -]New value: +[
      +  {
      +    "enum": [
      +      "table",
      +      "chart",
      +      "metric",
      +      "code",
      +      "text",
      +      "list",
      +      "map"
      +    ],
      +    "type": "string"
      +  },
      +  {
      +    "type": "string"
      +  }
      +]
  5. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": true,
      +  "properties": {
      +    "data": {
      +      "anyOf": [
      +        {
      +          "items": {
      +            "additionalProperties": true,
      +            "properties": {
      +              "column": {
      +                "type": "string"
      +              },
      +              "kind": {
      +                "type": "string"
      +              },
      +              "sample_matches": {
      +                "type": [
      +                  "number",
      +                  "string"
      +                ]
      +              },
      +              "sampled_rows": {
      +                "$ref": "#/properties/data/anyOf/0/items/properties/sample_matches"
      +              },
      +              "severity": {
      +                "anyOf": [
      +                  {
      +                    "enum": [
      +                      "info",
      +                      "warning",
      +                      "critical"
      +                    ],
      +                    "type": "string"
      +                  },
      +                  {
      +                    "type": "string"
      +                  }
      +                ]
      +              },
      +              "table": {
      +                "type": "string"
      +              }
      +            },
      +            "required": [
      +              "table",
      +              "column",
      +              "kind",
      +              "severity"
      +            ],
      +            "type": "object"
      +          },
      +          "type": "array"
      +        },
      +        {
      +          "additionalProperties": true,
      +          "properties": {
      +            "code": {
      +              "type": "string"
      +            },
      +            "details": {
      +              "additionalProperties": {},
      +              "type": "object"
      +            },
      +            "error": {
      +              "type": "string"
      +            },
      +            "internal_code": {
      +              "type": "string"
      +            },
      +            "message": {
      +              "type": "string"
      +            },
      +            "retry_after_s": {
      +              "type": "number"
      +            }
      +          },
      +          "type": "object"
      +        }
      +      ]
      +    },
      +    "display": {
      +      "additionalProperties": true,
      +      "properties": {
      +        "chart": {
      +          "additionalProperties": true,
      +          "properties": {
      +            "chartType": {
      +              "type": "string"
      +            },
      +            "color": {
      +              "type": "string"
      +            },
      +            "title": {
      +              "type": "string"
      +            },
      +            "x": {
      +              "type": "string"
      +            },
      +            "xLabel": {
      +              "type": "string"
      +            },
      +            "y": {
      +              "anyOf": [
      +                {
      +                  "type": "string"
      +                },
      +                {
      +                  "items": {
      +                    "type": "string"
      +                  },
      +                  "type": "array"
      +                }
      +              ]
      +            },
      +            "yLabel": {
      +              "type": "string"
      +            }
      +          },
      +          "type": "object"
      +        },
      +        "code": {
      +          "additionalProperties": true,
      +          "properties": {
      +            "executable": {
      +              "type": "boolean"
      +            },
      +            "language": {
      +              "anyOf": [
      +                {
      +                  "enum": [
      +                    "sql",
      +                    "json",
      +                    "bash",
      +                    "typescript"
      +                  ],
      +                  "type": "string"
      +                },
      +                {
      +                  "type": "string"
      +                }
      +              ]
      +            },
      +            "title": {
      +              "type": "string"
      +            }
      +          },
      +          "type": "object"
      +        },
      +        "metric": {
      +          "additionalProperties": true,
      +          "properties": {
      +            "label": {
      +              "type": "string"
      +            },
      +            "status": {
      +              "anyOf": [
      +                {
      +                  "enum": [
      +                    "good",
      +                    "warning",
      +                    "critical"
      +                  ],
      +                  "type": "string"
      +                },
      +                {
      +                  "type": "string"
      +                }
      +              ]
      +            },
      +            "trend": {
      +              "anyOf": [
      +                {
      +                  "enum": [
      +                    "up",
      +                    "down",
      +                    "neutral"
      +                  ],
      +                  "type": "string"
      +                },
      +                {
      +                  "type": "string"
      +                }
      +              ]
      +            },
      +            "trendValue": {
      +              "type": "string"
      +            },
      +            "unit": {
      +              "type": "string"
      +            },
      +            "value": {
      +              "type": [
      +                "string",
      +                "number"
      +              ]
      +            }
      +          },
      +          "type": "object"
      +        },
      +        "type": {
      +          "anyOf": [
      +            {
      +              "enum": [
      +                "table",
      +                "chart",
      +                "metric",
      +                "code",
      +                "text",
      +                "list"
      +              ],
      +              "type": "string"
      +            },
      +            {
      +              "type": "string"
      +            }
      +          ]
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "insights": {
      +      "items": {
      +        "additionalProperties": true,
      +        "properties": {
      +          "column": {
      +            "type": "string"
      +          },
      +          "message": {
      +            "type": "string"
      +          },
      +          "severity": {
      +            "anyOf": [
      +              {
      +                "enum": [
      +                  "info",
      +                  "warning",
      +                  "critical"
      +                ],
      +                "type": "string"
      +              },
      +              {
      +                "type": "string"
      +              }
      +            ]
      +          },
      +          "value": {}
      +        },
      +        "required": [
      +          "severity",
      +          "message"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "meta": {
      +      "additionalProperties": true,
      +      "properties": {
      +        "cacheHit": {
      +          "type": "boolean"
      +        },
      +        "connection": {
      +          "type": "string"
      +        },
      +        "dialect": {
      +          "anyOf": [
      +            {
      +              "enum": [
      +                "postgres",
      +                "mysql",
      +                "mssql"
      +              ],
      +              "type": "string"
      +            },
      +            {
      +              "type": "string"
      +            }
      +          ]
      +        },
      +        "executionTimeMs": {
      +          "$ref": "#/properties/data/anyOf/0/items/properties/sample_matches"
      +        },
      +        "plan": {},
      +        "rowCount": {
      +          "$ref": "#/properties/data/anyOf/0/items/properties/sample_matches"
      +        },
      +        "tool": {
      +          "type": "string"
      +        },
      +        "truncated": {
      +          "type": "boolean"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "summary": {
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
  6. First observed

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnlyHint, idempotentHint, openWorldHint), and the description adds real value on top: it discloses that detection is heuristic and explicitly disclaims compliance-grade accuracy. That reliability caveat is exactly the kind of trait an agent needs to reason about the output. It stops short of describing scan cost, duration, or how hits are reported in the response.

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 and a tier tag, with the core action front-loaded before the caveat. Every clause earns its place; nothing is redundant.

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?

An output schema exists, so return-shape details are correctly omitted, and the sampling controls are fully handled by the schema. Scope, method and reliability limits are covered. The remaining gap is routing context — an agent still has to guess whether to run this or data_profile first.

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 connection, max_tables, and sample_rows are fully documented in the schema itself, including defaults, caps, and the floor behavior for sample_rows. The description adds no per-parameter meaning beyond restating that it walks tables and string columns, so the baseline 3 applies.

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?

States a specific verb (sweep) and resource (string columns across tables) and enumerates the pattern classes it looks for (email, SSN, credit card, phone, JWT, bearer tokens). The PII focus inherently separates it from generic profiling siblings like data_profile and analyze_table, though it never names an alternative explicitly.

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 statement of when to reach for this scan versus data_profile or describe_schema, and no prerequisites or exclusions. The only guidance-adjacent content is the caveat that it is heuristic-only, which sets expectations but does not tell the agent when to select the tool.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources