Skip to main content
Glama
Portward

Portward

by hamzaelsiesy

matching_login_sql

Generates setup SQL for a read-only Postgres or Snowflake login that can read exactly what a connection's applied profiles grant, so the database hides everything else.

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/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses that this produces text for a human to execute rather than changing the database, that the result is read-only, and that a password/key placeholder is emitted because Portward does not store secrets. It omits what happens when the connection has no applied profiles or how errors surface.

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-loaded with the action and scope, then parameter behavior, then the secret-handling caveat — a sensible order. The sentences are dense with subordinate clauses ("...so the database itself hides what isn't granted"), which is justified rationale but makes the prose heavier than it needs to be.

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 three-parameter, no-annotation, no-output-schema tool this is close to sufficient: it covers the artifact produced, the two modes, supported engines, and the credential placeholder. The remaining gap is the meaning of the required `source` argument and any precondition about profiles being applied.

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?

Schema coverage is 0%, so the description must compensate, and it largely does: `login` is explained as naming a new login with a concrete default of portward_<source>, and `current_login` is explained as retargeting the connection's existing login. `source` is only implied through its use in the default login name — its identity as the connection/source selector is never stated outright.

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 concrete verb+artifact ("Write setup SQL") and a precise scope: a read-only login that can read exactly what a connection's applied profiles grant, for Postgres or Snowflake. The purpose is unmistakable, but it never contrasts itself with a nearby sibling such as apply_profile, so the agent must infer the boundary between provisioning access and generating the SQL that does it.

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 clear operating context: the SQL goes to the user or their DBA to run, not to the tool, and it spells out the two modes — `login` for a new login, `current_login` to tighten the existing one. It stops short of stating preconditions (profiles must already be applied) or exclusions (which engines or connection states are unsupported).

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