Skip to main content
Glama

Write SQL for a matching login

matching_login_sql
Read-only

Generate setup SQL for a read-only Postgres or Snowflake login limited to rows and columns granted by a connection's applied profiles; run it as user or DBA so the DB hides ungranted data.

Instructions

Write setup SQL for a read-only database login that can read exactly what a connection's applied profiles grant (Postgres or Snowflake), for the user or their DBA to run, so the database itself hides what isn't granted. login names a new login (default portward_); current_login tightens the login the connection uses now instead. The SQL has a placeholder where the password or key goes; Portward doesn't keep it.

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": {
      "source": "<source>"
    },
    "name": "matching_login_sql"
  }
}

Input Schema

NameRequiredDescriptionDefault
loginNo
sourceYes
current_loginNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already cover read-only, non-destructive, non-open-world behavior, yet the description adds real context: the SQL contains a placeholder for the password/key and Portward does not retain it, and the intent is that the database itself enforces hiding of ungranted data. This makes clear the tool emits text rather than performing database changes, with no credential-handling side effects.

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?

Front-loads what the tool produces and for whom, then covers the two mode parameters and the credential-placeholder caveat. Dense but every sentence carries information; minor awkwardness in the 'for the user or their DBA to run' clause.

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 3-parameter, no-output-schema, side-effect-free tool, this is close to complete: purpose, consumer, mode selection, and credential handling are all covered. The only gap is a fuller statement of what `source` refers to and what the returned SQL text looks like as a payload.

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?

With schema coverage at 0%, the description carries the burden and largely does: it explains that `login` names a new login with a default of portward_<source>, and that `current_login` switches to tightening the existing connection login. `source` itself is only implied via the dialect mention and the default-name pattern, so it is not fully specified.

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 artifact (write setup SQL) for a specific resource (read-only database login scoped to a connection's applied profile grants) and names the dialects (Postgres or Snowflake). An agent can tell this generates SQL text rather than executing anything, which distinguishes it from query/run_saved siblings.

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?

Clear about who consumes the output (the user or their DBA runs it) and explicitly splits the two modes: `login` creates a new login, `current_login` tightens the login the connection uses now. No explicit exclusions or named alternative tools, but the mode-selection guidance is unambiguous.

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