Skip to main content
Glama

FinBridge

FinBridge DB Read-Only SQL

query_db
Read-only

Run a single read-only SELECT query against the local finbridge database (ingested KR/US fundamentals, filings, daily prices). The statement must start with SELECT or WITH; multiple statements, PRAGMA, and any write/DDL keywords (INSERT/UPDATE/DELETE/DROP/ALTER/CREATE/ATTACH/...) are rejected. The query runs in a separate read-only process with SQLite authorization, a 2-second deadline, two concurrent queries per server process, and a 1 MB result budget. Free accounts cannot query raw history or history views; the latest-annual snapshot remains available.

The escape hatch for questions no dedicated tool answers — Japan, Taiwan and Europe are largely reachable only this way. Prefer get_valuation or get_peers for ordinary single-company work (they handles per-market period and currency rules that a hand-written query will get wrong), and call get_db_schema first for the table shapes.

Args:

  • sql: one SELECT (or WITH ... SELECT) statement. A single trailing ';' is tolerated.

  • limit: max rows returned, 1-500 (default 50)

  • response_format: 'markdown' (default, table) or 'json' (compact)

Returns: {columns: [name], rows: [[cell, ...]], row_count, truncated} — truncated=true means more rows matched than 'limit'.

Examples (v_financials / v_latest_annual views are the easiest entry points):

  • Largest companies by latest annual revenue: "SELECT name, ticker, stock_code, fiscal_year, revenue FROM v_latest_annual ORDER BY revenue DESC LIMIT 10"

  • Samsung Electronics annual trend: "SELECT fiscal_year, revenue, operating_income, net_income FROM v_financials WHERE stock_code = '005930' AND quarter = 0 ORDER BY fiscal_year DESC"

  • KR vs US company counts: "SELECT source, COUNT(*) AS n FROM companies GROUP BY source"

  • Recent Samsung Electronics closes: "SELECT date, close FROM prices_daily p JOIN companies c ON c.id = p.company_id WHERE c.stock_code = '005930' ORDER BY date DESC LIMIT 20" (prices_daily holds KR, US, TW; US history starts 2023-03-28)

Use when: custom aggregation/joins over ingested data that no dedicated tool expresses. Don't use for anything that writes — it will be rejected. FinBridge has no real-time equity quote tool — equity prices here are end-of-day closes from the nightly ingest; the only live data is regulator filings (get_dart_filings / get_edgar_filings). Errors: non-SELECT input, ';' inside, or forbidden keywords -> rejected with the reason; unknown table/column -> SQL error with a hint to call get_db_schema first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesA single read-only SELECT (or WITH ... SELECT) statement
limitNoMax rows returned, 1-500 (default 50)
response_formatNo'markdown' for a table, 'json' for compact machine-readable outputmarkdown

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
rowsYes
columnsYes
row_countYes
truncatedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / sql / maxLength
      Added value: +16000
  2. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, but the description adds extensive behavioral context: rejection of non-SELECT input, separate read-only process with SQLite authorization, 2-second deadline, concurrency limits, 1 MB result budget, free-account restrictions, and specific error behavior (e.g., 'rejected with the reason'). No contradiction with annotations.

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?

The description is lengthy but well-structured with clear sections (overview, constraints, alternatives, args, returns, examples, when to use, errors). It is front-loaded with core purpose and constraints. While it could be trimmed slightly, every section adds value and the examples are highly instructive.

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 SQL tool, the description covers all necessary aspects: query constraints, return format, error behavior, usage context, and even points to specific views (v_financials, v_latest_annual). It explicitly mentions the output structure and includes a hint to call get_db_schema for table shapes, making it complete for an agent to use correctly.

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 100%, so the schema documents each parameter, but the description adds meaningful nuances: SQL must start with SELECT or WITH, a single trailing ';' is tolerated, limit range (1-500, default 50), and response_format choices. It also provides concrete examples that illustrate parameter usage. This goes beyond the baseline of 3.

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 a precise verb-resource-scope statement: 'Run a single read-only SELECT query against the local finbridge database (ingested KR/US fundamentals, filings, daily prices).' It clearly distinguishes itself from siblings by explicitly saying 'Prefer get_valuation or get_peers for ordinary single-company work' and positioning itself as the 'escape hatch' for questions no dedicated tool answers.

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 explicit when-to-use and when-not-to-use instructions: 'Use when: custom aggregation/joins over ingested data that no dedicated tool expresses. Don't use for anything that writes — it will be rejected.' It also names alternatives (get_valuation, get_peers) and prerequisites (call get_db_schema first).

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.