Skip to main content
Glama
Microfinance Warehouse MCP Server

Microfinance Warehouse MCP Server

run_sql

Read-onlyIdempotent

Run read-only SQL SELECT queries against the microfinance loan-portfolio warehouse to analyze vetted KPIs by branch, region, segment, gender or period. Returns up to 200 rows; writes and file access are refused.

Instructions

Run one read-only DuckDB SELECT query (at most 200 rows returned).

Only warehouse tables and the loan_position(DATE 'YYYY-MM-DD') macro can be read. Writes, file access and settings are refused with an explanation.

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

Input Schema

NameRequiredDescriptionDefault
sqlYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and closed-world, so safety is covered; the description adds genuinely new behavior: a 200-row ceiling, a restricted readable surface, and that forbidden operations are refused with an explanation rather than silently failing. It stops short of saying whether the row cap truncates silently or raises an error, which matters for an agent writing queries.

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?

Two short paragraphs, zero filler, with the operation and the row cap front-loaded before the scope restrictions. Every clause carries information the agent would otherwise have to discover by trial and error.

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?

There is no output schema, but for a SQL tool the result shape is query-dependent, so the description appropriately covers the aspects that are knowable: row limit, readable surface, and refusal behavior. A brief note on error/truncation reporting would close the remaining gap.

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% — the single 'sql' parameter is documented only as a string — so the description must carry the semantics, and it does: one statement, SELECT only, warehouse tables plus a specific macro call form with its DATE 'YYYY-MM-DD' argument syntax. It does not clarify multi-statement handling, trailing semicolons, or dialect-specific limits beyond the macro.

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?

The description gives a specific verb and resource — 'Run one read-only DuckDB SELECT query' — plus a hard result cap of 200 rows, so the agent knows exactly what operation this performs. It does not name or contrast with siblings such as compute_kpi or list_tables, leaving the agent to infer that distinction from the sibling names alone.

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

Usage Guidelines3/5

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

Useful boundaries are stated: only warehouse tables and the loan_position(DATE 'YYYY-MM-DD') macro are readable, and writes/file access/settings are refused. That functions as partial when-not guidance, but there is no positive guidance on when to reach for run_sql versus compute_kpi or list_tables, and no mention of what to do instead when a query is refused.

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