Skip to main content
Glama
stand-out-of-my-sun

Diogenes Database Intelligence, SQL Engine & Schema Guard MCP

SQL Query Telemetry PII Scrubber & Parameterization Masker

sanitize_sql_telemetry
Read-onlyIdempotent

Masks PII, financial values, and credentials in raw SQL query logs and slow-query dumps before telemetry storage or APM ingestion.

Instructions

Masks PII, financial values, and credential literals from raw SQL query logs and slow-query dumps before telemetry storage. Use when scrubbing production database query logs before shipping to APM tools, Datadog, or external log collectors; for auditing SQL injection vulnerabilities, use audit_sql_injection_ast instead. Stateless read-only edge call (max 32 KB, 60 RPM): accepts 'query_logs' ('masking_policy' defaults to 'mask_pii_and_literals'), supports '?demo=true' or L402 (10 sats), and returns HTTP 400 if invalid.

Input Schema

NameRequiredDescriptionDefault
hash_saltNoOptional salt string for deterministic pseudonymization of user IDs.
query_logsYesRaw SQL query text or multi-line database query log strings requiring sanitization.
masking_policyNoScrubbing rigor policy: mask PII and literals, anonymize all constants, or strict AST parameterization.

Output Schema

NameRequiredDescriptionDefault
sanitized_logsYesClean query logs with sensitive constants replaced by parameter placeholders.
parameterized_templatesYesNormalized abstract query patterns suitable for APM metrics grouping.
redacted_literals_countYesTotal number of strings, numbers, and PII literals scrubbed from logs.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, and the description still adds substantial context beyond them: stateless edge call, 32 KB payload cap, 60 RPM rate limit, the default masking policy, demo/L402 (10 sats) access, and a 400 error on invalid input. These are operational facts an agent cannot get from structured fields.

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?

Two sentences, front-loaded with purpose and alternative before operational constraints. Dense but every clause carries information; the only cost is that the constraint clause is packed into one long sentence that is harder to scan than a short bullet list would be.

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?

With an output schema covering return values and annotations covering the safety profile, the description fills the remaining gaps an agent needs: input limits, rate limit, default policy, payment path, and error behavior. Nothing required to call it correctly 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 schema carries the parameter burden and 3 is the baseline. The description adds the meaningful default for masking_policy (mask_pii_and_literals) which the schema omits, but never mentions hash_salt or the policy trade-offs, so it doesn't go beyond the schema in a substantive way.

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 plus resource: masks PII, financial values, and credential literals from raw SQL query logs and slow-query dumps before telemetry storage. It also names the sibling it is not (audit_sql_injection_ast), so an agent can route correctly without opening either 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?

Explicit trigger context: 'Use when scrubbing production database query logs before shipping to APM tools, Datadog, or external log collectors.' It names an alternative and the condition selecting it ('for auditing SQL injection vulnerabilities, use audit_sql_injection_ast instead'), leaving nothing to inference.

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