Skip to main content
Glama

generate_fix

Generates ready-to-run SQL to fix a specific Airlock RLS finding, tailored to table and policy names, for pasting into a migration file.

Instructions

Generate the exact SQL to fix a specific Airlock finding. Pure function — no database connection needed. Returns a ready-to-run SQL statement tailored to the table and policy names you provide. Use after get_findings or audit_supabase_rls to get a fix you can paste into a migration file.

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": {
      "finding_kind": "<finding_kind>",
      "table_name": "<table_name>"
    },
    "name": "generate_fix"
  }
}

Input Schema

NameRequiredDescriptionDefault
schemaNoSchema the table lives in (default: public).public
table_nameYesThe table the finding applies to (e.g. "profiles").
policy_nameNoThe policy name, if the finding is about a specific policy. Not needed for table-level findings like rls_disabled.
finding_kindYesThe finding kind to fix (e.g. 'rls_disabled', 'permissive_true').

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.2.0

TDQS

A4/5.0
Behavior4/5

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

With no annotations supplied, the description carries the burden well: it declares "Pure function — no database connection needed," which tells the agent this performs no writes and requires no credentials, and it states the return is "a ready-to-run SQL statement." It stops short of saying whether the generated SQL is validated, idempotent, or potentially destructive (e.g., a permissive policy fix that drops a policy).

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?

Four short sentences, front-loaded with the core purpose, then purity, then return value, then placement in the workflow. Every sentence carries distinct information and nothing is repeated from the schema or title.

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?

For a pure generator with no output schema, the description does the necessary work by describing what comes back (a ready-to-run SQL statement) and confirming no DB connection is touched. It leaves open how unsupported or ambiguous finding_kind values are handled, which is the main remaining gap for a tool whose only output is generated code.

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 all four parameters are already documented, including the policy_name caveat about table-level findings. The description adds only the framing that output is "tailored to the table and policy names you provide," which does not add syntax or validity rules for finding_kind beyond what the schema states. Baseline 3 is appropriate.

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?

Specific verb and resource: "Generate the exact SQL to fix a specific Airlock finding," which clearly separates it from the scanning tools (get_findings, audit_supabase_rls) that produce findings rather than fixes. It does not explicitly contrast with the sibling explain_finding, which is the nearest ambiguity, so it falls short of a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit upstream sequencing: "Use after get_findings or audit_supabase_rls to get a fix you can paste into a migration file." That tells the agent exactly when in the workflow to call it. It offers no when-not guidance (e.g., use explain_finding instead if you only want the rationale), so it is clear context without exclusions.

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