Skip to main content
Glama
aayushsinghm16

harbor-mcp-server

Run a guarded SQL query

harbor_run_query
Read-onlyIdempotent

Execute read-only SQL queries against Harbor's business database with automatic validation, row limits, and PII masking to safely retrieve subscription data.

Instructions

Run a read-only SQL query against the Harbor business database.

Every query is parsed and checked before execution. It will be rejected if it:

  • is not a SELECT (no INSERT, UPDATE, DELETE, DROP, ATTACH, PRAGMA)

  • contains more than one statement

  • touches a table outside: customers, subscriptions, plans, invoices, tickets, usage_events

  • calls a file or extension function

  • would scan the whole invoices or usage_events table without an index

A LIMIT is added if you omit one, and lowered if you exceed 500.

Args:

  • sql (string): one SQLite SELECT statement

  • limit (number, optional): row cap, 1-500, default 50

  • response_format ('markdown' | 'json'): default 'markdown'

Returns JSON: { "rows": object[], // result rows, PII columns partially masked "columns": string[], "row_count": number, "tables_read": string[], "limit_applied": number, "limit_adjusted": boolean, // true if we added or lowered your LIMIT "truncated": boolean, // true if the cap was hit and more data exists "masked_columns": string[], "duration_ms": number }

Examples:

  • "How many customers churned?" -> SELECT COUNT(*) FROM customers WHERE churned_at IS NOT NULL

  • "Revenue by plan" -> SELECT p.name, SUM(s.mrr_cents) FROM subscriptions s JOIN plans p ON p.id = s.plan_id GROUP BY p.name

  • Don't use for: changing data. Use harbor_issue_refund or harbor_extend_trial.

Errors are returned with a "How to fix" line. Read it — it names the specific column, table or clause that caused the rejection.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesA single SQLite SELECT statement. WITH ... SELECT is allowed. Anything else is rejected.
limitNoRow cap for this call. Defaults to 50, hard maximum 500.
response_formatNo'markdown' for a readable table, 'json' for machine-readable rows.markdown
Behavior5/5

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

Beyond the readOnlyHint/idempotent/destructive annotations, the description discloses rejection rules, automatic LIMIT adjustments, allowed tables, PII masking, truncation behavior, and the exact JSON return structure. This is rich behavioral context that the annotations alone do not provide.

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?

The description is longer than average, but every section earns its place: bulleted rejection rules, parameter definitions, return JSON, examples, and error guidance. It is front-loaded with the core purpose and uses clear structure for readability.

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

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex guarded SQL tool with no output schema, the description fully compensates by specifying the JSON return shape, error remediation, allowed tables, and query constraints. The agent has enough information to select and invoke the tool correctly and interpret results.

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

Parameters5/5

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

Even though schema coverage is 100%, the description adds meaningful semantics: explains LIMIT adjustment behavior, default row cap, response_format effects, and shows example SQL strings. It clarifies implication of parameters beyond schema descriptions.

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?

The description opens with 'Run a read-only SQL query against the Harbor business database', using a specific verb and resource and making the guarded, read-only nature explicit. It also distinguishes itself from sibling write tools by explicitly directing mutation use to harbor_issue_refund or harbor_extend_trial.

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

Usage Guidelines5/5

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

Provides concrete examples of appropriate queries ('How many customers churned?', 'Revenue by plan') and explicit when-not guidance: 'Don't use for: changing data. Use harbor_issue_refund or harbor_extend_trial instead.' This gives the agent clear criteria for selecting this tool over alternatives.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/aayushsinghm16/harbor-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server