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 screen_companies for ordinary fundamental screens (it 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 screen_companies cannot express. 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 crypto (get_crypto_ticker) and 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 mark it read-only, but the description adds substantial behavioral detail: rejected non-SELECT inputs, forbidden keywords, separate read-only process, 2-second deadline, concurrent query limit, 1 MB result budget, and free-account restrictions. 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?

Well-organized with sections for description, args, returns, examples, use-when, and errors. Some redundancy exists between the main description and the sql parameter description, but the content is dense and purposeful.

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?

Covers input constraints, output shape (columns, rows, row_count, truncated), example queries, error behavior, and data limitations. This is a complex SQL tool and the description gives an agent everything needed to use it 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 descriptions already fully cover all three parameters. The tool description adds meaningful examples, clarifies trailing semicolon tolerance, explains compact JSON output, and notes helpful views and data coverage, going beyond the baseline.

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?

States exactly what it does: runs a single read-only SELECT query against the FinBridge database. Clearly differentiates from sibling tools like screen_companies and get_db_schema by name and scope.

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 'Use when' guidance (custom aggregation/joins that screen_companies cannot express) and explicit 'Don't use' guidance (anything that writes; no real-time equity data). Names relevant alternative tools such as get_crypto_ticker, get_dart_filings, and get_edgar_filings.

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.