Skip to main content
Glama
Safe SQL MCP

Safe SQL MCP

by korolserhii

get_metric

Computes business metrics using the owner's pre-checked SQL rules, optionally for the last N days, so you can answer business questions without writing queries.

Instructions

Business numbers by the owner's own rules, computed with pre-checked SQL. Prefer this over run_query whenever a metric fits the question. days: the last N days, or omit for all time. Always tell the user the period and the rule that come back with the answer.

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

Input Schema

NameRequiredDescriptionDefault
daysNo
nameYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full burden. It does disclose useful behavior beyond the schema: results are pre-checked SQL, each answer comes back with a period and a rule, and the agent should surface both to the user. It never states read-only/safety characteristics, permission requirements, or failure behavior for unknown metric names.

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?

Four short sentences, front-loaded with the purpose and the routing rule before parameter detail. Every sentence carries information; the only minor friction is the mid-sentence inline parameter note embedded in the prose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/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 values need no explanation, and the period/rule disclosure is a nice extra. The critical gap is the required `name` argument: with no enum, no format hint, and no discovery path, an agent cannot reliably construct a valid call from this definition alone.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate for both parameters. It explains `days` well ('the last N days, or omit for all time'), but `name` — the only required parameter — is given no explanation of expected values, format, or how to discover valid metric names.

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+resource: returns a named business metric computed from pre-checked SQL, and explicitly distinguishes itself from the sibling run_query. The phrase 'Business numbers by the owner's own rules' is a bit marketing-flavored, but 'a metric' plus the run_query contrast makes the purpose unambiguous.

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 an explicit routing rule: prefer this over run_query whenever a metric fits the question, which implies run_query is the fallback when none does. It stops short of telling the agent how to determine whether a metric 'fits' (e.g., how to discover available metric names), so the guidance is clear but not complete.

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

Deploy Server

Other Tools